Documentation ¶
Index ¶
- Constants
- Variables
- type App
- func (app *App) Abci() *abci.App
- func (app *App) ApplyReferralCode(ctx context.Context, tx abci.Tx) error
- func (app *App) ApplySnapshotChunk(ctx context.Context, req *tmtypes.RequestApplySnapshotChunk) (*tmtypes.ResponseApplySnapshotChunk, error)
- func (app *App) CheckAmendAmmForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckAmendOrderForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckApplyReferralCode(_ context.Context, tx abci.Tx) error
- func (app *App) CheckBatchMarketInstructions(_ context.Context, tx abci.Tx) error
- func (app *App) CheckBatchMarketInstructionsW(f func(context.Context, abci.Tx) error) func(context.Context, abci.Tx) error
- func (app *App) CheckBatchPropose(_ context.Context, tx abci.Tx, deterministicBatchID string) error
- func (app *App) CheckBatchProposeW(f func(context.Context, abci.Tx) error) func(context.Context, abci.Tx) error
- func (app *App) CheckCancelAmmForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckCancelLPForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckCancelOrderForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckCreateOrUpdateReferralSet(_ context.Context, tx abci.Tx) error
- func (app *App) CheckLPAmendForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckLPSubmissionForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckOrderSubmissionForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckPropose(_ context.Context, tx abci.Tx) error
- func (app *App) CheckProposeW(f func(context.Context, abci.Tx) error) func(context.Context, abci.Tx) error
- func (app *App) CheckProtocolUpgradeProposal(ctx context.Context, tx abci.Tx) error
- func (app *App) CheckSubmitAmmForSpam(_ context.Context, tx abci.Tx) error
- func (app *App) CheckSubmitOracleData(_ context.Context, tx abci.Tx) error
- func (app *App) CheckTransferCommand(_ context.Context, tx abci.Tx) error
- func (app *App) CreateReferralSet(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverAmendAMM(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverAmendLiquidityProvision(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverAmendOrder(ctx context.Context, tx abci.Tx, deterministicID string) (errl error)
- func (app *App) DeliverAnnounceNode(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverBatchMarketInstructions(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverBatchPropose(ctx context.Context, tx abci.Tx, deterministicBatchID string) (err error)
- func (app *App) DeliverCancelAMM(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverCancelLiquidityProvision(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverCancelOrder(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverCancelTransferFunds(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverChainEvent(ctx context.Context, tx abci.Tx, id string) error
- func (app *App) DeliverDelegate(ctx context.Context, tx abci.Tx) (err error)
- func (app *App) DeliverEthereumKeyRotateSubmission(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverIssueSignatures(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverKeyRotateSubmission(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverLiquidityProvision(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverNodeSignature(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverNodeVote(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverPropose(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverProtocolUpgradeCommand(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverStateVarProposal(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverStopOrdersCancellation(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverStopOrdersSubmission(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverSubmitAMM(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverSubmitOracleData(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverSubmitOrder(ctx context.Context, tx abci.Tx, deterministicID string) error
- func (app *App) DeliverTransferFunds(ctx context.Context, tx abci.Tx, id string) error
- func (app *App) DeliverUndelegate(ctx context.Context, tx abci.Tx) (err error)
- func (app *App) DeliverValidatorHeartbeat(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverVote(ctx context.Context, tx abci.Tx) error
- func (app *App) DeliverWithdraw(ctx context.Context, tx abci.Tx, id string) error
- func (app *App) Finalize() []byte
- func (app *App) Info(_ context.Context, _ *tmtypes.RequestInfo) (*tmtypes.ResponseInfo, error)
- func (app *App) JoinTeam(ctx context.Context, tx abci.Tx) error
- func (app *App) ListSnapshots(_ context.Context, _ *tmtypes.RequestListSnapshots) (*tmtypes.ResponseListSnapshots, error)
- func (app *App) LoadSnapshotChunk(_ context.Context, req *tmtypes.RequestLoadSnapshotChunk) (*tmtypes.ResponseLoadSnapshotChunk, error)
- func (app *App) OfferSnapshot(_ context.Context, req *tmtypes.RequestOfferSnapshot) (*tmtypes.ResponseOfferSnapshot, error)
- func (app *App) OnBeginBlock(blockHeight uint64, blockHash string, blockTime time.Time, proposer string, ...) context.Context
- func (app *App) OnBlockchainEVMChainConfigUpdate(_ context.Context, conf any) error
- func (app *App) OnBlockchainPrimaryEthereumConfigUpdate(_ context.Context, conf any) error
- func (app *App) OnCheckTx(ctx context.Context, _ *tmtypes.RequestCheckTx, tx abci.Tx) (context.Context, *tmtypes.ResponseCheckTx)
- func (app *App) OnCheckTxSpam(tx abci.Tx) tmtypes.ResponseCheckTx
- func (app *App) OnCommit() (*tmtypes.ResponseCommit, error)
- func (app *App) OnEndBlock(blockHeight uint64) (tmtypes.ValidatorUpdates, types1.ConsensusParams)
- func (app *App) OnInitChain(req *tmtypes.RequestInitChain) (*tmtypes.ResponseInitChain, error)
- func (app *App) OnSpamProtectionMaxBatchSizeUpdate(_ context.Context, u *num.Uint) error
- func (app *App) ReloadConf(cfg Config)
- func (app *App) RequireValidatorMasterPubKey(_ context.Context, tx abci.Tx) error
- func (app *App) RequireValidatorMasterPubKeyW(f func(context.Context, abci.Tx) error) func(context.Context, abci.Tx) error
- func (app *App) RequireValidatorPubKey(_ context.Context, tx abci.Tx) error
- func (app *App) RequireValidatorPubKeyW(f func(context.Context, abci.Tx) error) func(context.Context, abci.Tx) error
- func (app *App) SendTransactionResult(f func(context.Context, abci.Tx) error) func(context.Context, abci.Tx) error
- func (app *App) UpdateMarginMode(ctx context.Context, tx abci.Tx) error
- func (app *App) UpdatePartyProfile(ctx context.Context, tx abci.Tx) error
- func (app *App) UpdateReferralSet(ctx context.Context, tx abci.Tx) error
- type Assets
- type BMIError
- type BMIProcessor
- type BalanceChecker
- type Banking
- type BlockchainClient
- type Broker
- type Checkpoint
- type Config
- type DelegationEngine
- type ERC20MultiSigTopology
- type EpochService
- type EthCallEngine
- type EthereumOracleVerifier
- type EvtForwarder
- type EvtForwarderHeartbeat
- type ExecEngine
- type ExecutionEngine
- type Gastimator
- func (g *Gastimator) CalcGasWantedForTx(tx abci.Tx) (uint64, error)
- func (g *Gastimator) GetMaxGas() uint64
- func (g *Gastimator) GetPriority(tx abci.Tx) uint64
- func (g *Gastimator) OnBlockEnd() uint64
- func (g *Gastimator) OnDefaultGasUpdate(ctx context.Context, def *num.Uint) error
- func (g *Gastimator) OnMaxGasUpdate(ctx context.Context, max *num.Uint) error
- func (g *Gastimator) OnMinBlockCapacityUpdate(ctx context.Context, minBlockCapacity *num.Uint) error
- type GovernanceEngine
- type HasVegaAssetID
- type Limits
- type NetworkParameters
- type Notary
- type NullBlockchainTxCodec
- type Oracle
- type OracleAdaptors
- type OraclesEngine
- type PartiesEngine
- type PoWEngine
- type ProtocolUpgradeService
- type ReferralProgram
- type Snapshot
- type SnapshotEngine
- type SpamEngine
- type StakeVerifier
- type StakingAccounts
- type StateVarEngine
- type Stats
- type TeamsEngine
- type TimeService
- type Tx
- func (t Tx) BlockHeight() uint64
- func (t Tx) Command() txn.Command
- func (t Tx) GetCmd() interface{}
- func (t Tx) GetLength() int
- func (t Tx) GetNonce() uint64
- func (t Tx) GetPoWNonce() uint64
- func (t Tx) GetPoWTID() string
- func (t Tx) GetVersion() uint32
- func (t Tx) Hash() []byte
- func (t Tx) Party() string
- func (t Tx) PubKey() []byte
- func (t Tx) PubKeyHex() string
- func (t Tx) Signature() []byte
- func (t Tx) Unmarshal(i interface{}) error
- type TxCache
- type TxCodec
- type TxWrapper
- type Validate
- func (v Validate) CheckOrderAmendment(amend *commandspb.OrderAmendment) error
- func (v Validate) CheckOrderCancellation(cancel *commandspb.OrderCancellation) error
- func (v Validate) CheckOrderSubmission(order *commandspb.OrderSubmission) error
- func (v Validate) CheckStopOrdersCancellation(cancel *commandspb.StopOrdersCancellation) error
- func (v Validate) CheckStopOrdersSubmission(order *commandspb.StopOrdersSubmission) error
- func (v Validate) CheckUpdateMarginMode(order *commandspb.UpdateMarginMode) error
- type Validator
- type ValidatorTopology
- type VolumeDiscountProgram
- type Witness
Constants ¶
const AppVersion = 1
Variables ¶
var ( ErrUnexpectedTxPubKey = errors.New("no one listens to the public keys that signed this oracle data") ErrTradingDisabled = errors.New("trading disabled") ErrMarketProposalDisabled = errors.New("market proposal disabled") ErrAssetProposalDisabled = errors.New("asset proposal disabled") ErrEthOraclesDisabled = errors.New("ethereum oracles disabled") ErrOracleNoSubscribers = errors.New("there are no subscribes to the oracle data") ErrSpotMarketProposalDisabled = errors.New("spot market proposal disabled") ErrPerpsMarketProposalDisabled = errors.New("perps market proposal disabled") ErrAMMPoolDisabled = errors.New("amm pool disabled") ErrOracleDataNormalization = func(err error) error { return fmt.Errorf("error normalizing incoming oracle data: %w", err) } )
var ( ErrNotAnERC20Event = errors.New("not an erc20 event") ErrNotABuiltinAssetEvent = errors.New("not an builtin asset event") ErrUnsupportedEventAction = errors.New("unsupported event action") ErrChainEventAssetListERC20WithoutEnoughSignature = errors.New("chain event for erc20 asset list received with missing node signatures") ErrNotBridgeChainID = errors.New("not the chainID of any bridge") )
var ( ErrChainEventFromNonValidator = errors.New("chain event emitted from a non-validator node") ErrUnsupportedChainEvent = errors.New("unsupported chain event") ErrNodeSignatureFromNonValidator = errors.New("node signature not sent by validator") ErrNodeSignatureWithNonValidatorMasterKey = errors.New("node signature not signed with validator master key") ErrMarketBatchInstructionTooBig = func(got, expected uint64) error { return fmt.Errorf("market batch instructions too big, got(%d), expected(%d)", got, expected) } ErrParentMarketAlreadySucceeded = errors.New("parent market already was already succeeded") )
var ErrMissingWithdrawERC20Ext = errors.New("missing withdraw submission erc20 ext")
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func NewApp ¶
func NewApp(log *logging.Logger, vegaPaths paths.Paths, config Config, cancelFn func(), stopBlockchain func() error, assets Assets, banking Banking, broker Broker, witness Witness, evtForwarder EvtForwarder, evtHeartbeat EvtForwarderHeartbeat, exec ExecutionEngine, ghandler *genesis.Handler, gov GovernanceEngine, notary Notary, stats Stats, time TimeService, epoch EpochService, top ValidatorTopology, netp NetworkParameters, oracles *Oracle, delegation DelegationEngine, limits Limits, stake StakeVerifier, checkpoint Checkpoint, spam SpamEngine, pow PoWEngine, stakingAccounts StakingAccounts, snapshot SnapshotEngine, stateVarEngine StateVarEngine, teamsEngine TeamsEngine, referralProgram ReferralProgram, volumeDiscountProgram VolumeDiscountProgram, blockchainClient BlockchainClient, primaryMultisig ERC20MultiSigTopology, secondaryMultisig ERC20MultiSigTopology, version string, protocolUpgradeService ProtocolUpgradeService, codec abci.Codec, gastimator *Gastimator, ethCallEngine EthCallEngine, balanceChecker BalanceChecker, partiesEngine PartiesEngine, txCache TxCache, ) *App
func (*App) ApplyReferralCode ¶ added in v0.73.0
func (*App) ApplySnapshotChunk ¶
func (app *App) ApplySnapshotChunk(ctx context.Context, req *tmtypes.RequestApplySnapshotChunk) (*tmtypes.ResponseApplySnapshotChunk, error)
func (*App) CheckAmendAmmForSpam ¶ added in v0.77.0
func (*App) CheckAmendOrderForSpam ¶ added in v0.77.0
func (*App) CheckApplyReferralCode ¶ added in v0.73.0
func (*App) CheckBatchMarketInstructions ¶ added in v0.55.0
func (*App) CheckBatchMarketInstructionsW ¶ added in v0.55.0
func (*App) CheckBatchPropose ¶ added in v0.74.0
func (*App) CheckBatchProposeW ¶ added in v0.74.0
func (*App) CheckCancelAmmForSpam ¶ added in v0.77.0
func (*App) CheckCancelLPForSpam ¶ added in v0.77.0
func (*App) CheckCancelOrderForSpam ¶ added in v0.77.0
func (*App) CheckCreateOrUpdateReferralSet ¶ added in v0.74.0
func (*App) CheckLPAmendForSpam ¶ added in v0.77.0
func (*App) CheckLPSubmissionForSpam ¶ added in v0.77.0
func (*App) CheckOrderSubmissionForSpam ¶ added in v0.77.0
func (*App) CheckPropose ¶ added in v0.56.0
func (*App) CheckProposeW ¶ added in v0.56.0
func (*App) CheckProtocolUpgradeProposal ¶ added in v0.55.0
func (*App) CheckSubmitAmmForSpam ¶ added in v0.77.0
func (*App) CheckSubmitOracleData ¶
func (*App) CheckTransferCommand ¶ added in v0.68.0
func (*App) CreateReferralSet ¶ added in v0.73.0
func (*App) DeliverAmendAMM ¶ added in v0.77.0
func (*App) DeliverAmendLiquidityProvision ¶
func (*App) DeliverAmendOrder ¶
func (*App) DeliverAnnounceNode ¶
func (*App) DeliverBatchMarketInstructions ¶ added in v0.55.0
func (*App) DeliverBatchPropose ¶ added in v0.74.0
func (*App) DeliverCancelAMM ¶ added in v0.77.0
func (*App) DeliverCancelLiquidityProvision ¶
func (*App) DeliverCancelOrder ¶
func (*App) DeliverCancelTransferFunds ¶
func (*App) DeliverChainEvent ¶
func (*App) DeliverDelegate ¶
func (*App) DeliverEthereumKeyRotateSubmission ¶
func (*App) DeliverIssueSignatures ¶ added in v0.55.0
func (*App) DeliverKeyRotateSubmission ¶
func (*App) DeliverLiquidityProvision ¶
func (*App) DeliverNodeSignature ¶
func (*App) DeliverNodeVote ¶
func (*App) DeliverPropose ¶
func (*App) DeliverProtocolUpgradeCommand ¶
func (*App) DeliverStateVarProposal ¶
func (*App) DeliverStopOrdersCancellation ¶ added in v0.72.0
func (*App) DeliverStopOrdersSubmission ¶ added in v0.72.0
func (*App) DeliverSubmitAMM ¶ added in v0.77.0
func (*App) DeliverSubmitOracleData ¶
func (*App) DeliverSubmitOrder ¶
func (*App) DeliverTransferFunds ¶
func (*App) DeliverUndelegate ¶
func (*App) DeliverValidatorHeartbeat ¶
func (*App) DeliverWithdraw ¶
func (*App) Info ¶
func (app *App) Info(_ context.Context, _ *tmtypes.RequestInfo) (*tmtypes.ResponseInfo, error)
func (*App) ListSnapshots ¶
func (app *App) ListSnapshots(_ context.Context, _ *tmtypes.RequestListSnapshots) (*tmtypes.ResponseListSnapshots, error)
func (*App) LoadSnapshotChunk ¶
func (app *App) LoadSnapshotChunk(_ context.Context, req *tmtypes.RequestLoadSnapshotChunk) (*tmtypes.ResponseLoadSnapshotChunk, error)
func (*App) OfferSnapshot ¶
func (app *App) OfferSnapshot(_ context.Context, req *tmtypes.RequestOfferSnapshot) (*tmtypes.ResponseOfferSnapshot, error)
func (*App) OnBeginBlock ¶
func (app *App) OnBeginBlock(blockHeight uint64, blockHash string, blockTime time.Time, proposer string, txs []abci.Tx) context.Context
OnBeginBlock updates the internal lastBlockTime value with each new block.
func (*App) OnBlockchainEVMChainConfigUpdate ¶ added in v0.76.0
func (*App) OnBlockchainPrimaryEthereumConfigUpdate ¶ added in v0.76.0
func (*App) OnCheckTx ¶
func (app *App) OnCheckTx(ctx context.Context, _ *tmtypes.RequestCheckTx, tx abci.Tx) (context.Context, *tmtypes.ResponseCheckTx)
OnCheckTx performs soft validations.
func (*App) OnCheckTxSpam ¶
func (app *App) OnCheckTxSpam(tx abci.Tx) tmtypes.ResponseCheckTx
OnCheckTxSpam checks for spam and replay.
func (*App) OnEndBlock ¶
func (app *App) OnEndBlock(blockHeight uint64) (tmtypes.ValidatorUpdates, types1.ConsensusParams)
func (*App) OnInitChain ¶
func (app *App) OnInitChain(req *tmtypes.RequestInitChain) (*tmtypes.ResponseInitChain, error)
func (*App) OnSpamProtectionMaxBatchSizeUpdate ¶ added in v0.55.0
func (*App) ReloadConf ¶
ReloadConf updates the internal configuration.
func (*App) RequireValidatorMasterPubKey ¶
func (*App) RequireValidatorMasterPubKeyW ¶
func (*App) RequireValidatorPubKey ¶
func (*App) RequireValidatorPubKeyW ¶
func (*App) SendTransactionResult ¶ added in v0.58.0
func (*App) UpdateMarginMode ¶ added in v0.74.0
func (*App) UpdatePartyProfile ¶ added in v0.74.0
type BMIError ¶ added in v0.71.0
BMIError implements blockchain/abci.MaybePartialError.
func (*BMIError) ErrorOrNil ¶ added in v0.71.0
type BMIProcessor ¶ added in v0.55.0
type BMIProcessor struct {
// contains filtered or unexported fields
}
func NewBMIProcessor ¶ added in v0.55.0
func NewBMIProcessor( log *logging.Logger, exec ExecutionEngine, validator Validator, ) *BMIProcessor
func (*BMIProcessor) ProcessBatch ¶ added in v0.55.0
func (p *BMIProcessor) ProcessBatch( ctx context.Context, batch *commandspb.BatchMarketInstructions, party, determinitisticID string, stats Stats, ) error
ProcessBatch will process a batch of market transaction. Transaction are always executed in the following order: cancellation, amendment then submissions. All errors are returned as a single error.
type BalanceChecker ¶ added in v0.73.0
type Banking ¶
type Banking interface { EnableBuiltinAsset(context.Context, string) error DepositBuiltinAsset(context.Context, *types.BuiltinAssetDeposit, string, uint64) error WithdrawBuiltinAsset(context.Context, string, string, string, *num.Uint) error EnableERC20(context.Context, *types.ERC20AssetList, string, uint64, uint64, string, string) error UpdateERC20(context.Context, *types.ERC20AssetLimitsUpdated, string, uint64, uint64, string, string) error DepositERC20(context.Context, *types.ERC20Deposit, string, uint64, uint64, string, string) error WithdrawERC20(context.Context, string, string, string, *num.Uint, *types.Erc20WithdrawExt) error ERC20WithdrawalEvent(context.Context, *types.ERC20Withdrawal, uint64, string, string) error TransferFunds(context.Context, *types.TransferFunds) error CancelTransferFunds(context.Context, *types.CancelTransferFunds) error BridgeStopped(context.Context, bool, string, uint64, uint64, string, string) error BridgeResumed(context.Context, bool, string, uint64, uint64, string, string) error CheckTransfer(t *types.TransferBase) error NewGovernanceTransfer(ctx context.Context, ID, reference string, transferConfig *types.NewTransferConfiguration) error VerifyGovernanceTransfer(transfer *types.NewTransferConfiguration) error VerifyCancelGovernanceTransfer(transferID string) error CancelGovTransfer(ctx context.Context, ID string) error OnBlockEnd(ctx context.Context, now time.Time) }
Banking ..
type BlockchainClient ¶
type BlockchainClient interface { Validators(height *int64) ([]*tmtypesint.Validator, error) MaxMempoolSize() int64 }
type Broker ¶
type Broker interface { Send(e events.Event) SetStreaming(on bool) bool StreamingEnabled() bool SocketClient() broker.SocketClient }
Broker - the event bus.
type Checkpoint ¶
type Config ¶
type Config struct { Level encoding.LogLevel `long:"log-level"` LogOrderSubmitDebug encoding.Bool `long:"log-order-submit-debug"` LogOrderAmendDebug encoding.Bool `long:"log-order-amend-debug"` LogOrderCancelDebug encoding.Bool `long:"log-order-cancel-debug"` KeepCheckpointsMax uint `long:"keep-checkpoints-max"` SnapshotDebug Snapshot `group:"SnapshotDebug" namespace:"snapshotdebug"` }
Config represent the configuration of the processor package.
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.
type DelegationEngine ¶
type DelegationEngine interface { Delegate(ctx context.Context, party string, nodeID string, amount *num.Uint) error UndelegateAtEndOfEpoch(ctx context.Context, party string, nodeID string, amount *num.Uint) error UndelegateNow(ctx context.Context, party string, nodeID string, amount *num.Uint) error ProcessEpochDelegations(ctx context.Context, epoch types.Epoch) []*types.ValidatorData Hash() []byte }
type ERC20MultiSigTopology ¶
type ERC20MultiSigTopology interface { ProcessSignerEvent(event *types.SignerEvent) error ProcessThresholdEvent(event *types.SignerThresholdSetEvent) error }
type EpochService ¶
type EthCallEngine ¶ added in v0.73.0
type EthCallEngine interface {
Start()
}
type EthereumOracleVerifier ¶ added in v0.73.0
type EthereumOracleVerifier interface {
ProcessEthereumContractCallResult(callEvent ethcall.ContractCallEvent) error
}
type EvtForwarder ¶
type EvtForwarder interface {
Ack(*commandspb.ChainEvent) bool
}
EvtForwarder ...
type EvtForwarderHeartbeat ¶ added in v0.77.0
EvtForwarderHeartbeat ...
type ExecEngine ¶ added in v0.63.0
type ExecEngine interface {
GetMarketCounters() map[string]*types.MarketCounters
}
type ExecutionEngine ¶
type ExecutionEngine interface { CheckCanSubmitOrderOrLiquidityCommitment(party, market string) error CheckOrderSubmissionForSpam(orderSubmission *types.OrderSubmission, party string) error // orders stuff SubmitOrder(ctx context.Context, orderSubmission *types.OrderSubmission, party string, idgen common.IDGenerator, orderID string) (*types.OrderConfirmation, error) CancelOrder(ctx context.Context, order *types.OrderCancellation, party string, idgen common.IDGenerator) ([]*types.OrderCancellationConfirmation, error) AmendOrder(ctx context.Context, order *types.OrderAmendment, party string, idgen common.IDGenerator) (*types.OrderConfirmation, error) // stop orders stuff SubmitStopOrders(ctx context.Context, stopOrdersSubmission *types.StopOrdersSubmission, party string, idgen common.IDGenerator, stopOrderID1, stopOrderID2 *string) (*types.OrderConfirmation, error) CancelStopOrders(ctx context.Context, stopOrdersCancellation *types.StopOrdersCancellation, party string, idgen common.IDGenerator) error // Future stuff SubmitMarket(ctx context.Context, marketConfig *types.Market, proposer string, oos time.Time) error UpdateMarket(ctx context.Context, marketConfig *types.Market) error RejectMarket(ctx context.Context, marketid string) error StartOpeningAuction(ctx context.Context, marketid string) error SucceedMarket(ctx context.Context, successor, parent string) error // Spot stuff SubmitSpotMarket(ctx context.Context, marketConfig *types.Market, proposer string, oos time.Time) error UpdateSpotMarket(ctx context.Context, marketConfig *types.Market) error // LP stuff SubmitLiquidityProvision(ctx context.Context, sub *types.LiquidityProvisionSubmission, party, deterministicID string) error CancelLiquidityProvision(ctx context.Context, order *types.LiquidityProvisionCancellation, party string) error AmendLiquidityProvision(ctx context.Context, order *types.LiquidityProvisionAmendment, party string, deterministicID string) error VerifyUpdateMarketState(changes *types.MarketStateUpdateConfiguration) error UpdateMarketState(ctx context.Context, changes *types.MarketStateUpdateConfiguration) error Hash() []byte // End of block BlockEnd(ctx context.Context) BeginBlock(ctx context.Context, duration time.Duration) // Margin mode UpdateMarginMode(ctx context.Context, party, marketID string, marginMode types.MarginMode, marginFactor num.Decimal) error // default chain ID, can be removed once we've upgraded to v0.74 OnChainIDUpdate(uint64) error SubmitAMM(ctx context.Context, sub *types.SubmitAMM, deterministicID string) error AmendAMM(ctx context.Context, sub *types.AmendAMM, deterministicID string) error CancelAMM(ctx context.Context, sub *types.CancelAMM, deterministicID string) error }
type Gastimator ¶ added in v0.63.0
type Gastimator struct {
// contains filtered or unexported fields
}
func NewGastimator ¶ added in v0.63.0
func NewGastimator(exec ExecEngine) *Gastimator
func (*Gastimator) CalcGasWantedForTx ¶ added in v0.63.0
func (g *Gastimator) CalcGasWantedForTx(tx abci.Tx) (uint64, error)
func (*Gastimator) GetMaxGas ¶ added in v0.63.0
func (g *Gastimator) GetMaxGas() uint64
GetMaxGas returns the current value of max gas.
func (*Gastimator) GetPriority ¶ added in v0.63.0
func (g *Gastimator) GetPriority(tx abci.Tx) uint64
func (*Gastimator) OnBlockEnd ¶ added in v0.63.0
func (g *Gastimator) OnBlockEnd() uint64
OnBlockEnd is called at the end of the block to update the per market counters and return the max gas as defined by the network parameter.
func (*Gastimator) OnDefaultGasUpdate ¶ added in v0.63.0
OnDefaultGasUpdate updates the default gas wanted per transaction.
func (*Gastimator) OnMaxGasUpdate ¶ added in v0.63.0
OnMaxGasUpdate updates the max gas from the network parameter.
func (*Gastimator) OnMinBlockCapacityUpdate ¶ added in v0.63.0
func (g *Gastimator) OnMinBlockCapacityUpdate(ctx context.Context, minBlockCapacity *num.Uint) error
OnMaxGasUpdate updates the max gas from the network parameter.
type GovernanceEngine ¶
type GovernanceEngine interface { SubmitProposal(context.Context, types.ProposalSubmission, string, string) (*governance.ToSubmit, error) SubmitBatchProposal(context.Context, types.BatchProposalSubmission, string, string) ([]*governance.ToSubmit, error) FinaliseEnactment(ctx context.Context, prop *types.Proposal) AddVote(context.Context, types.VoteSubmission, string) error OnTick(context.Context, time.Time) ([]*governance.ToEnact, []*governance.VoteClosed) RejectProposal(context.Context, *types.Proposal, types.ProposalError, error) error RejectBatchProposal(context.Context, string, types.ProposalError, error) error Hash() []byte OnChainIDUpdate(uint64) error }
type HasVegaAssetID ¶
type HasVegaAssetID interface {
GetVegaAssetID() string
}
type NetworkParameters ¶
type NetworkParameters interface { Update(ctx context.Context, key, value string) error DispatchChanges(ctx context.Context) IsUpdateAllowed(key string) error GetInt(key string) (int64, error) GetJSONStruct(key string, v netparams.Reset) error }
NetworkParameters ...
type Notary ¶
type Notary interface { StartAggregate(resID string, kind commandspb.NodeSignatureKind, signature []byte) RegisterSignature(ctx context.Context, pubKey string, ns commandspb.NodeSignature) error IsSigned(context.Context, string, commandspb.NodeSignatureKind) ([]commandspb.NodeSignature, bool) }
Notary.
type NullBlockchainTxCodec ¶
type NullBlockchainTxCodec struct{}
type Oracle ¶
type Oracle struct { Engine OraclesEngine Adaptors OracleAdaptors EthereumOraclesVerifier EthereumOracleVerifier EthereumL2OraclesVerifier EthereumOracleVerifier }
type OracleAdaptors ¶
type OracleAdaptors interface {
Normalise(crypto.PublicKey, commandspb.OracleDataSubmission) (*dscommon.Data, error)
}
type OraclesEngine ¶
type PartiesEngine ¶ added in v0.74.0
type PoWEngine ¶
type PoWEngine interface { api.ProofOfWorkParams BeginBlock(blockHeight uint64, blockHash string, txs []abci.Tx) CheckBlockTx(tx abci.Tx) (pow.ValidationResult, *uint) ProcessProposal(txs []abci.Tx) bool EndPrepareProposal([]pow.ValidationEntry) CheckTx(tx abci.Tx) error GetSpamStatistics(partyID string) *protoapi.PoWStatistic OnCommit() }
type ProtocolUpgradeService ¶
type ProtocolUpgradeService interface { BeginBlock(ctx context.Context, blockHeight uint64) UpgradeProposal(ctx context.Context, pk string, upgradeBlockHeight uint64, vegaReleaseTag string) error TimeForUpgrade() bool GetUpgradeStatus() types.UpgradeStatus SetReadyForUpgrade() CoreReadyForUpgrade() bool SetCoreReadyForUpgrade() Cleanup(ctx context.Context) IsValidProposal(ctx context.Context, pk string, upgradeBlockHeight uint64, vegaReleaseTag string) error }
type ReferralProgram ¶ added in v0.73.0
type ReferralProgram interface { UpdateProgram(program *types.ReferralProgram) PartyOwnsReferralSet(types.PartyID, types.ReferralSetID) error CreateReferralSet(context.Context, types.PartyID, types.ReferralSetID) error ApplyReferralCode(context.Context, types.PartyID, types.ReferralSetID) error CheckSufficientBalanceForApplyReferralCode(types.PartyID, *num.Uint) error CheckSufficientBalanceForCreateOrUpdateReferralSet(types.PartyID, *num.Uint) error }
type SnapshotEngine ¶ added in v0.73.0
type SnapshotEngine interface { Info() ([]byte, int64, string) Snapshot(context.Context) ([]byte, snapshot.DoneCh, error) SnapshotNow(context.Context) ([]byte, error) AddProviders(...types.StateProvider) HasSnapshots() (bool, error) ListLatestSnapshots() ([]*tmtypes.Snapshot, error) ReceiveSnapshot(*types.Snapshot) tmtypes.ResponseOfferSnapshot ReceiveSnapshotChunk(context.Context, *types.RawChunk, string) tmtypes.ResponseApplySnapshotChunk RetrieveSnapshotChunk(uint64, uint32, uint32) (*types.RawChunk, error) HasRestoredStateAlready() bool // debug snapshot issues/hash mismatch problems SnapshotDump(ctx context.Context, path string) ([]byte, error) }
type SpamEngine ¶
type StakeVerifier ¶
type StakeVerifier interface { ProcessStakeRemoved(ctx context.Context, event *types.StakeRemoved) error ProcessStakeDeposited(ctx context.Context, event *types.StakeDeposited) error }
type StakingAccounts ¶
type StateVarEngine ¶
type Stats ¶
type Stats interface { IncTotalCreateOrder() AddCurrentTradesInBatch(i uint64) AddTotalTrades(i uint64) uint64 IncTotalOrders() IncCurrentOrdersInBatch() IncTotalCancelOrder() IncTotalAmendOrder() // batch stats IncTotalBatches() NewBatch() TotalOrders() uint64 TotalBatches() uint64 SetAverageOrdersPerBatch(i uint64) SetBlockDuration(uint64) CurrentOrdersInBatch() uint64 CurrentTradesInBatch() uint64 SetOrdersPerSecond(i uint64) SetTradesPerSecond(i uint64) CurrentEventsInBatch() uint64 SetEventsPerSecond(uint64) // blockchain stats IncTotalTxCurrentBatch() IncHeight() Height() uint64 SetAverageTxPerBatch(i uint64) SetAverageTxSizeBytes(i uint64) SetTotalTxLastBatch(i uint64) SetTotalTxCurrentBatch(i uint64) TotalTxCurrentBatch() uint64 TotalTxLastBatch() uint64 SetHash(string) SetHeight(uint64) }
type TeamsEngine ¶ added in v0.73.0
type TeamsEngine interface { TeamExists(team types.TeamID) bool CreateTeam(context.Context, types.PartyID, types.TeamID, *commandspb.CreateReferralSet_Team) error UpdateTeam(context.Context, types.PartyID, types.TeamID, *commandspb.UpdateReferralSet_Team) error JoinTeam(context.Context, types.PartyID, *commandspb.JoinTeam) error }
type TimeService ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func DecodeTxNoValidation ¶
func (Tx) BlockHeight ¶
func (Tx) GetPoWNonce ¶
func (Tx) GetVersion ¶
type TxWrapper ¶ added in v0.74.0
type TxWrapper struct {
// contains filtered or unexported fields
}
type Validate ¶ added in v0.72.0
type Validate struct{}
func (Validate) CheckOrderAmendment ¶ added in v0.72.0
func (v Validate) CheckOrderAmendment(amend *commandspb.OrderAmendment) error
func (Validate) CheckOrderCancellation ¶ added in v0.72.0
func (v Validate) CheckOrderCancellation(cancel *commandspb.OrderCancellation) error
func (Validate) CheckOrderSubmission ¶ added in v0.72.0
func (v Validate) CheckOrderSubmission(order *commandspb.OrderSubmission) error
func (Validate) CheckStopOrdersCancellation ¶ added in v0.72.0
func (v Validate) CheckStopOrdersCancellation(cancel *commandspb.StopOrdersCancellation) error
func (Validate) CheckStopOrdersSubmission ¶ added in v0.72.0
func (v Validate) CheckStopOrdersSubmission(order *commandspb.StopOrdersSubmission) error
func (Validate) CheckUpdateMarginMode ¶ added in v0.74.0
func (v Validate) CheckUpdateMarginMode(order *commandspb.UpdateMarginMode) error
type Validator ¶ added in v0.72.0
type Validator interface { CheckOrderCancellation(cancel *commandspb.OrderCancellation) error CheckOrderAmendment(amend *commandspb.OrderAmendment) error CheckOrderSubmission(order *commandspb.OrderSubmission) error CheckStopOrdersCancellation(cancel *commandspb.StopOrdersCancellation) error CheckStopOrdersSubmission(order *commandspb.StopOrdersSubmission) error CheckUpdateMarginMode(update *commandspb.UpdateMarginMode) error }
type ValidatorTopology ¶
type ValidatorTopology interface { Len() int IsValidatorVegaPubKey(pk string) bool IsValidatorNodeID(nodeID string) bool AllVegaPubKeys() []string IsValidator() bool AddKeyRotate(ctx context.Context, nodeID string, currentBlockHeight uint64, kr *commandspb.KeyRotateSubmission) error ProcessEthereumKeyRotation(ctx context.Context, nodeID string, kr *commandspb.EthereumKeyRotateSubmission, verify func(message, signature []byte, hexAddress string) error) error BeginBlock(ctx context.Context, blockHeight uint64, proposer string) GetValidatorPowerUpdates() []abcitypes.ValidatorUpdate ProcessAnnounceNode(ctx context.Context, nr *commandspb.AnnounceNode) error ProcessValidatorHeartbeat(context.Context, *commandspb.ValidatorHeartbeat, func(message, signature, pubkey []byte) error, func(message, signature []byte, hexAddress string) error) error AddForwarder(ID string) IssueSignatures(ctx context.Context, submitter, nodeID, chainID string, kind types.NodeSignatureKind) error }
type VolumeDiscountProgram ¶ added in v0.73.0
type VolumeDiscountProgram interface {
UpdateProgram(program *types.VolumeDiscountProgram)
}