Documentation ¶
Overview ¶
Package vm is a generated GoMock package.
Index ¶
- Constants
- Variables
- func PrefixBlockHeightKey(height uint64) []byte
- func PrefixBlockIDKey(id ids.ID) []byte
- func PrefixWarpFetchKey(txID ids.ID) []byte
- func PrefixWarpSignatureKey(txID ids.ID, signer *bls.PublicKey) []byte
- type BlockRPCClient
- type Config
- type Controller
- type DecisionRPCClient
- type Genesis
- type GetWarpSignaturesArgs
- type GetWarpSignaturesReply
- type Handler
- func (h *Handler) BlocksPort(_ *http.Request, _ *struct{}, reply *PortReply) error
- func (h *Handler) DecisionsPort(_ *http.Request, _ *struct{}, reply *PortReply) error
- func (h *Handler) GetWarpSignatures(req *http.Request, args *GetWarpSignaturesArgs, reply *GetWarpSignaturesReply) error
- func (h *Handler) LastAccepted(_ *http.Request, _ *struct{}, reply *LastAcceptedReply) error
- func (h *Handler) Network(_ *http.Request, _ *struct{}, reply *NetworkReply) (err error)
- func (h *Handler) Ping(_ *http.Request, _ *struct{}, reply *PingReply) (err error)
- func (h *Handler) SubmitTx(req *http.Request, args *SubmitTxArgs, reply *SubmitTxReply) error
- func (h *Handler) SuggestedRawFee(req *http.Request, _ *struct{}, reply *SuggestedRawFeeReply) error
- type Handlers
- type LastAcceptedReply
- type Metrics
- type MockController
- func (m *MockController) Accepted(arg0 context.Context, arg1 *chain.StatelessBlock) error
- func (m *MockController) EXPECT() *MockControllerMockRecorder
- func (m *MockController) Initialize(arg0 *VM, arg1 *snow.Context, arg2 metrics.MultiGatherer, ...) (Config, Genesis, builder.Builder, gossiper.Gossiper, database.Database, ...)
- func (m *MockController) Rejected(arg0 context.Context, arg1 *chain.StatelessBlock) error
- func (m *MockController) Rules(arg0 int64) chain.Rules
- func (m *MockController) Shutdown(arg0 context.Context) error
- func (m *MockController) StateManager() chain.StateManager
- type MockControllerMockRecorder
- func (mr *MockControllerMockRecorder) Accepted(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) Rejected(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) Rules(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) Shutdown(arg0 interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) StateManager() *gomock.Call
- type NetworkHandler
- type NetworkManager
- func (n *NetworkManager) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (n *NetworkManager) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (n *NetworkManager) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (n *NetworkManager) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (n *NetworkManager) Connected(ctx context.Context, nodeID ids.NodeID, v *version.Application) error
- func (n *NetworkManager) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, ...) error
- func (n *NetworkManager) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32) error
- func (n *NetworkManager) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, response []byte) error
- func (n *NetworkManager) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (n *NetworkManager) Register() (uint8, common.AppSender)
- func (n *NetworkManager) SetHandler(handler uint8, h NetworkHandler)
- type NetworkReply
- type PingReply
- type PortReply
- type ProposerMonitor
- func (p *ProposerMonitor) IsValidator(ctx context.Context, nodeID ids.NodeID) (bool, error)
- func (p *ProposerMonitor) Proposers(ctx context.Context, diff int, depth int) (set.Set[ids.NodeID], error)
- func (p *ProposerMonitor) Validators(ctx context.Context) (map[ids.NodeID]*validators.GetValidatorOutput, map[string]struct{})
- type StateSyncHandler
- func (*StateSyncHandler) AppGossip(context.Context, ids.NodeID, []byte) error
- func (s *StateSyncHandler) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (s *StateSyncHandler) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (s *StateSyncHandler) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (s *StateSyncHandler) Connected(ctx context.Context, nodeID ids.NodeID, v *version.Application) error
- func (*StateSyncHandler) CrossChainAppRequest(context.Context, ids.ID, uint32, time.Time, []byte) error
- func (*StateSyncHandler) CrossChainAppRequestFailed(context.Context, ids.ID, uint32) error
- func (*StateSyncHandler) CrossChainAppResponse(context.Context, ids.ID, uint32, []byte) error
- func (s *StateSyncHandler) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- type SubmitTxArgs
- type SubmitTxReply
- type SuggestedRawFeeReply
- type TxGossipHandler
- func (t *TxGossipHandler) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (*TxGossipHandler) AppRequest(context.Context, ids.NodeID, uint32, time.Time, []byte) error
- func (*TxGossipHandler) AppRequestFailed(context.Context, ids.NodeID, uint32) error
- func (*TxGossipHandler) AppResponse(context.Context, ids.NodeID, uint32, []byte) error
- func (*TxGossipHandler) Connected(context.Context, ids.NodeID, *version.Application) error
- func (*TxGossipHandler) CrossChainAppRequest(context.Context, ids.ID, uint32, time.Time, []byte) error
- func (*TxGossipHandler) CrossChainAppRequestFailed(context.Context, ids.ID, uint32) error
- func (*TxGossipHandler) CrossChainAppResponse(context.Context, ids.ID, uint32, []byte) error
- func (*TxGossipHandler) Disconnected(context.Context, ids.NodeID) error
- type VM
- func (vm *VM) Accepted(ctx context.Context, b *chain.StatelessBlock)
- func (vm *VM) AcceptedSyncableBlock(ctx context.Context, sb *chain.SyncableBlock) (block.StateSyncMode, error)
- func (vm *VM) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (vm *VM) BlocksPort() uint16
- func (vm *VM) BuildBlock(ctx context.Context) (snowman.Block, error)
- func (vm *VM) BuildBlockWithContext(ctx context.Context, blockContext *smblock.Context) (snowman.Block, error)
- func (vm *VM) Builder() builder.Builder
- func (vm *VM) ChainID() ids.ID
- func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, v *version.Application) error
- func (vm *VM) CreateHandlers(_ context.Context) (map[string]*common.HTTPHandler, error)
- func (*VM) CreateStaticHandlers(_ context.Context) (map[string]*common.HTTPHandler, error)
- func (vm *VM) CrossChainAppRequest(ctx context.Context, nodeID ids.ID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, nodeID ids.ID, requestID uint32) error
- func (vm *VM) CrossChainAppResponse(ctx context.Context, nodeID ids.ID, requestID uint32, response []byte) error
- func (vm *VM) DecisionsPort() uint16
- func (vm *VM) DeleteDiskBlock(bid ids.ID) error
- func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (vm *VM) EngineChan() chan<- common.Message
- func (vm *VM) ForceReady()
- func (vm *VM) GetBlock(ctx context.Context, id ids.ID) (snowman.Block, error)
- func (vm *VM) GetBlockIDAtHeight(_ context.Context, height uint64) (ids.ID, error)
- func (vm *VM) GetDiskBlock(bid ids.ID) (*chain.StatefulBlock, error)
- func (vm *VM) GetDiskBlockIDAtHeight(height uint64) (ids.ID, error)
- func (vm *VM) GetDiskIsSyncing() (bool, error)
- func (vm *VM) GetLastAccepted() (ids.ID, error)
- func (vm *VM) GetLastStateSummary(context.Context) (block.StateSummary, error)
- func (vm *VM) GetOngoingSyncStateSummary(ctx context.Context) (block.StateSummary, error)
- func (vm *VM) GetOutgoingWarpMessage(txID ids.ID) (*warp.UnsignedMessage, error)
- func (vm *VM) GetStateSummary(ctx context.Context, height uint64) (block.StateSummary, error)
- func (vm *VM) GetStatelessBlock(ctx context.Context, blkID ids.ID) (*chain.StatelessBlock, error)
- func (vm *VM) GetWarpFetch(txID ids.ID) (int64, error)
- func (vm *VM) GetWarpSignature(txID ids.ID, signer *bls.PublicKey) (*WarpSignature, error)
- func (vm *VM) GetWarpSignatures(txID ids.ID) ([]*WarpSignature, error)
- func (vm *VM) Gossiper() gossiper.Gossiper
- func (vm *VM) HRP() string
- func (vm *VM) Handler() *Handler
- func (vm *VM) HasLastAccepted() (bool, error)
- func (vm *VM) HealthCheck(context.Context) (interface{}, error)
- func (vm *VM) Initialize(ctx context.Context, snowCtx *snow.Context, manager manager.Manager, ...) error
- func (vm *VM) IsBootstrapped() bool
- func (vm *VM) IsRepeat(ctx context.Context, txs []*chain.Transaction) bool
- func (vm *VM) IsValidator(ctx context.Context, nid ids.NodeID) (bool, error)
- func (vm *VM) LastAccepted(_ context.Context) (ids.ID, error)
- func (vm *VM) LastAcceptedBlock() *chain.StatelessBlock
- func (vm *VM) Logger() logging.Logger
- func (vm *VM) Manager() manager.Manager
- func (vm *VM) Mempool() chain.Mempool
- func (vm *VM) NewStateSyncClient(gatherer ametrics.MultiGatherer) *stateSyncerClient
- func (vm *VM) NodeID() ids.NodeID
- func (vm *VM) ParseBlock(ctx context.Context, source []byte) (snowman.Block, error)
- func (vm *VM) ParseStateSummary(ctx context.Context, bytes []byte) (block.StateSummary, error)
- func (vm *VM) PreferredBlock(ctx context.Context) (*chain.StatelessBlock, error)
- func (vm *VM) Proposers(ctx context.Context, diff int, depth int) (set.Set[ids.NodeID], error)
- func (vm *VM) PutDiskIsSyncing(v bool) error
- func (vm *VM) ReadState(ctx context.Context, keys [][]byte) ([][]byte, []error)
- func (vm *VM) Registry() (chain.ActionRegistry, chain.AuthRegistry)
- func (vm *VM) Rejected(ctx context.Context, b *chain.StatelessBlock)
- func (vm *VM) Rules(t int64) chain.Rules
- func (vm *VM) SetLastAccepted(block *chain.StatelessBlock) error
- func (vm *VM) SetPreference(_ context.Context, id ids.ID) error
- func (vm *VM) SetState(_ context.Context, state snow.State) error
- func (vm *VM) Shutdown(ctx context.Context) error
- func (vm *VM) State() (*merkledb.Database, error)
- func (vm *VM) StateManager() chain.StateManager
- func (vm *VM) StateReady() bool
- func (vm *VM) StateSyncEnabled(ctx context.Context) (bool, error)
- func (vm *VM) StopChan() chan struct{}
- func (vm *VM) StoreWarpFetch(txID ids.ID) error
- func (vm *VM) StoreWarpSignature(txID ids.ID, signer *bls.PublicKey, signature []byte) error
- func (vm *VM) Submit(ctx context.Context, verifySig bool, txs []*chain.Transaction) (errs []error)
- func (vm *VM) SuggestedFee(ctx context.Context) (uint64, uint64, error)
- func (vm *VM) Tracer() trace.Tracer
- func (vm *VM) UpdateSyncTarget(b *chain.StatelessBlock) (bool, error)
- func (vm *VM) ValidatorState() validators.State
- func (vm *VM) Verified(ctx context.Context, b *chain.StatelessBlock)
- func (*VM) VerifyHeightIndex(context.Context) error
- func (vm *VM) Version(_ context.Context) (string, error)
- func (vm *VM) Workers() *workers.Workers
- type WarpHandler
- func (*WarpHandler) AppGossip(context.Context, ids.NodeID, []byte) error
- func (w *WarpHandler) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, _ time.Time, ...) error
- func (w *WarpHandler) AppRequestFailed(_ context.Context, _ ids.NodeID, requestID uint32) error
- func (w *WarpHandler) AppResponse(_ context.Context, _ ids.NodeID, requestID uint32, response []byte) error
- func (*WarpHandler) Connected(context.Context, ids.NodeID, *version.Application) error
- func (*WarpHandler) CrossChainAppRequest(context.Context, ids.ID, uint32, time.Time, []byte) error
- func (*WarpHandler) CrossChainAppRequestFailed(context.Context, ids.ID, uint32) error
- func (*WarpHandler) CrossChainAppResponse(context.Context, ids.ID, uint32, []byte) error
- func (*WarpHandler) Disconnected(context.Context, ids.NodeID) error
- type WarpManager
- func (w *WarpManager) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, request []byte) error
- func (w *WarpManager) Done()
- func (w *WarpManager) GatherSignatures(ctx context.Context, txID ids.ID, msg []byte)
- func (w *WarpManager) HandleRequestFailed(requestID uint32) error
- func (w *WarpManager) HandleResponse(requestID uint32, msg []byte) error
- func (w *WarpManager) Run(appSender common.AppSender)
- type WarpSignature
- type WarpValidator
- type WrappedAppSender
- func (w *WrappedAppSender) SendAppGossip(ctx context.Context, appGossipBytes []byte) error
- func (w *WrappedAppSender) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
- func (w *WrappedAppSender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...) error
- func (w *WrappedAppSender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (w *WrappedAppSender) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error
- func (w *WrappedAppSender) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte) error
Constants ¶
const (
Endpoint = "/rpc"
)
Variables ¶
Functions ¶
func PrefixBlockHeightKey ¶
func PrefixBlockIDKey ¶
func PrefixWarpFetchKey ¶
Types ¶
type BlockRPCClient ¶
type BlockRPCClient struct {
// contains filtered or unexported fields
}
If you don't keep up, you will data
func NewBlockRPCClient ¶
func NewBlockRPCClient(uri string) (*BlockRPCClient, error)
func (*BlockRPCClient) Close ¶
func (c *BlockRPCClient) Close() error
func (*BlockRPCClient) Listen ¶
func (c *BlockRPCClient) Listen( parser chain.Parser, ) (*chain.StatefulBlock, []*chain.Result, error)
type Config ¶
type Config interface { GetTraceConfig() *trace.Config GetParallelism() int // how many cores to use during verification GetMempoolSize() int GetMempoolPayerSize() int GetMempoolExemptPayers() [][]byte GetDecisionsPort() uint16 GetBlocksPort() uint16 GetStreamingBacklogSize() int GetStateHistoryLength() int // how many roots back of data to keep to serve state queries GetStateCacheSize() int // how many items to keep in value cache and node cache GetAcceptorSize() int // how far back we can fall in processing accepted blocks GetStateSyncParallelism() int GetStateSyncMinBlocks() uint64 GetStateSyncServerDelay() time.Duration GetBlockLRUSize() int }
type Controller ¶
type Controller interface { Initialize( inner *VM, snowCtx *snow.Context, gatherer ametrics.MultiGatherer, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, ) ( config Config, genesis Genesis, builder builder.Builder, gossiper gossiper.Gossiper, vmDB database.Database, stateDB database.Database, handler Handlers, actionRegistry chain.ActionRegistry, authRegistry chain.AuthRegistry, err error, ) Rules(t int64) chain.Rules // StateManager is used by the VM to request keys to store required // information in state (without clobbering things the Controller is // storing). StateManager() chain.StateManager // Anything that the VM wishes to store outside of state or blocks must be // recorded here Accepted(ctx context.Context, blk *chain.StatelessBlock) error Rejected(ctx context.Context, blk *chain.StatelessBlock) error // Shutdown should be used by the [Controller] to terminate any async // processes it may be running in the background. It is invoked when // `vm.Shutdown` is called. Shutdown(context.Context) error }
type DecisionRPCClient ¶
type DecisionRPCClient struct {
// contains filtered or unexported fields
}
If you don't keep up, you will data
func NewDecisionRPCClient ¶
func NewDecisionRPCClient(uri string) (*DecisionRPCClient, error)
func (*DecisionRPCClient) Close ¶
func (d *DecisionRPCClient) Close() error
func (*DecisionRPCClient) IssueTx ¶
func (d *DecisionRPCClient) IssueTx(tx *chain.Transaction) error
type GetWarpSignaturesArgs ¶
type GetWarpSignaturesReply ¶
type GetWarpSignaturesReply struct { Validators []*WarpValidator `json:"validators"` Message *warp.UnsignedMessage `json:"message"` Signatures []*WarpSignature `json:"signatures"` }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) BlocksPort ¶
func (*Handler) DecisionsPort ¶
func (*Handler) GetWarpSignatures ¶
func (h *Handler) GetWarpSignatures( req *http.Request, args *GetWarpSignaturesArgs, reply *GetWarpSignaturesReply, ) error
func (*Handler) LastAccepted ¶
func (h *Handler) LastAccepted(_ *http.Request, _ *struct{}, reply *LastAcceptedReply) error
func (*Handler) Network ¶
func (h *Handler) Network(_ *http.Request, _ *struct{}, reply *NetworkReply) (err error)
func (*Handler) SubmitTx ¶
func (h *Handler) SubmitTx(req *http.Request, args *SubmitTxArgs, reply *SubmitTxReply) error
func (*Handler) SuggestedRawFee ¶
func (h *Handler) SuggestedRawFee( req *http.Request, _ *struct{}, reply *SuggestedRawFeeReply, ) error
type Handlers ¶
type Handlers map[string]*common.HTTPHandler
type LastAcceptedReply ¶
type MockController ¶
type MockController struct {
// contains filtered or unexported fields
}
MockController is a mock of Controller interface.
func NewMockController ¶
func NewMockController(ctrl *gomock.Controller) *MockController
NewMockController creates a new mock instance.
func (*MockController) Accepted ¶
func (m *MockController) Accepted(arg0 context.Context, arg1 *chain.StatelessBlock) error
Accepted mocks base method.
func (*MockController) EXPECT ¶
func (m *MockController) EXPECT() *MockControllerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockController) Initialize ¶
func (m *MockController) Initialize(arg0 *VM, arg1 *snow.Context, arg2 metrics.MultiGatherer, arg3, arg4, arg5 []byte) (Config, Genesis, builder.Builder, gossiper.Gossiper, database.Database, database.Database, Handlers, chain.ActionRegistry, chain.AuthRegistry, error)
Initialize mocks base method.
func (*MockController) Rejected ¶
func (m *MockController) Rejected(arg0 context.Context, arg1 *chain.StatelessBlock) error
Rejected mocks base method.
func (*MockController) Rules ¶
func (m *MockController) Rules(arg0 int64) chain.Rules
Rules mocks base method.
func (*MockController) Shutdown ¶
func (m *MockController) Shutdown(arg0 context.Context) error
Shutdown mocks base method.
func (*MockController) StateManager ¶
func (m *MockController) StateManager() chain.StateManager
StateManager mocks base method.
type MockControllerMockRecorder ¶
type MockControllerMockRecorder struct {
// contains filtered or unexported fields
}
MockControllerMockRecorder is the mock recorder for MockController.
func (*MockControllerMockRecorder) Accepted ¶
func (mr *MockControllerMockRecorder) Accepted(arg0, arg1 interface{}) *gomock.Call
Accepted indicates an expected call of Accepted.
func (*MockControllerMockRecorder) Initialize ¶
func (mr *MockControllerMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call
Initialize indicates an expected call of Initialize.
func (*MockControllerMockRecorder) Rejected ¶
func (mr *MockControllerMockRecorder) Rejected(arg0, arg1 interface{}) *gomock.Call
Rejected indicates an expected call of Rejected.
func (*MockControllerMockRecorder) Rules ¶
func (mr *MockControllerMockRecorder) Rules(arg0 interface{}) *gomock.Call
Rules indicates an expected call of Rules.
func (*MockControllerMockRecorder) Shutdown ¶
func (mr *MockControllerMockRecorder) Shutdown(arg0 interface{}) *gomock.Call
Shutdown indicates an expected call of Shutdown.
func (*MockControllerMockRecorder) StateManager ¶
func (mr *MockControllerMockRecorder) StateManager() *gomock.Call
StateManager indicates an expected call of StateManager.
type NetworkHandler ¶
type NetworkHandler interface { Connected(ctx context.Context, nodeID ids.NodeID, v *version.Application) error Disconnected(ctx context.Context, nodeID ids.NodeID) error AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error AppRequest( ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte, ) error AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error AppResponse( ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte, ) error CrossChainAppRequest(context.Context, ids.ID, uint32, time.Time, []byte) error CrossChainAppRequestFailed(context.Context, ids.ID, uint32) error CrossChainAppResponse(context.Context, ids.ID, uint32, []byte) error }
type NetworkManager ¶
type NetworkManager struct {
// contains filtered or unexported fields
}
func NewNetworkManager ¶
func NewNetworkManager(vm *VM, sender common.AppSender) *NetworkManager
func (*NetworkManager) AppGossip ¶
Handles incoming "AppGossip" messages, parses them to transactions, and submits them to the mempool. The "AppGossip" message is sent by the other VM via "common.AppSender" to receive txs and forward them to the other node (validator).
implements "snowmanblock.ChainVM.commom.VM.AppHandler" assume gossip via proposervm has been activated ref. "node/vms/platformvm/network.AppGossip"
func (*NetworkManager) AppRequest ¶
func (n *NetworkManager) AppRequest( ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte, ) error
implements "block.ChainVM.commom.VM.AppHandler"
func (*NetworkManager) AppRequestFailed ¶
func (n *NetworkManager) AppRequestFailed( ctx context.Context, nodeID ids.NodeID, requestID uint32, ) error
implements "block.ChainVM.commom.VM.AppHandler"
func (*NetworkManager) AppResponse ¶
func (n *NetworkManager) AppResponse( ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte, ) error
implements "block.ChainVM.commom.VM.AppHandler"
func (*NetworkManager) Connected ¶
func (n *NetworkManager) Connected( ctx context.Context, nodeID ids.NodeID, v *version.Application, ) error
implements "block.ChainVM.commom.VM.validators.Connector"
func (*NetworkManager) CrossChainAppRequest ¶
func (*NetworkManager) CrossChainAppRequestFailed ¶
func (*NetworkManager) CrossChainAppResponse ¶
func (*NetworkManager) Disconnected ¶
implements "block.ChainVM.commom.VM.validators.Connector"
func (*NetworkManager) SetHandler ¶
func (n *NetworkManager) SetHandler(handler uint8, h NetworkHandler)
Some callers take a sender before the handler is initialized, so we need to set the handler after initialization to avoid a potential panic.
TODO: in the future allow for queueing messages during the time between Register and SetHandler (should both happen in init so should not be an issue for standard usage)
type NetworkReply ¶
type ProposerMonitor ¶
type ProposerMonitor struct {
// contains filtered or unexported fields
}
func NewProposerMonitor ¶
func NewProposerMonitor(vm *VM) *ProposerMonitor
func (*ProposerMonitor) IsValidator ¶
func (*ProposerMonitor) Validators ¶
func (p *ProposerMonitor) Validators( ctx context.Context, ) (map[ids.NodeID]*validators.GetValidatorOutput, map[string]struct{})
type StateSyncHandler ¶
type StateSyncHandler struct {
// contains filtered or unexported fields
}
func NewStateSyncHandler ¶
func NewStateSyncHandler(vm *VM) *StateSyncHandler
func (*StateSyncHandler) AppRequest ¶
func (*StateSyncHandler) AppRequestFailed ¶
func (*StateSyncHandler) AppResponse ¶
func (*StateSyncHandler) Connected ¶
func (s *StateSyncHandler) Connected( ctx context.Context, nodeID ids.NodeID, v *version.Application, ) error
func (*StateSyncHandler) CrossChainAppRequest ¶
func (*StateSyncHandler) CrossChainAppRequestFailed ¶
func (*StateSyncHandler) CrossChainAppResponse ¶
func (*StateSyncHandler) Disconnected ¶
type SubmitTxArgs ¶
type SubmitTxArgs struct {
Tx []byte `json:"tx"`
}
type SubmitTxReply ¶
type SuggestedRawFeeReply ¶
type TxGossipHandler ¶
type TxGossipHandler struct {
// contains filtered or unexported fields
}
func NewTxGossipHandler ¶
func NewTxGossipHandler(vm *VM) *TxGossipHandler
func (*TxGossipHandler) AppRequest ¶
func (*TxGossipHandler) AppRequestFailed ¶
func (*TxGossipHandler) AppResponse ¶
func (*TxGossipHandler) Connected ¶
func (*TxGossipHandler) Connected(context.Context, ids.NodeID, *version.Application) error
func (*TxGossipHandler) CrossChainAppRequest ¶
func (*TxGossipHandler) CrossChainAppRequestFailed ¶
func (*TxGossipHandler) CrossChainAppResponse ¶
func (*TxGossipHandler) Disconnected ¶
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
func (*VM) AcceptedSyncableBlock ¶
func (vm *VM) AcceptedSyncableBlock( ctx context.Context, sb *chain.SyncableBlock, ) (block.StateSyncMode, error)
func (*VM) AppGossip ¶
Handles incoming "AppGossip" messages, parses them to transactions, and submits them to the mempool. The "AppGossip" message is sent by the other VM via "common.AppSender" to receive txs and forward them to the other node (validator).
implements "snowmanblock.ChainVM.commom.VM.AppHandler" assume gossip via proposervm has been activated ref. "node/vms/platformvm/network.AppGossip"
func (*VM) AppRequest ¶
func (vm *VM) AppRequest( ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte, ) error
implements "block.ChainVM.commom.VM.AppHandler"
func (*VM) AppRequestFailed ¶
implements "block.ChainVM.commom.VM.AppHandler"
func (*VM) AppResponse ¶
func (vm *VM) AppResponse( ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte, ) error
implements "block.ChainVM.commom.VM.AppHandler"
func (*VM) BlocksPort ¶
func (*VM) BuildBlock ¶
implements "block.ChainVM"
func (*VM) BuildBlockWithContext ¶
func (vm *VM) BuildBlockWithContext( ctx context.Context, blockContext *smblock.Context, ) (snowman.Block, error)
implements "block.BuildBlockWithContextChainVM"
func (*VM) CreateHandlers ¶
implements "block.ChainVM.common.VM" for "ext/vm/[chainID]"
func (*VM) CreateStaticHandlers ¶
implements "block.ChainVM.common.VM" for "ext/vm/[vmID]"
func (*VM) CrossChainAppRequest ¶
func (*VM) CrossChainAppRequestFailed ¶
func (*VM) CrossChainAppResponse ¶
func (*VM) DecisionsPort ¶
func (*VM) Disconnected ¶
implements "block.ChainVM.commom.VM.validators.Connector"
func (*VM) EngineChan ¶
func (*VM) GetBlock ¶
implements "block.ChainVM.commom.VM.Getter" replaces "core.SnowmanVM.GetBlock"
func (*VM) GetBlockIDAtHeight ¶
GetBlockIDAtHeight implements snowmanblock.HeightIndexedChainVM Note: must return database.ErrNotFound if the index at height is unknown.
func (*VM) GetDiskBlock ¶
func (*VM) GetDiskBlockIDAtHeight ¶
func (*VM) GetDiskIsSyncing ¶
func (*VM) GetLastStateSummary ¶
GetLastStateSummary returns the latest state summary. If no summary is available, database.ErrNotFound must be returned.
func (*VM) GetOngoingSyncStateSummary ¶
func (*VM) GetOutgoingWarpMessage ¶
func (*VM) GetStateSummary ¶
GetStateSummary implements StateSyncableVM and returns a summary corresponding to the provided [height] if the node can serve state sync data for that key. If not, database.ErrNotFound must be returned.
func (*VM) GetStatelessBlock ¶
func (*VM) GetWarpSignature ¶
func (*VM) GetWarpSignatures ¶
func (vm *VM) GetWarpSignatures(txID ids.ID) ([]*WarpSignature, error)
func (*VM) HasLastAccepted ¶
func (*VM) HealthCheck ¶
implements "block.ChainVM.commom.VM.health.Checkable"
func (*VM) Initialize ¶
func (vm *VM) Initialize( ctx context.Context, snowCtx *snow.Context, manager manager.Manager, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, toEngine chan<- common.Message, _ []*common.Fx, appSender common.AppSender, ) error
implements "block.ChainVM.common.VM"
func (*VM) IsBootstrapped ¶
func (*VM) IsValidator ¶
func (*VM) LastAccepted ¶
"LastAccepted" implements "block.ChainVM" replaces "core.SnowmanVM.LastAccepted"
func (*VM) LastAcceptedBlock ¶
func (vm *VM) LastAcceptedBlock() *chain.StatelessBlock
func (*VM) NewStateSyncClient ¶
func (vm *VM) NewStateSyncClient( gatherer ametrics.MultiGatherer, ) *stateSyncerClient
TODO: break out into own package
func (*VM) ParseBlock ¶
implements "block.ChainVM.commom.VM.Parser" replaces "core.SnowmanVM.ParseBlock"
func (*VM) ParseStateSummary ¶
func (*VM) PreferredBlock ¶
func (*VM) PutDiskIsSyncing ¶
func (*VM) Registry ¶
func (vm *VM) Registry() (chain.ActionRegistry, chain.AuthRegistry)
func (*VM) SetLastAccepted ¶
func (vm *VM) SetLastAccepted(block *chain.StatelessBlock) error
func (*VM) SetPreference ¶
"SetPreference" implements "block.ChainVM" replaces "core.SnowmanVM.SetPreference"
func (*VM) StateManager ¶
func (vm *VM) StateManager() chain.StateManager
func (*VM) StateReady ¶
func (*VM) StoreWarpSignature ¶
func (*VM) UpdateSyncTarget ¶
func (vm *VM) UpdateSyncTarget(b *chain.StatelessBlock) (bool, error)
func (*VM) ValidatorState ¶
func (vm *VM) ValidatorState() validators.State
func (*VM) VerifyHeightIndex ¶
VerifyHeightIndex implements snowmanblock.HeightIndexedChainVM
type WarpHandler ¶
type WarpHandler struct {
// contains filtered or unexported fields
}
func NewWarpHandler ¶
func NewWarpHandler(vm *VM) *WarpHandler
func (*WarpHandler) AppRequest ¶
func (*WarpHandler) AppRequestFailed ¶
func (*WarpHandler) AppResponse ¶
func (*WarpHandler) Connected ¶
func (*WarpHandler) Connected(context.Context, ids.NodeID, *version.Application) error
func (*WarpHandler) CrossChainAppRequest ¶
func (*WarpHandler) CrossChainAppRequestFailed ¶
func (*WarpHandler) CrossChainAppResponse ¶
func (*WarpHandler) Disconnected ¶
type WarpManager ¶
type WarpManager struct {
// contains filtered or unexported fields
}
WarpManager takes requests to get signatures from other nodes and then stores the result in our DB for future usage.
func NewWarpManager ¶
func NewWarpManager(vm *VM) *WarpManager
func (*WarpManager) AppRequest ¶
func (*WarpManager) Done ¶
func (w *WarpManager) Done()
func (*WarpManager) GatherSignatures ¶
GatherSignatures makes a best effort to acquire signatures from other validators and store them inside the vmDB.
GatherSignatures may be called when a block is accepted (optimistically) or may be triggered by RPC (if missing signatures are detected). To prevent RPC abuse, we limit how frequently we attempt to gather signatures for a given TxID.
func (*WarpManager) HandleRequestFailed ¶
func (w *WarpManager) HandleRequestFailed(requestID uint32) error
func (*WarpManager) HandleResponse ¶
func (w *WarpManager) HandleResponse(requestID uint32, msg []byte) error
func (*WarpManager) Run ¶
func (w *WarpManager) Run(appSender common.AppSender)
type WarpSignature ¶
type WarpValidator ¶
type WrappedAppSender ¶
type WrappedAppSender struct {
// contains filtered or unexported fields
}
WrappedAppSender is used to get a shared requestID and to prepend messages with the handler identifier.
func (*WrappedAppSender) SendAppGossip ¶
func (w *WrappedAppSender) SendAppGossip(ctx context.Context, appGossipBytes []byte) error
Gossip an application-level message. A non-nil error should be considered fatal.
func (*WrappedAppSender) SendAppGossipSpecific ¶
func (*WrappedAppSender) SendAppRequest ¶
func (w *WrappedAppSender) SendAppRequest( ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, appRequestBytes []byte, ) error
Send an application-level request. A nil return value guarantees that for each nodeID in [nodeIDs], the VM corresponding to this AppSender eventually receives either: * An AppResponse from nodeID with ID [requestID] * An AppRequestFailed from nodeID with ID [requestID] Exactly one of the above messages will eventually be received per nodeID. A non-nil error should be considered fatal.
func (*WrappedAppSender) SendAppResponse ¶
func (w *WrappedAppSender) SendAppResponse( ctx context.Context, nodeID ids.NodeID, requestID uint32, appResponseBytes []byte, ) error
Send an application-level response to a request. This response must be in response to an AppRequest that the VM corresponding to this AppSender received from [nodeID] with ID [requestID]. A non-nil error should be considered fatal.
func (*WrappedAppSender) SendCrossChainAppRequest ¶
func (w *WrappedAppSender) SendCrossChainAppRequest( ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte, ) error
SendCrossChainAppRequest sends an application-level request to a specific chain.
A nil return value guarantees that the VM corresponding to this CrossChainAppSender eventually receives either: * A CrossChainAppResponse from [chainID] with ID [requestID] * A CrossChainAppRequestFailed from [chainID] with ID [requestID] Exactly one of the above messages will eventually be received from [chainID]. A non-nil error should be considered fatal.
func (*WrappedAppSender) SendCrossChainAppResponse ¶
func (w *WrappedAppSender) SendCrossChainAppResponse( ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte, ) error
SendCrossChainAppResponse sends an application-level response to a specific chain
This response must be in response to a CrossChainAppRequest that the VM corresponding to this CrossChainAppSender received from [chainID] with ID [requestID]. A non-nil error should be considered fatal.