Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
const BlocksToFetch = 256
    BlocksToFetch is the number of the block parents the state syncs to. The last 256 block hashes are necessary to support the BLOCKHASH opcode.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockAcceptor ¶
BlockAcceptor provides a mechanism to update the last accepted block ID during state synchronization. This interface is used by the state sync process to ensure the blockchain state is properly updated when new blocks are synchronized from the network.
type Client ¶
type Client interface {
	// Methods that implement the client side of [block.StateSyncableVM].
	StateSyncEnabled(context.Context) (bool, error)
	GetOngoingSyncStateSummary(context.Context) (block.StateSummary, error)
	ParseStateSummary(ctx context.Context, summaryBytes []byte) (block.StateSummary, error)
	// Additional methods required by the evm package.
	ClearOngoingSummary() error
	Shutdown() error
	Error() error
}
    func NewClient ¶
func NewClient(config *ClientConfig) Client
type ClientConfig ¶
type ClientConfig struct {
	Chain      *eth.Ethereum
	State      *chain.State
	ChainDB    ethdb.Database
	Acceptor   BlockAcceptor
	VerDB      *versiondb.Database
	MetadataDB database.Database
	// Extension points.
	Parser message.SyncableParser
	// Extender is an optional extension point for the state sync process, and can be nil.
	Extender      syncpkg.Extender
	Client        syncclient.Client
	StateSyncDone chan struct{}
	// Specifies the number of blocks behind the latest state summary that the chain must be
	// in order to prefer performing state sync over falling back to the normal bootstrapping
	// algorithm.
	MinBlocks          uint64
	LastAcceptedHeight uint64
	RequestSize        uint16 // number of key/value pairs to ask peers for per request
	Enabled            bool
	SkipResume         bool
}
    type EthBlockWrapper ¶
EthBlockWrapper can be implemented by a concrete block wrapper type to return *types.Block, which is needed to update chain pointers at the end of the sync operation.
type Server ¶
type Server interface {
	GetLastStateSummary(context.Context) (block.StateSummary, error)
	GetStateSummary(context.Context, uint64) (block.StateSummary, error)
}
    func NewServer ¶
func NewServer(chain *core.BlockChain, provider synccommon.SummaryProvider, syncableInterval uint64) Server
type SyncerRegistry ¶
type SyncerRegistry struct {
	// contains filtered or unexported fields
}
    SyncerRegistry manages a collection of syncers for sequential execution.
func NewSyncerRegistry ¶
func NewSyncerRegistry() *SyncerRegistry
NewSyncerRegistry creates a new empty syncer registry.
func (*SyncerRegistry) Register ¶
func (r *SyncerRegistry) Register(syncer synccommon.Syncer) error
Register adds a syncer to the registry. Returns an error if a syncer with the same name is already registered.
func (*SyncerRegistry) RunSyncerTasks ¶
RunSyncerTasks executes all registered syncers. The provided summary is used only for logging to decouple from concrete client types.
type SyncerTask ¶
type SyncerTask struct {
	// contains filtered or unexported fields
}
    SyncerTask represents a single syncer with its name for identification.