chunks

package
v0.37.10 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: AGPL-3.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkListFromCommit added in v0.11.0

func ChunkListFromCommit(commit flow.StateCommitment) flow.ChunkList

ChunkListFromCommit creates a chunklist with one chunk whos final state is the commit

func ChunkLocatorID added in v0.23.2

func ChunkLocatorID(resultID flow.Identifier, chunkIndex uint64) flow.Identifier

ChunkLocatorID is a util function that returns identifier of corresponding chunk locator to the specified result and chunk index.

func IsChunkFaultError added in v0.32.0

func IsChunkFaultError(err error) bool

Types

type Assignment

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

Assignment is assignment map of the chunks to the list of the verifier nodes

func NewAssignment

func NewAssignment() *Assignment

func (*Assignment) Add

func (a *Assignment) Add(chunk *flow.Chunk, verifiers flow.IdentifierList)

Add records the list of verifier nodes as the assigned verifiers of the chunk it returns an error if the list of verifiers is empty or contains duplicate ids

func (*Assignment) ByNodeID

func (a *Assignment) ByNodeID(verifierID flow.Identifier) []uint64

ByNodeID returns the indices of all chunks assigned to the given verifierID

func (*Assignment) HasVerifier added in v0.14.0

func (a *Assignment) HasVerifier(chunk *flow.Chunk, identifier flow.Identifier) bool

HasVerifier checks if a chunk is assigned to the given verifier TODO: method should probably error if chunk has unknown index

func (*Assignment) Len added in v0.11.0

func (a *Assignment) Len() int

Len returns the number of chunks in the assignment

func (*Assignment) Verifiers

func (a *Assignment) Verifiers(chunk *flow.Chunk) flow.IdentifierList

Verifiers returns the list of verifier nodes assigned to a chunk

type AssignmentDataPack

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

AssignmentDataPack

AssignmentDataPack provides a storable representation of chunk assignments on mempool

func NewAssignmentDataPack

func NewAssignmentDataPack(fingerprint flow.Identifier, assignment *Assignment) *AssignmentDataPack

NewAssignmentDataPack casts an assignment and its fingerprint into an assignment data pack

func (*AssignmentDataPack) Assignment

func (a *AssignmentDataPack) Assignment() *Assignment

Assignment returns the assignment part of the assignment data pack

func (*AssignmentDataPack) Checksum

func (a *AssignmentDataPack) Checksum() flow.Identifier

Checksum returns the checksum of the assignment data pack

func (*AssignmentDataPack) ID

ID returns the unique identifier for assignment data pack

type CFExecutionDataBlockIDMismatch added in v0.32.0

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

CFExecutionDataBlockIDMismatch is returned when the block ID contained in the execution data root is different from chunk's block ID

func NewCFExecutionDataBlockIDMismatch added in v0.32.0

func NewCFExecutionDataBlockIDMismatch(
	executionDataRootBlockID flow.Identifier,
	chunkBlockID flow.Identifier,
	chInx uint64,
	execResID flow.Identifier,
) *CFExecutionDataBlockIDMismatch

NewCFExecutionDataBlockIDMismatch creates a new instance of Chunk Fault (ExecutionDataBlockIDMismatch)

func (CFExecutionDataBlockIDMismatch) ChunkIndex added in v0.32.0

func (cf CFExecutionDataBlockIDMismatch) ChunkIndex() uint64

ChunkIndex returns chunk index of the faulty chunk

func (CFExecutionDataBlockIDMismatch) Error added in v0.32.0

func (CFExecutionDataBlockIDMismatch) ExecutionResultID added in v0.32.0

func (cf CFExecutionDataBlockIDMismatch) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFExecutionDataBlockIDMismatch) String added in v0.32.0

type CFExecutionDataChunksLengthMismatch added in v0.32.0

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

CFExecutionDataChunksLengthMismatch is returned when execution data chunks list has different length than number of chunks for a block

func NewCFExecutionDataChunksLengthMismatch added in v0.32.0

func NewCFExecutionDataChunksLengthMismatch(
	executionDataRootChunkLength int,
	executionResultChunkListLength int,
	chInx uint64,
	execResID flow.Identifier,
) *CFExecutionDataChunksLengthMismatch

NewCFExecutionDataChunksLengthMismatch creates a new instance of Chunk Fault (ExecutionDataBlockIDMismatch)

func (CFExecutionDataChunksLengthMismatch) ChunkIndex added in v0.32.0

ChunkIndex returns chunk index of the faulty chunk

func (CFExecutionDataChunksLengthMismatch) Error added in v0.32.0

func (CFExecutionDataChunksLengthMismatch) ExecutionResultID added in v0.32.0

func (cf CFExecutionDataChunksLengthMismatch) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFExecutionDataChunksLengthMismatch) String added in v0.32.0

