Documentation ¶
Index ¶
Constants ¶
const DefaultChunkAssignmentAlpha = 5
DefaultChunkAssignmentAlpha is the default number of verifiers that should be assigned to each chunk. DISCLAIMER: alpha down there is not a production-level value
Variables ¶
This section is empty.
Functions ¶
func IsValidVerifer ¶ added in v0.9.6
func IsValidVerifer(assignment *chunkmodels.Assignment, chunk *flow.Chunk, approver flow.Identifier) bool
IsValidVerifer returns true if the approver was assigned to the chunk
Types ¶
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) *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.
type PublicAssignment ¶
type PublicAssignment struct {
// contains filtered or unexported fields
}
PublicAssignment 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 NewPublicAssignment ¶
func NewPublicAssignment(alpha int, protocolState protocol.ReadOnlyState) (*PublicAssignment, error)
NewPublicAssignment 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 (*PublicAssignment) Assign ¶
func (p *PublicAssignment) Assign(result *flow.ExecutionResult, blockID flow.Identifier) (*chunkmodels.Assignment, error)
Assign generates the assignment
func (*PublicAssignment) Size ¶
func (p *PublicAssignment) Size() uint
Size returns number of assignments