sync

package
v1.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2025 License: GPL-3.0, LGPL-3.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const TrieNode message.NodeType = 2

TrieNode represents a leaf node that belongs to the atomic trie.

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 Extender

type Extender struct {
	// contains filtered or unexported fields
}

Extender is the sync extender for the atomic VM.

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

func (a *Extender) OnFinishAfterCommit(summaryHeight uint64) error

OnFinishAfterCommit implements the sync.Extender interface by applying the atomic trie to the shared memory.

func (*Extender) OnFinishBeforeCommit

func (a *Extender) OnFinishBeforeCommit(lastAcceptedHeight uint64, Summary message.Syncable) error

OnFinishBeforeCommit implements the sync.Extender interface by marking the previously last accepted block for the shared memory cursor.

func (*Extender) Sync

func (a *Extender) Sync(ctx context.Context, client syncclient.LeafClient, verDB *versiondb.Database, summary message.Syncable) error

Sync syncs the atomic summary with the given client and verDB.

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

func NewSummary(blockHash common.Hash, blockNumber uint64, blockRoot common.Hash, atomicRoot common.Hash) (*Summary, error)

func (*Summary) Accept

func (*Summary) Bytes

func (a *Summary) Bytes() []byte

func (*Summary) ID

func (a *Summary) ID() ids.ID

func (*Summary) String

func (a *Summary) String() string

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.

type Syncer

type Syncer interface {
	Start(ctx context.Context) error
	Done() <-chan error
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL