state_synchronization

package
v0.23.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeIntermediateCIDs = iota
	CodeExecutionStateDiff
)
View Source
const MAX_BLOCK_SIZE = 1e6 // 1MB

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockWriter

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

func (*BlockWriter) Flush

func (bw *BlockWriter) Flush() error

func (*BlockWriter) GetWrittenCids

func (bw *BlockWriter) GetWrittenCids() []cid.Cid

func (*BlockWriter) Reset

func (bw *BlockWriter) Reset()

func (*BlockWriter) Write

func (bw *BlockWriter) Write(p []byte) (n int, err error)

type ExecutionStateDiff

type ExecutionStateDiff struct {
	Collections        []*flow.Collection
	Events             []*flow.Event
	TrieUpdate         []*ledger.TrieUpdate
	TransactionResults []*flow.TransactionResult
}

type StateDiffStorer

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

func NewStateDiffStorer

func NewStateDiffStorer(
	codec encoding.Codec,
	compressor network.Compressor,
	bstore blockstore.Blockstore,
) (*StateDiffStorer, error)

func (*StateDiffStorer) Load

func (s *StateDiffStorer) Load(c cid.Cid) (*ExecutionStateDiff, error)

Load loads the ExecutionStateDiff represented by the given CID from the blockstore. Since blocks are limited to MAX_BLOCK_SIZE bytes, it's possible that the data was stored in multiple chunks, and hence the root CID may point to a block for which the data itself is a list of concatenated CIDs.

func (*StateDiffStorer) Store

func (s *StateDiffStorer) Store(sd *ExecutionStateDiff) (cid.Cid, error)

Jump to

Keyboard shortcuts

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