type CFExecutionDataInvalidChunkCID added in v0.32.0

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

CFExecutionDataInvalidChunkCID is returned when execution data chunk's CID is different from computed

func NewCFExecutionDataInvalidChunkCID added in v0.32.0

func NewCFExecutionDataInvalidChunkCID(
	executionDataRootChunkCID cid.Cid,
	computedChunkCID cid.Cid,
	chInx uint64,
	execResID flow.Identifier,
) *CFExecutionDataInvalidChunkCID

NewCFExecutionDataInvalidChunkCID creates a new instance of Chunk Fault (NewCFExecutionDataInvalidChunkCID)

func (CFExecutionDataInvalidChunkCID) ChunkIndex added in v0.32.0

func (cf CFExecutionDataInvalidChunkCID) ChunkIndex() uint64

ChunkIndex returns chunk index of the faulty chunk

func (CFExecutionDataInvalidChunkCID) Error added in v0.32.0

func (CFExecutionDataInvalidChunkCID) ExecutionResultID added in v0.32.0

func (cf CFExecutionDataInvalidChunkCID) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFExecutionDataInvalidChunkCID) String added in v0.32.0

type CFInvalidEventsCollection added in v0.19.0

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

CFInvalidEventsCollection is returned when computed events collection hash is different from the chunk's one

func NewCFInvalidEventsCollection added in v0.19.0

func NewCFInvalidEventsCollection(expected flow.Identifier, computed flow.Identifier, chInx uint64, execResID flow.Identifier, events flow.EventsList) *CFInvalidEventsCollection

func (*CFInvalidEventsCollection) ChunkIndex added in v0.19.0

func (c *CFInvalidEventsCollection) ChunkIndex() uint64

func (CFInvalidEventsCollection) Error added in v0.32.0

func (cf CFInvalidEventsCollection) Error() string

func (*CFInvalidEventsCollection) ExecutionResultID added in v0.19.0

func (c *CFInvalidEventsCollection) ExecutionResultID() flow.Identifier

func (*CFInvalidEventsCollection) String added in v0.19.0

func (c *CFInvalidEventsCollection) String() string

type CFInvalidExecutionDataID added in v0.32.0

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

CFInvalidExecutionDataID is returned when ExecutionResult's ExecutionDataID is different from computed

func NewCFInvalidExecutionDataID added in v0.32.0

func NewCFInvalidExecutionDataID(
	erExecutionDataID flow.Identifier,
	computedExecutionDataID flow.Identifier,
	chInx uint64,
	execResID flow.Identifier,
) *CFInvalidExecutionDataID

NewCFInvalidExecutionDataID creates a new instance of Chunk Fault (CFInvalidExecutionDataID)

func (CFInvalidExecutionDataID) ChunkIndex added in v0.32.0

func (cf CFInvalidExecutionDataID) ChunkIndex() uint64

ChunkIndex returns chunk index of the faulty chunk

func (CFInvalidExecutionDataID) Error added in v0.32.0

func (cf CFInvalidExecutionDataID) Error() string

func (CFInvalidExecutionDataID) ExecutionResultID added in v0.32.0

func (cf CFInvalidExecutionDataID) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFInvalidExecutionDataID) String added in v0.32.0

func (cf CFInvalidExecutionDataID) String() string

type CFInvalidServiceEventsEmitted added in v0.19.0

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

CFInvalidServiceEventsEmitted is returned when service events are different from the chunk's one

func CFInvalidServiceSystemEventsEmitted added in v0.19.0

func CFInvalidServiceSystemEventsEmitted(expected flow.ServiceEventList, computed flow.ServiceEventList, chInx uint64, execResID flow.Identifier) *CFInvalidServiceEventsEmitted

func (*CFInvalidServiceEventsEmitted) ChunkIndex added in v0.19.0

func (c *CFInvalidServiceEventsEmitted) ChunkIndex() uint64

func (CFInvalidServiceEventsEmitted) Error added in v0.32.0

func (*CFInvalidServiceEventsEmitted) ExecutionResultID added in v0.19.0

func (c *CFInvalidServiceEventsEmitted) ExecutionResultID() flow.Identifier

func (*CFInvalidServiceEventsEmitted) String added in v0.19.0

type CFInvalidVerifiableChunk

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

CFInvalidVerifiableChunk is returned when a verifiable chunk is invalid this includes cases that code fails to construct a partial trie, collection hashes doesn't match TODO break this into more detailed ones as we progress

func NewCFInvalidVerifiableChunk

func NewCFInvalidVerifiableChunk(reason string, err error, chInx uint64, execResID flow.Identifier) *CFInvalidVerifiableChunk

NewCFInvalidVerifiableChunk creates a new instance of Chunk Fault (InvalidVerifiableChunk)

func (CFInvalidVerifiableChunk) ChunkIndex

