Documentation ¶
Index ¶
Constants ¶
const DefaultChunkAssignmentAlpha = 20
DefaultChunkAssignmentAlpha is the default number of verifiers that should be assigned to each chunk. DISCLAIMER: the current value is not necessarily suitable for production
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkAssigner ¶ added in v0.14.0
type ChunkAssigner struct {
// contains filtered or unexported fields
}
ChunkAssigner implements an instance of the Public Chunk Assignment algorithm for assigning chunks to verifier nodes in a deterministic but unpredictable manner. It implements the ChunkAssigner interface.
func NewChunkAssigner ¶ added in v0.14.0
func NewChunkAssigner(alpha uint, protocolState protocol.State) (*ChunkAssigner, error)
NewChunkAssigner generates and returns an instance of the Public Chunk Assignment algorithm. Parameter alpha is the number of verifiers that should be assigned to each chunk.
func (*ChunkAssigner) Assign ¶ added in v0.14.0
func (p *ChunkAssigner) Assign(result *flow.ExecutionResult, blockID flow.Identifier) (*chunkmodels.Assignment, error)
Assign generates the assignment error returns:
- NoValidChildBlockError indicates that no valid child block is known (which contains the block's source of randomness)
- unexpected errors should be considered symptoms of internal bugs
func (*ChunkAssigner) Size ¶ added in v0.14.0
func (p *ChunkAssigner) Size() uint
Size returns number of assignments
type ChunkVerifier ¶
type ChunkVerifier struct {
// contains filtered or unexported fields
}
ChunkVerifier is a verifier based on the current definitions of the flow network
func NewChunkVerifier ¶
func NewChunkVerifier(vm VirtualMachine, vmCtx fvm.Context, logger zerolog.Logger) *ChunkVerifier
NewChunkVerifier creates a chunk verifier containing a flow virtual machine
func (*ChunkVerifier) SystemChunkVerify ¶
func (fcv *ChunkVerifier) SystemChunkVerify(vc *verification.VerifiableChunkData) ([]byte, chmodels.ChunkFault, error)
SystemChunkVerify verifies a given VerifiableChunk corresponding to a system chunk. by executing it and checking the final state commitment It returns a Spock Secret as a byte array, verification fault of the chunk, and an error. Note: SystemChunkVerify should only be executed on system chunks. It returns an error if it is invoked on non-system chunks.
func (*ChunkVerifier) Verify ¶
func (fcv *ChunkVerifier) Verify(vc *verification.VerifiableChunkData) ([]byte, chmodels.ChunkFault, error)
Verify verifies a given VerifiableChunk corresponding to a non-system chunk. by executing it and checking the final state commitment It returns a Spock Secret as a byte array, verification fault of the chunk, and an error. Note: Verify should only be executed on non-system chunks. It returns an error if it is invoked on system chunks.