Run NodesReferencevmsComponents

chain

Package chain

import "github.com/luxfi/node/vms/components/chain"

Types

BlockWrapper

BlockWrapper wraps a linear Block while adding a smart caching layer to improve VM performance.

func (bw *BlockWrapper) Accept(ctx context.Context) error
func (bw *BlockWrapper) Reject(ctx context.Context) error
func (bw *BlockWrapper) ShouldVerifyWithRuntime(ctx context.Context) (bool, error)
func (bw *BlockWrapper) Verify(ctx context.Context) error
func (bw *BlockWrapper) VerifyWithRuntime(ctx context.Context, blockCtx *runtime.Runtime) error

Config

Config defines all of the parameters necessary to initialize State

OracleBlock

OracleBlock is a block that can have multiple valid children, and one needs to be chosen by an oracle.

State

State implements an efficient caching layer used to wrap a VM implementation.

func NewMeteredState(
	registerer metric.Registerer,
	config *Config,
) (*State, error)
func NewState(config *Config) *State
func (s *State) BatchedParseBlock(ctx context.Context, blksBytes [][]byte) ([]consensuschain.Block, error)
func (s *State) BuildBlock(ctx context.Context) (consensuschain.Block, error)
func (s *State) BuildBlockWithRuntime(ctx context.Context, blockCtx *runtime.Runtime) (consensuschain.Block, error)
func (s *State) Flush()
func (s *State) GetBlock(ctx context.Context, blkID ids.ID) (consensuschain.Block, error)
func (s *State) GetBlockInternal(ctx context.Context, blkID ids.ID) (consensuschain.Block, error)
func (s *State) IsProcessing(blkID ids.ID) bool
func (s *State) LastAccepted(context.Context) (ids.ID, error)
func (s *State) LastAcceptedBlock() *BlockWrapper
func (s *State) LastAcceptedBlockInternal() consensuschain.Block
func (s *State) ParseBlock(ctx context.Context, b []byte) (consensuschain.Block, error)
func (s *State) SetLastAcceptedBlock(lastAcceptedBlock consensuschain.Block) error

Status

Status represents the status of a block

TestBlock

TestBlock is a test implementation of Block

func (b *TestBlock) Accept(context.Context) error
func (b *TestBlock) Bytes() []byte
func (b *TestBlock) Height() uint64
func (b *TestBlock) ID() ids.ID
func (b *TestBlock) Parent() ids.ID
func (b *TestBlock) ParentID() ids.ID
func (b *TestBlock) Reject(context.Context) error
func (b *TestBlock) State() state.ReadOnlyChain
func (b *TestBlock) Status() uint8
func (b *TestBlock) Timestamp() time.Time
func (b *TestBlock) Verify(context.Context) error