chunks

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: AGPL-3.0 Imports: 3 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

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 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) *CFInvalidEventsCollection

func (*CFInvalidEventsCollection) ChunkIndex added in v0.19.0

func (c *CFInvalidEventsCollection) ChunkIndex() uint64

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 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) 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) 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) 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) 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 ChunkFault

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

ChunkFault 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

Jump to

Keyboard shortcuts

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