Documentation
¶
Overview ¶
Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Constants
- func NewLeafHandler() *leafHandler
- func NewSummaryParser() *summaryParser
- type Config
- type Extender
- func (a *Extender) CreateSyncer(ctx context.Context, client syncclient.LeafClient, verDB *versiondb.Database, ...) (synccommon.Syncer, error)
- func (a *Extender) Initialize(backend *state.AtomicBackend, trie *state.AtomicTrie, requestSize uint16)
- func (a *Extender) OnFinishAfterCommit(summaryHeight uint64) error
- func (a *Extender) OnFinishBeforeCommit(lastAcceptedHeight uint64, Summary message.Syncable) error
- type Summary
- type SummaryProvider
Constants ¶
const ( // TrieNode represents a leaf node that belongs to the atomic trie. TrieNode message.NodeType = 2 )
Variables ¶
This section is empty.
Functions ¶
func NewLeafHandler ¶
func NewLeafHandler() *leafHandler
NewAtomicLeafHandler returns a new uninitialized leafHandler that can be later initialized
func NewSummaryParser ¶
func NewSummaryParser() *summaryParser
Types ¶
type Config ¶
type Config struct { // Client is the leaf client used to fetch data from the network. Client syncclient.LeafClient // Database is the version database for storing synced data. Database *versiondb.Database // AtomicTrie is the atomic trie to sync into. AtomicTrie *atomicstate.AtomicTrie // TargetRoot is the root hash of the trie to sync to. TargetRoot common.Hash // TargetHeight is the target block height to sync to. TargetHeight uint64 // RequestSize is the maximum number of leaves to request in a single network call. RequestSize uint16 // NumWorkers is the number of worker goroutines to use for syncing. // If not set, [DefaultNumWorkers] will be used. NumWorkers int }
Config holds the configuration for creating a new atomic syncer.
type Extender ¶
type Extender struct {
// contains filtered or unexported fields
}
Extender is the sync extender for the atomic VM.
func (*Extender) CreateSyncer ¶
func (a *Extender) CreateSyncer(ctx context.Context, client syncclient.LeafClient, verDB *versiondb.Database, summary message.Syncable) (synccommon.Syncer, error)
CreateSyncer creates the atomic syncer with the given client and verDB.
func (*Extender) Initialize ¶
func (a *Extender) Initialize(backend *state.AtomicBackend, trie *state.AtomicTrie, requestSize uint16)
Initialize initializes the sync extender with the backend and trie and request size.
func (*Extender) OnFinishAfterCommit ¶
OnFinishAfterCommit implements the sync.Extender interface by applying the atomic trie to the shared memory.
type Summary ¶
type Summary struct { *message.BlockSyncSummary `serialize:"true"` AtomicRoot common.Hash `serialize:"true"` // contains filtered or unexported fields }
Summary provides the information necessary to sync a node starting at the given block.
func NewSummary ¶
type SummaryProvider ¶
type SummaryProvider struct {
// contains filtered or unexported fields
}
SummaryProvider is the summary provider that provides the state summary for the atomic trie.
func (*SummaryProvider) Initialize ¶
func (a *SummaryProvider) Initialize(trie *state.AtomicTrie)
Initialize initializes the summary provider with the atomic trie.
func (*SummaryProvider) StateSummaryAtBlock ¶
func (a *SummaryProvider) StateSummaryAtBlock(blk *types.Block) (block.StateSummary, error)
StateSummaryAtBlock returns the block state summary at [blk] if valid.