Versions in this module Expand all Collapse all v0 v0.13.8 Aug 6, 2024 Changes in this version + var StateSyncVersion = &version.Application + func NewClient(config *ClientConfig) *client + type CallbackLeafSyncer struct + func NewCallbackLeafSyncer(client LeafClient, tasks <-chan LeafSyncTask, requestSize uint16) *CallbackLeafSyncer + func (c *CallbackLeafSyncer) Done() <-chan error + func (c *CallbackLeafSyncer) Start(ctx context.Context, numThreads int, onFailure func(error) error) + type Client interface + GetBlocks func(ctx context.Context, blockHash common.Hash, height uint64, parents uint16) ([]*types.Block, error) + GetCode func(ctx context.Context, hashes []common.Hash) ([][]byte, error) + GetLeafs func(ctx context.Context, request message.LeafsRequest) (message.LeafsResponse, error) + type ClientConfig struct + BlockParser EthBlockParser + Codec codec.Manager + NetworkClient peer.NetworkClient + StateSyncNodeIDs []ids.NodeID + Stats stats.ClientSyncerStats + type EthBlockParser interface + ParseEthBlock func(b []byte) (*types.Block, error) + type LeafClient interface + GetLeafs func(context.Context, message.LeafsRequest) (message.LeafsResponse, error) + type LeafSyncTask interface + Account func() common.Hash + End func() []byte + NodeType func() message.NodeType + OnFinish func(ctx context.Context) error + OnLeafs func(keys, vals [][]byte) error + OnStart func() (bool, error) + Root func() common.Hash + Start func() []byte + type MockClient struct + GetBlocksIntercept func(blockReq message.BlockRequest, blocks types.Blocks) (types.Blocks, error) + GetCodeIntercept func(hashes []common.Hash, codeBytes [][]byte) ([][]byte, error) + GetLeafsIntercept func(req message.LeafsRequest, res message.LeafsResponse) (message.LeafsResponse, error) + func NewMockClient(codec codec.Manager, leafHandler *handlers.LeafsRequestHandler, ...) *MockClient + func (ml *MockClient) BlocksReceived() int32 + func (ml *MockClient) CodeReceived() int32 + func (ml *MockClient) GetBlocks(ctx context.Context, blockHash common.Hash, height uint64, numParents uint16) ([]*types.Block, error) + func (ml *MockClient) GetCode(ctx context.Context, hashes []common.Hash) ([][]byte, error) + func (ml *MockClient) GetLeafs(ctx context.Context, request message.LeafsRequest) (message.LeafsResponse, error) + func (ml *MockClient) LeavesReceived() int32