Run NodesReferencevmsproposervm

state

Package state is a generated GoMock package.

import "github.com/luxfi/node/vms/proposervm/state"

Package state is a generated GoMock package.

Functions

ScanBlocks

func ScanBlocks(db *versiondb.Database, visit func(block.Block) error) error

ScanBlocks visits every OUTER proposervm block persisted in the block store of [db], in key order.

It is a REPAIR-PATH reader, deliberately kept OUT of the State interface: the hot path addresses blocks by id, and only the boot-time index rebuild (proposervm.rebuildOuterIndexFromStore) needs to enumerate them. Keeping it a free function over the same [blockStatePrefix] the store writes under means the prefix stays defined exactly once, and no mock/interface churn is imposed on callers that will never scan.

Records that fail to decode are SKIPPED, not fatal: a rebuild must extract every usable wrapper from a store that may be partially damaged — that is the whole point of running it. Only an iterator-level error aborts the scan.

Types

BlockState

func NewBlockState(db database.Database) BlockState
func NewMeteredBlockState(db database.Database, namespace string, metrics metric.Registerer) (BlockState, error)

ChainState

func NewChainState(db database.Database) ChainState

HeightIndex

HeightIndex contains mapping of blockHeights to accepted proposer block IDs along with some metadata (fork height and checkpoint).

func NewHeightIndex(db database.Database, commitable versiondb.Commitable) HeightIndex

HeightIndexGetter

HeightIndexWriter

MockState

MockState is a mock of State interface.

func NewMockState(ctrl *gomock.Controller) *MockState
func (m *MockState) Commit() error
func (m *MockState) DeleteBlock(arg0 ids.ID) error
func (m *MockState) DeleteBlockIDAtHeight(arg0 uint64) error
func (m *MockState) DeleteCheckpoint() error
func (m *MockState) DeleteLastAccepted() error
func (m *MockState) EXPECT() *MockStateMockRecorder
func (m *MockState) GetBlock(arg0 ids.ID) (block.Block, choices.Status, error)
func (m *MockState) GetBlockIDAtHeight(arg0 uint64) (ids.ID, error)
func (m *MockState) GetCheckpoint() (ids.ID, error)
func (m *MockState) GetForkHeight() (uint64, error)
func (m *MockState) GetLastAccepted() (ids.ID, error)
func (m *MockState) GetMinimumHeight() (uint64, error)
func (m *MockState) PutBlock(arg0 block.Block, arg1 choices.Status) error
func (m *MockState) SetBlockIDAtHeight(arg0 uint64, arg1 ids.ID) error
func (m *MockState) SetCheckpoint(arg0 ids.ID) error
func (m *MockState) SetForkHeight(arg0 uint64) error
func (m *MockState) SetLastAccepted(arg0 ids.ID) error

MockStateMockRecorder

MockStateMockRecorder is the mock recorder for MockState.

func (mr *MockStateMockRecorder) Commit() *gomock.Call
func (mr *MockStateMockRecorder) DeleteBlock(arg0 any) *gomock.Call
func (mr *MockStateMockRecorder) DeleteBlockIDAtHeight(arg0 any) *gomock.Call
func (mr *MockStateMockRecorder) DeleteCheckpoint() *gomock.Call
func (mr *MockStateMockRecorder) DeleteLastAccepted() *gomock.Call
func (mr *MockStateMockRecorder) GetBlock(arg0 any) *gomock.Call
func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 any) *gomock.Call
func (mr *MockStateMockRecorder) GetCheckpoint() *gomock.Call
func (mr *MockStateMockRecorder) GetForkHeight() *gomock.Call
func (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Call
func (mr *MockStateMockRecorder) GetMinimumHeight() *gomock.Call
func (mr *MockStateMockRecorder) PutBlock(arg0, arg1 any) *gomock.Call
func (mr *MockStateMockRecorder) SetBlockIDAtHeight(arg0, arg1 any) *gomock.Call
func (mr *MockStateMockRecorder) SetCheckpoint(arg0 any) *gomock.Call
func (mr *MockStateMockRecorder) SetForkHeight(arg0 any) *gomock.Call
func (mr *MockStateMockRecorder) SetLastAccepted(arg0 any) *gomock.Call

State

func New(db *versiondb.Database) State
func NewMetered(db *versiondb.Database, namespace string, metrics metric.Registerer) (State, error)