state_synchronization

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: AGPL-3.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CodeRecursiveCIDs = iota + 1
	CodeExecutionData
)

header codes to distinguish between different types of data

Variables

View Source
var ErrBlobTreeDepthExceeded = errors.New("blob tree depth exceeded")
View Source
var ErrCacheMiss = errors.New("CID not found in cache")

Functions

func NewExecutionDataService

func NewExecutionDataService(
	codec encoding.Codec,
	compressor network.Compressor,
	blobService network.BlobService,
	metrics module.ExecutionDataServiceMetrics,
	logger zerolog.Logger,
) *executionDataServiceImpl

Types

type BlobNotFoundError

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

BlobNotFoundError is returned when the blobservice failed to find a blob.

func (*BlobNotFoundError) Error

func (e *BlobNotFoundError) Error() string

type BlobRecord

type BlobRecord struct {
	BlobTreeRecord   *BlobTreeRecord
	BlobTreeLocation BlobTreeLocation
}

type BlobSizeLimitExceededError

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

BlobSizeLimitExceededError is returned when a blob exceeds the maximum size allowed.

func (*BlobSizeLimitExceededError) Error

type BlobTree

type BlobTree [][]cid.Cid

type BlobTreeLocation

type BlobTreeLocation struct {
	Height uint
	Index  uint
}

type BlobTreeRecord

type BlobTreeRecord struct {
	BlockID     flow.Identifier
	BlockHeight uint64
	BlobTree    BlobTree
}

type ExecutionData

type ExecutionData struct {
	BlockID     flow.Identifier
	Collections []*flow.Collection
	Events      []flow.EventsList
	TrieUpdates []*ledger.TrieUpdate
}

ExecutionData represents the execution data of a block

type ExecutionDataCIDCache

type ExecutionDataCIDCache interface {
	Get(c cid.Cid) (BlobRecord, error)
	Insert(header *flow.Header, blobTree BlobTree)
	BlobTreeRecords() uint
	BlobRecords() uint
}

type ExecutionDataCIDCacheImpl

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

func NewExecutionDataCIDCache

func NewExecutionDataCIDCache(size uint) *ExecutionDataCIDCacheImpl

func (*ExecutionDataCIDCacheImpl) BlobRecords

func (e *ExecutionDataCIDCacheImpl) BlobRecords() uint

func (*ExecutionDataCIDCacheImpl) BlobTreeRecords

func (e *ExecutionDataCIDCacheImpl) BlobTreeRecords() uint

func (*ExecutionDataCIDCacheImpl) Get

func (e *ExecutionDataCIDCacheImpl) Get(c cid.Cid) (BlobRecord, error)

func (*ExecutionDataCIDCacheImpl) Insert

func (e *ExecutionDataCIDCacheImpl) Insert(header *flow.Header, blobTree BlobTree)

type ExecutionDataReceivedCallback added in v0.26.2

type ExecutionDataReceivedCallback func(*ExecutionData)

ExecutionDataReceivedCallback is a callback that is called ExecutionData is received for a new block

type ExecutionDataRequester added in v0.26.2

type ExecutionDataRequester interface {
	component.Component

	// OnBlockFinalized accepts block finalization notifications from the FinalizationDistributor
	OnBlockFinalized(*model.Block)

	// AddOnExecutionDataFetchedConsumer adds a callback to be called when a new ExecutionData is received
	AddOnExecutionDataFetchedConsumer(fn ExecutionDataReceivedCallback)
}

ExecutionDataRequester is a component that syncs ExecutionData from the network, and exposes a callback that is called when a new ExecutionData is received

type ExecutionDataService

type ExecutionDataService interface {
	module.ReadyDoneAware
	// Add constructs a blob tree for the given ExecutionData and
	// adds it to the blobservice, and then returns the root CID
	// and list of all CIDs.
	Add(ctx context.Context, sd *ExecutionData) (flow.Identifier, BlobTree, error)

	// Get gets the ExecutionData for the given root CID from the blobservice.
	Get(ctx context.Context, rootID flow.Identifier) (*ExecutionData, error)
}

ExecutionDataService handles adding/getting execution data to/from a blobservice

type MalformedDataError

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

MalformedDataError is returned when malformed data is found at some level of the requested blob tree. It likely indicates that the tree was generated incorrectly, and hence the request should not be retried.

func (*MalformedDataError) Error

func (e *MalformedDataError) Error() string

func (*MalformedDataError) Unwrap

func (e *MalformedDataError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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