Documentation
¶
Index ¶
- Constants
- Variables
- func NewAppSenderAdapter(consensusAppSender appsender.AppSender) nodeblock.AppSender
- func NewBlockAdapter(consensusBlock consensusblock.Block) nodeblock.Block
- func NewContextAdapter(nodeCtx *nodeblock.Context) *nodeblock.Context
- func NewNodeContextAdapter(consensusCtx *nodeblock.Context) *nodeblock.Context
- func NewReverseAppSenderAdapter(nodeAppSender nodeblock.AppSender) appsender.AppSender
- type Admin
- func (p *Admin) GetVMConfig(_ *http.Request, _ *struct{}, reply *client.ConfigReply) error
- func (p *Admin) LockProfile(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error
- func (p *Admin) MemoryProfile(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error
- func (p *Admin) SetLogLevel(_ *http.Request, args *client.SetLogLevelArgs, reply *api.EmptyReply) error
- func (p *Admin) StartCPUProfiler(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error
- func (p *Admin) StopCPUProfiler(r *http.Request, _ *struct{}, _ *api.EmptyReply) error
- type AppSenderAdapter
- func (a *AppSenderAdapter) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (a *AppSenderAdapter) SendAppGossip(ctx context.Context, nodeIDs []ids.NodeID, appGossipBytes []byte) error
- func (a *AppSenderAdapter) SendAppRequest(ctx context.Context, nodeIDs []ids.NodeID, requestID uint32, ...) error
- func (a *AppSenderAdapter) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- type Block
- func (b *Block) Accept(context.Context) error
- func (b *Block) Bytes() []byte
- func (b *Block) Height() uint64
- func (b *Block) ID() ids.ID
- func (b *Block) Parent() ids.ID
- func (b *Block) ParentID() ids.ID
- func (b *Block) Reject(context.Context) error
- func (b *Block) SetStatus(status choices.Status)
- func (b *Block) ShouldVerifyWithContext(context.Context) (bool, error)
- func (b *Block) Status() uint8
- func (b *Block) String() string
- func (b *Block) Timestamp() time.Time
- func (b *Block) Verify(context.Context) error
- func (b *Block) VerifyWithContext(ctx context.Context, proposerVMBlockCtx *block.Context) error
- type BlockAdapter
- func (b *BlockAdapter) Accept(ctx context.Context) error
- func (b *BlockAdapter) Bytes() []byte
- func (b *BlockAdapter) Height() uint64
- func (b *BlockAdapter) ID() ids.ID
- func (b *BlockAdapter) Parent() ids.ID
- func (b *BlockAdapter) ParentID() ids.ID
- func (b *BlockAdapter) Reject(ctx context.Context) error
- func (b *BlockAdapter) ShouldVerifyWithContext(ctx context.Context) (bool, error)
- func (b *BlockAdapter) Status() uint8
- func (b *BlockAdapter) Timestamp() time.Time
- func (b *BlockAdapter) Unwrap() consensusblock.Block
- func (b *BlockAdapter) Verify(ctx context.Context) error
- func (b *BlockAdapter) VerifyWithContext(ctx context.Context, blockCtx *nodeblock.Context) error
- type BlockData
- type BlockValidator
- type ChainInfo
- type ContextAdapter
- type DatabaseConfig
- type EthPushGossiper
- type Factory
- type GossipEthTx
- type GossipEthTxMarshaller
- type GossipEthTxPool
- func (g *GossipEthTxPool) Add(tx *GossipEthTx) error
- func (g *GossipEthTxPool) GetFilter() ([]byte, []byte)
- func (g *GossipEthTxPool) Has(txID ids.ID) bool
- func (g *GossipEthTxPool) IsSubscribed() bool
- func (g *GossipEthTxPool) Iterate(f func(tx *GossipEthTx) bool)
- func (g *GossipEthTxPool) Subscribe(ctx context.Context)
- type MigrateAPI
- func (api *MigrateAPI) GetBlocks(start, end uint64, limit int) ([]*BlockData, error)
- func (api *MigrateAPI) GetChainInfo() (*ChainInfo, error)
- func (api *MigrateAPI) ImportBlocks(blocks []*BlockData) (int, error)
- func (api *MigrateAPI) StreamBlocks(ctx context.Context, start, end uint64) (chan *BlockData, chan error)
- type ReverseAppSenderAdapter
- func (a *ReverseAppSenderAdapter) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (a *ReverseAppSenderAdapter) SendAppGossip(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
- func (a *ReverseAppSenderAdapter) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
- func (a *ReverseAppSenderAdapter) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...) error
- func (a *ReverseAppSenderAdapter) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- type StateSyncClient
- type StateSyncServer
- type Status
- type Syncer
- type TestSender
- func (s *TestSender) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (s *TestSender) SendAppGossip(ctx context.Context, nodeIDs set.Set[ids.NodeID], msg []byte) error
- func (s *TestSender) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], msg []byte) error
- func (s *TestSender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...) error
- func (s *TestSender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (s *TestSender) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, ...) error
- func (s *TestSender) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error
- func (s *TestSender) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte) error
- type VM
- func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (vm *VM) BuildBlock(ctx context.Context) (nodeConsensusBlock.Block, error)
- func (vm *VM) BuildBlockWithContext(ctx context.Context, proposerVMBlockCtx *nodeblock.Context) (nodeConsensusBlock.Block, error)
- func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, ver interface{}) error
- func (vm *VM) CreateHTTP2Handler(context.Context) (http.Handler, error)
- func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error)
- func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32, ...) error
- func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (vm *VM) GetAcceptedBlock(ctx context.Context, blkID ids.ID) (nodeConsensusBlock.Block, error)
- func (vm *VM) GetBlock(ctx context.Context, id ids.ID) (nodeConsensusBlock.Block, error)
- func (vm *VM) GetBlockIDAtHeight(_ context.Context, height uint64) (ids.ID, error)
- func (vm *VM) GetCurrentNonce(address common.Address) (uint64, error)
- func (vm *VM) GetLastStateSummary(ctx context.Context) (nodeblock.StateSummary, error)
- func (vm *VM) GetOngoingSyncStateSummary(ctx context.Context) (nodeblock.StateSummary, error)
- func (vm *VM) GetStateSummary(ctx context.Context, height uint64) (nodeblock.StateSummary, error)
- func (vm *VM) HealthCheck(context.Context) (interface{}, error)
- func (vm *VM) Initialize(ctx context.Context, chainCtx interface{}, dbManager interface{}, ...) error
- func (vm *VM) NewBlockBuilder() *blockBuilder
- func (vm *VM) NewHTTPHandler(ctx context.Context) (interface{}, error)
- func (vm *VM) ParseBlock(ctx context.Context, b []byte) (nodeConsensusBlock.Block, error)
- func (vm *VM) ParseEthBlock(b []byte) (*types.Block, error)
- func (vm *VM) ParseStateSummary(ctx context.Context, summaryBytes []byte) (nodeblock.StateSummary, error)
- func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error
- func (vm *VM) SetState(_ context.Context, state uint32) error
- func (vm *VM) Shutdown(context.Context) error
- func (vm *VM) StateSyncEnabled(ctx context.Context) (bool, error)
- func (vm *VM) Version(context.Context) (string, error)
- func (vm *VM) WaitForEvent(ctx context.Context) (interface{}, error)
- type ValidatorsAPI
Constants ¶
const ( // TxGossipHandlerID is the handler ID for transaction gossip TxGossipHandlerID = uint64(0x1) )
Variables ¶
var ( // ID this VM should be referenced by IDStr = "subnetevm" ID = ids.ID{'s', 'u', 'b', 'n', 'e', 't', 'e', 'v', 'm'} )
var ( // GitCommit is set by the build script GitCommit string // Version is the version of Subnet EVM Version string = "v0.7.8" )
Functions ¶
func NewAppSenderAdapter ¶ added in v0.8.8
NewAppSenderAdapter creates an AppSender adapter
func NewBlockAdapter ¶ added in v0.8.8
func NewBlockAdapter(consensusBlock consensusblock.Block) nodeblock.Block
NewBlockAdapter creates a new block adapter
func NewContextAdapter ¶ added in v0.8.8
NewContextAdapter creates a context adapter from node to consensus
func NewNodeContextAdapter ¶ added in v0.8.8
NewNodeContextAdapter creates a node context from consensus context
Types ¶
type Admin ¶
type Admin struct {
// contains filtered or unexported fields
}
Admin is the API service for admin API calls
func NewAdminService ¶
func (*Admin) GetVMConfig ¶
func (*Admin) LockProfile ¶
LockProfile runs a mutex profile writing to the specified file
func (*Admin) MemoryProfile ¶
MemoryProfile runs a memory profile writing to the specified file
func (*Admin) SetLogLevel ¶
func (p *Admin) SetLogLevel(_ *http.Request, args *client.SetLogLevelArgs, reply *api.EmptyReply) error
func (*Admin) StartCPUProfiler ¶
StartCPUProfiler starts a cpu profile writing to the specified file
func (*Admin) StopCPUProfiler ¶
StopCPUProfiler stops the cpu profile
type AppSenderAdapter ¶ added in v0.8.8
type AppSenderAdapter struct {
// contains filtered or unexported fields
}
AppSenderAdapter adapts consensus AppSender to node AppSender interface
func (*AppSenderAdapter) SendAppError ¶ added in v0.8.8
func (a *AppSenderAdapter) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error
SendAppError sends an app error
func (*AppSenderAdapter) SendAppGossip ¶ added in v0.8.8
func (a *AppSenderAdapter) SendAppGossip(ctx context.Context, nodeIDs []ids.NodeID, appGossipBytes []byte) error
SendAppGossip sends app gossip
func (*AppSenderAdapter) SendAppRequest ¶ added in v0.8.8
func (a *AppSenderAdapter) SendAppRequest(ctx context.Context, nodeIDs []ids.NodeID, requestID uint32, appRequestBytes []byte) error
SendAppRequest sends an app request
func (*AppSenderAdapter) SendAppResponse ¶ added in v0.8.8
func (a *AppSenderAdapter) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, appResponseBytes []byte) error
SendAppResponse sends an app response
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block implements the chain.Block interface
func (*Block) ParentID ¶ added in v0.8.8
ParentID implements the chain.Block interface (same as Parent)
func (*Block) SetStatus ¶ added in v0.8.8
SetStatus implements the chain.Block interface This is required for chain.Block but not used in our implementation
func (*Block) ShouldVerifyWithContext ¶
ShouldVerifyWithContext implements the block.WithVerifyContext interface
type BlockAdapter ¶ added in v0.8.8
type BlockAdapter struct {
// contains filtered or unexported fields
}
BlockAdapter adapts consensus Block to node Block interface
func (*BlockAdapter) Accept ¶ added in v0.8.8
func (b *BlockAdapter) Accept(ctx context.Context) error
Accept accepts the block
func (*BlockAdapter) Bytes ¶ added in v0.8.8
func (b *BlockAdapter) Bytes() []byte
Bytes returns the block bytes
func (*BlockAdapter) Height ¶ added in v0.8.8
func (b *BlockAdapter) Height() uint64
Height returns the block height
func (*BlockAdapter) ID ¶ added in v0.8.8
func (b *BlockAdapter) ID() ids.ID
ID returns the block ID
func (*BlockAdapter) Parent ¶ added in v0.8.8
func (b *BlockAdapter) Parent() ids.ID
Parent returns the parent block ID (alias for ParentID)
func (*BlockAdapter) ParentID ¶ added in v0.8.8
func (b *BlockAdapter) ParentID() ids.ID
ParentID returns the parent block ID
func (*BlockAdapter) Reject ¶ added in v0.8.8
func (b *BlockAdapter) Reject(ctx context.Context) error
Reject rejects the block
func (*BlockAdapter) ShouldVerifyWithContext ¶ added in v0.8.8
func (b *BlockAdapter) ShouldVerifyWithContext(ctx context.Context) (bool, error)
ShouldVerifyWithContext implements the block.WithVerifyContext interface by delegating to the underlying block if it supports the interface
func (*BlockAdapter) Status ¶ added in v0.8.8
func (b *BlockAdapter) Status() uint8
Status returns the block status
func (*BlockAdapter) Timestamp ¶ added in v0.8.8
func (b *BlockAdapter) Timestamp() time.Time
Timestamp returns the block timestamp
func (*BlockAdapter) Unwrap ¶ added in v0.8.8
func (b *BlockAdapter) Unwrap() consensusblock.Block
Unwrap returns the underlying consensus block. This is useful for tests that need access to the internal *Block type.
func (*BlockAdapter) Verify ¶ added in v0.8.8
func (b *BlockAdapter) Verify(ctx context.Context) error
Verify verifies the block
func (*BlockAdapter) VerifyWithContext ¶ added in v0.8.8
VerifyWithContext implements the block.WithVerifyContext interface by delegating to the underlying block if it supports the interface
type BlockData ¶ added in v0.8.8
type BlockData struct {
Number uint64 `json:"number"`
Hash common.Hash `json:"hash"`
ParentHash common.Hash `json:"parentHash"`
Header string `json:"header"` // RLP-encoded header (hex)
Body string `json:"body"` // RLP-encoded body (hex)
Receipts string `json:"receipts"` // RLP-encoded receipts (hex)
Transactions []*types.Transaction `json:"transactions"` // Full transactions
}
BlockData represents a block with all its data for export
type BlockValidator ¶
func NewBlockValidator ¶
func NewBlockValidator() BlockValidator
type ChainInfo ¶ added in v0.8.8
type ChainInfo struct {
ChainID uint64 `json:"chainId"`
NetworkID uint32 `json:"networkId"`
GenesisHash common.Hash `json:"genesisHash"`
CurrentHeight uint64 `json:"currentHeight"`
VMVersion string `json:"vmVersion"`
}
ChainInfo provides metadata about the blockchain
type ContextAdapter ¶ added in v0.8.8
type ContextAdapter struct {
// contains filtered or unexported fields
}
ContextAdapter adapts between node and consensus context types
type DatabaseConfig ¶
type DatabaseConfig struct {
// If true, all writes are to memory and are discarded at shutdown.
ReadOnly bool `json:"readOnly"`
// Path to database
Path string `json:"path"`
// Name of the database type to use
Name string `json:"name"`
// Config bytes (JSON) for the database
// See relevant (pebbledb, leveldb) config options
Config []byte `json:"-"`
}
type EthPushGossiper ¶ added in v0.8.1
type EthPushGossiper struct {
// contains filtered or unexported fields
}
EthPushGossiper is used by the ETH backend to push transactions issued over the RPC and added to the mempool to peers.
func (*EthPushGossiper) Add ¶ added in v0.8.1
func (e *EthPushGossiper) Add(tx *types.Transaction)
type GossipEthTx ¶ added in v0.8.1
type GossipEthTx struct {
Tx *types.Transaction
}
func (*GossipEthTx) GossipID ¶ added in v0.8.1
func (tx *GossipEthTx) GossipID() ids.ID
type GossipEthTxMarshaller ¶ added in v0.8.1
type GossipEthTxMarshaller struct{}
func (GossipEthTxMarshaller) MarshalGossip ¶ added in v0.8.1
func (GossipEthTxMarshaller) MarshalGossip(tx *GossipEthTx) ([]byte, error)
func (GossipEthTxMarshaller) UnmarshalGossip ¶ added in v0.8.1
func (GossipEthTxMarshaller) UnmarshalGossip(bytes []byte) (*GossipEthTx, error)
type GossipEthTxPool ¶ added in v0.8.1
type GossipEthTxPool struct {
// contains filtered or unexported fields
}
func NewGossipEthTxPool ¶ added in v0.8.1
func NewGossipEthTxPool(mempool *txpool.TxPool, registerer prometheus.Registerer) (*GossipEthTxPool, error)
func (*GossipEthTxPool) Add ¶ added in v0.8.1
func (g *GossipEthTxPool) Add(tx *GossipEthTx) error
Add enqueues the transaction to the mempool. Subscribe should be called to receive an event if tx is actually added to the mempool or not.
func (*GossipEthTxPool) GetFilter ¶ added in v0.8.1
func (g *GossipEthTxPool) GetFilter() ([]byte, []byte)
func (*GossipEthTxPool) Has ¶ added in v0.8.1
func (g *GossipEthTxPool) Has(txID ids.ID) bool
Has should just return whether or not the [txID] is still in the mempool, not whether it is in the mempool AND pending.
func (*GossipEthTxPool) IsSubscribed ¶ added in v0.8.4
func (g *GossipEthTxPool) IsSubscribed() bool
IsSubscribed returns whether or not the gossip subscription is active.
func (*GossipEthTxPool) Iterate ¶ added in v0.8.1
func (g *GossipEthTxPool) Iterate(f func(tx *GossipEthTx) bool)
func (*GossipEthTxPool) Subscribe ¶ added in v0.8.1
func (g *GossipEthTxPool) Subscribe(ctx context.Context)
type MigrateAPI ¶ added in v0.8.8
type MigrateAPI struct {
// contains filtered or unexported fields
}
MigrateAPI provides RPC methods for blockchain export/import Used by lux-cli for RPC-based migration control
func NewMigrateAPI ¶ added in v0.8.8
func NewMigrateAPI(vm *VM) *MigrateAPI
NewMigrateAPI creates a new migrate API instance
func (*MigrateAPI) GetBlocks ¶ added in v0.8.8
func (api *MigrateAPI) GetBlocks(start, end uint64, limit int) ([]*BlockData, error)
GetBlocks returns blocks in a range via RPC (batch mode) For smaller ranges, returns all blocks at once
func (*MigrateAPI) GetChainInfo ¶ added in v0.8.8
func (api *MigrateAPI) GetChainInfo() (*ChainInfo, error)
GetChainInfo returns metadata about the blockchain
func (*MigrateAPI) ImportBlocks ¶ added in v0.8.8
func (api *MigrateAPI) ImportBlocks(blocks []*BlockData) (int, error)
ImportBlocks imports blocks via RPC Accepts RLP-encoded blocks and inserts them into the chain
func (*MigrateAPI) StreamBlocks ¶ added in v0.8.8
func (api *MigrateAPI) StreamBlocks(ctx context.Context, start, end uint64) (chan *BlockData, chan error)
StreamBlocks streams blocks in a range via RPC Returns blocks one at a time for efficient memory usage
type ReverseAppSenderAdapter ¶ added in v0.8.8
type ReverseAppSenderAdapter struct {
// contains filtered or unexported fields
}
ReverseAppSenderAdapter adapts node AppSender to consensus AppSender interface
func (*ReverseAppSenderAdapter) SendAppError ¶ added in v0.8.8
func (a *ReverseAppSenderAdapter) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error
SendAppError sends an app error (consensus to node)
func (*ReverseAppSenderAdapter) SendAppGossip ¶ added in v0.8.8
func (a *ReverseAppSenderAdapter) SendAppGossip(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
SendAppGossip sends app gossip (consensus to node)
func (*ReverseAppSenderAdapter) SendAppGossipSpecific ¶ added in v0.8.8
func (a *ReverseAppSenderAdapter) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error
SendAppGossipSpecific sends app gossip to specific nodes (consensus to node)
func (*ReverseAppSenderAdapter) SendAppRequest ¶ added in v0.8.8
func (a *ReverseAppSenderAdapter) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, appRequestBytes []byte) error
SendAppRequest sends an app request (consensus to node)
func (*ReverseAppSenderAdapter) SendAppResponse ¶ added in v0.8.8
func (a *ReverseAppSenderAdapter) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, appResponseBytes []byte) error
SendAppResponse sends an app response (consensus to node)
type StateSyncClient ¶
type StateSyncClient interface {
// methods that implement the client side of [block.StateSyncableVM]
StateSyncEnabled(context.Context) (bool, error)
GetOngoingSyncStateSummary(context.Context) (block.StateSummary, error)
ParseStateSummary(ctx context.Context, summaryBytes []byte) (block.StateSummary, error)
// additional methods required by the evm package
ClearOngoingSummary() error
Shutdown() error
Error() error
}
func NewStateSyncClient ¶
func NewStateSyncClient(config *stateSyncClientConfig) StateSyncClient
type StateSyncServer ¶
type StateSyncServer interface {
GetLastStateSummary(context.Context) (block.StateSummary, error)
GetStateSummary(context.Context, uint64) (block.StateSummary, error)
}
func NewStateSyncServer ¶
func NewStateSyncServer(config *stateSyncServerConfig) StateSyncServer
type Status ¶
type Status uint32
Status ...
List of possible status values Unknown Zero value, means the status is not known Dropped means the transaction was in the mempool, but was dropped because it failed verification Processing means the transaction is in the mempool Accepted means the transaction was accepted
type Syncer ¶
Syncer represents a step in state sync, along with Start/Done methods to control and monitor progress. Error returns an error if any was encountered.
type TestSender ¶ added in v0.8.8
type TestSender struct {
T *testing.T
CantSendAppGossip bool
CantSendAppGossipSpecific bool
CantSendAppRequest bool
CantSendAppResponse bool
CantSendAppError bool
SendAppGossipF func(context.Context, set.Set[ids.NodeID], []byte) error
SendAppGossipSpecificF func(context.Context, set.Set[ids.NodeID], []byte) error
SendAppRequestF func(context.Context, set.Set[ids.NodeID], uint32, []byte) error
SendAppResponseF func(context.Context, ids.NodeID, uint32, []byte) error
SendAppErrorF func(context.Context, ids.NodeID, uint32, int32, string) error
SendCrossChainAppRequestF func(context.Context, ids.ID, uint32, []byte) error
SendCrossChainAppResponseF func(context.Context, ids.ID, uint32, []byte) error
SendCrossChainAppErrorF func(context.Context, ids.ID, uint32, int32, string) error
// Channel for capturing sent gossip messages
SentAppGossip chan []byte
}
TestSender is a test implementation of the Sender interface
func (*TestSender) SendAppError ¶ added in v0.8.8
func (*TestSender) SendAppGossip ¶ added in v0.8.8
func (s *TestSender) SendAppGossip(ctx context.Context, nodeIDs set.Set[ids.NodeID], msg []byte) error
SendAppGossip implements the consensus AppSender interface
func (*TestSender) SendAppGossipSpecific ¶ added in v0.8.8
func (*TestSender) SendAppRequest ¶ added in v0.8.8
func (*TestSender) SendAppResponse ¶ added in v0.8.8
func (*TestSender) SendCrossChainAppError ¶ added in v0.8.8
func (*TestSender) SendCrossChainAppRequest ¶ added in v0.8.8
func (*TestSender) SendCrossChainAppResponse ¶ added in v0.8.8
type VM ¶
type VM struct {
// *nodeChain.State helps to implement the VM interface by wrapping blocks
// with an efficient caching layer.
*nodeChain.State
network.Network
// State sync server and client
StateSyncServer
StateSyncClient
// contains filtered or unexported fields
}
func (*VM) AppRequestFailed ¶ added in v0.8.1
func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, appErr *nodeCommonEng.AppError) error
AppRequestFailed implements the VM interface
func (*VM) BuildBlock ¶ added in v0.8.2
BuildBlock implements the ChainVM interface Uses State.BuildBlock to ensure proper block tracking (for LastAccepted, etc.)
func (*VM) BuildBlockWithContext ¶ added in v0.8.2
func (vm *VM) BuildBlockWithContext(ctx context.Context, proposerVMBlockCtx *nodeblock.Context) (nodeConsensusBlock.Block, error)
BuildBlockWithContext implements the BuildBlockWithContextChainVM interface
func (*VM) CreateHTTP2Handler ¶
func (*VM) CreateHandlers ¶
CreateHandlers makes new http handlers that can handle API calls
func (*VM) CrossChainAppRequestFailed ¶ added in v0.8.8
func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32, appErr *nodeCommonEng.AppError) error
CrossChainAppRequestFailed implements the VM interface
func (*VM) GetAcceptedBlock ¶
GetAcceptedBlock attempts to retrieve block [blkID] from the VM. This method only returns accepted blocks.
func (*VM) GetBlock ¶ added in v0.8.2
getBlock attempts to retrieve block [id] from the VM to be wrapped by ChainState. GetBlock implements the ChainVM interface
func (*VM) GetBlockIDAtHeight ¶
GetBlockIDAtHeight returns the canonical block at [height]. Note: the engine assumes that if a block is not found at [height], then database.ErrNotFound will be returned. This indicates that the VM has state synced and does not have all historical blocks available.
func (*VM) GetCurrentNonce ¶
GetCurrentNonce returns the nonce associated with the address at the preferred block
func (*VM) GetLastStateSummary ¶ added in v0.8.8
GetLastStateSummary implements the StateSyncableVM interface
func (*VM) GetOngoingSyncStateSummary ¶ added in v0.8.8
GetOngoingSyncStateSummary implements the StateSyncableVM interface
func (*VM) GetStateSummary ¶ added in v0.8.8
GetStateSummary implements the StateSyncableVM interface
func (*VM) HealthCheck ¶
Health returns nil if this chain is healthy. Also returns details, which should be one of: string, []byte, map[string]string
func (*VM) Initialize ¶
func (vm *VM) Initialize( ctx context.Context, chainCtx interface{}, dbManager interface{}, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, msgChan interface{}, fxs []interface{}, appSender interface{}, ) error
Initialize implements the chain.ChainVM interface with generic interface{} parameters
func (*VM) NewBlockBuilder ¶
func (vm *VM) NewBlockBuilder() *blockBuilder
func (*VM) NewHTTPHandler ¶ added in v0.7.10
NewHTTPHandler implements the block.ChainVM interface
func (*VM) ParseBlock ¶ added in v0.8.2
ParseBlock implements nodeblock.ChainVM interface
func (*VM) ParseStateSummary ¶ added in v0.8.8
func (vm *VM) ParseStateSummary(ctx context.Context, summaryBytes []byte) (nodeblock.StateSummary, error)
ParseStateSummary implements the StateSyncableVM interface
func (*VM) SetPreference ¶
SetPreference sets what the current tail of the chain is
func (*VM) StateSyncEnabled ¶ added in v0.8.8
StateSyncEnabled implements the StateSyncableVM interface
type ValidatorsAPI ¶
type ValidatorsAPI struct {
// contains filtered or unexported fields
}
func (*ValidatorsAPI) GetCurrentValidators ¶
func (api *ValidatorsAPI) GetCurrentValidators(_ *http.Request, req *client.GetCurrentValidatorsRequest, reply *client.GetCurrentValidatorsResponse) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
blockgascost implements the block gas cost logic
|
blockgascost implements the block gas cost logic |
|
upgrade
|
|
|
subnetevm
subnetevm defines the dynamic fee window used after subnetevm upgrade.
|
subnetevm defines the dynamic fee window used after subnetevm upgrade. |
|
state/interfaces
Package interfaces is a generated GoMock package.
|
Package interfaces is a generated GoMock package. |