func (cf CFInvalidVerifiableChunk) ChunkIndex() uint64

ChunkIndex returns chunk index of the faulty chunk

func (CFInvalidVerifiableChunk) Error added in v0.32.0

func (cf CFInvalidVerifiableChunk) Error() string

func (CFInvalidVerifiableChunk) ExecutionResultID

func (cf CFInvalidVerifiableChunk) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFInvalidVerifiableChunk) String

func (cf CFInvalidVerifiableChunk) String() string

type CFMissingRegisterTouch

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

CFMissingRegisterTouch is returned when a register touch is missing (read or update)

func NewCFMissingRegisterTouch

func NewCFMissingRegisterTouch(regsterIDs []string, chInx uint64, execResID flow.Identifier, txID flow.Identifier) *CFMissingRegisterTouch

NewCFMissingRegisterTouch creates a new instance of Chunk Fault (MissingRegisterTouch)

func (CFMissingRegisterTouch) ChunkIndex

func (cf CFMissingRegisterTouch) ChunkIndex() uint64

ChunkIndex returns chunk index of the faulty chunk

func (CFMissingRegisterTouch) Error added in v0.32.0

func (cf CFMissingRegisterTouch) Error() string

func (CFMissingRegisterTouch) ExecutionResultID

func (cf CFMissingRegisterTouch) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFMissingRegisterTouch) String

func (cf CFMissingRegisterTouch) String() string

type CFNonMatchingFinalState

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

CFNonMatchingFinalState is returned when the computed final state commitment (applying chunk register updates to the partial trie) doesn't match the one provided by the chunk

func NewCFNonMatchingFinalState

func NewCFNonMatchingFinalState(expected flow.StateCommitment, computed flow.StateCommitment, chInx uint64, execResID flow.Identifier) *CFNonMatchingFinalState

NewCFNonMatchingFinalState creates a new instance of Chunk Fault (NonMatchingFinalState)

func (CFNonMatchingFinalState) ChunkIndex

func (cf CFNonMatchingFinalState) ChunkIndex() uint64

ChunkIndex returns chunk index of the faulty chunk

func (CFNonMatchingFinalState) Error added in v0.32.0

func (cf CFNonMatchingFinalState) Error() string

func (CFNonMatchingFinalState) ExecutionResultID

func (cf CFNonMatchingFinalState) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFNonMatchingFinalState) String

func (cf CFNonMatchingFinalState) String() string

type CFSystemChunkIncludedCollection added in v0.32.0

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

CFSystemChunkIncludedCollection is returned when a system chunk includes a collection

func NewCFSystemChunkIncludedCollection added in v0.32.0

func NewCFSystemChunkIncludedCollection(chInx uint64, execResID flow.Identifier) *CFSystemChunkIncludedCollection

NewCFSystemChunkIncludedCollection creates a new instance of Chunk Fault (SystemChunkIncludedCollection)

func (CFSystemChunkIncludedCollection) ChunkIndex added in v0.32.0

func (cf CFSystemChunkIncludedCollection) ChunkIndex() uint64

ChunkIndex returns chunk index of the faulty chunk

func (CFSystemChunkIncludedCollection) Error added in v0.32.0

func (CFSystemChunkIncludedCollection) ExecutionResultID added in v0.32.0

func (cf CFSystemChunkIncludedCollection) ExecutionResultID() flow.Identifier

ExecutionResultID returns the execution result identifier including the faulty chunk

func (CFSystemChunkIncludedCollection) String added in v0.32.0

type ChunkFaultError added in v0.32.0

type ChunkFaultError interface {
	error
	ChunkIndex() uint64
	ExecutionResultID() flow.Identifier
	String() string
}

ChunkFaultError holds information about a fault that is found while verifying a chunk

type Locator added in v0.15.0

type Locator struct {
	ResultID flow.Identifier // execution result id that chunk belongs to
	Index    uint64          // index of chunk in the execution result
}

Locator is used to locate a chunk by providing the execution result the chunk belongs to as well as the chunk index within that execution result. Since a chunk is unique by the result ID and its index in the result's chunk list.

func (Locator) Checksum added in v0.15.0

func (c Locator) Checksum() flow.Identifier

Checksum provides a cryptographic commitment for a chunk locator content.

func (Locator) ID added in v0.15.0

func (c Locator) ID() flow.Identifier

ID returns a unique id for chunk locator.

type LocatorList added in v0.15.0

type LocatorList []*Locator

func (LocatorList) ToMap added in v0.23.2

func (l LocatorList) ToMap() LocatorMap

type LocatorMap added in v0.23.2

type LocatorMap map[flow.Identifier]*Locator

LocatorMap maps keeps chunk locators based on their locator id.

func (LocatorMap) ToList added in v0.23.2

func (l LocatorMap) ToList() LocatorList

Jump to

Keyboard shortcuts

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