github.com/koko1123/flow-go-1@v0.29.6/module/chunks.go (about) 1 package module 2 3 import ( 4 chmodels "github.com/koko1123/flow-go-1/model/chunks" 5 "github.com/koko1123/flow-go-1/model/flow" 6 "github.com/koko1123/flow-go-1/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 chmodels.ChunkFault, 30 error, 31 ) 32 }