github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/chunks.go (about) 1 package module 2 3 import ( 4 chmodels "github.com/onflow/flow-go/model/chunks" 5 "github.com/onflow/flow-go/model/flow" 6 "github.com/onflow/flow-go/model/verification" 7 ) 8 9 // ChunkAssigner presents an interface for assigning chunks to the verifier nodes 10 type ChunkAssigner interface { 11 // Assign generates the assignment 12 // error returns: 13 // * NoValidChildBlockError indicates that no valid child block is known 14 // (which contains the block's source of randomness) 15 // * unexpected errors should be considered symptoms of internal bugs 16 Assign(result *flow.ExecutionResult, blockID flow.Identifier) (*chmodels.Assignment, error) 17 } 18 19 // ChunkVerifier provides functionality to verify chunks 20 type ChunkVerifier interface { 21 // Verify verifies the given VerifiableChunk by executing it and checking 22 // the final state commitment. 23 // It returns a Spock Secret as a byte array, verification fault of the 24 // chunk, and an error. 25 Verify( 26 ch *verification.VerifiableChunkData, 27 ) ( 28 []byte, 29 error, 30 ) 31 }