sync

package
v0.15.2-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: GPL-3.0, LGPL-3.0 Imports: 22 Imported by: 0

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 NewExtender

func NewExtender(backend *state.AtomicBackend, trie *state.AtomicTrie, requestSize uint16) *extender

Initialize initializes the sync extender with the backend and trie.

func NewLeafHandler

func NewLeafHandler(atomicTrieDB *triedb.Database, trieKeyLength int, networkCodec codec.Manager) *leafHandler

Initialize initializes the leafHandler with the provided atomicTrieDB, trieKeyLength, and networkCodec

func NewSummaryParser

func NewSummaryParser() *summaryParser

func NewSummaryProvider

func NewSummaryProvider(atomicTrie *state.AtomicTrie) *summaryProvider

Types

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 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