-
Notifications
You must be signed in to change notification settings - Fork 176
/
chunks.go
31 lines (28 loc) · 1006 Bytes
/
chunks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package module
import (
chmodels "github.com/onflow/flow-go/model/chunks"
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/model/verification"
)
// ChunkAssigner presents an interface for assigning chunks to the verifier nodes
type ChunkAssigner interface {
// 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
Assign(result *flow.ExecutionResult, blockID flow.Identifier) (*chmodels.Assignment, error)
}
// ChunkVerifier provides functionality to verify chunks
type ChunkVerifier interface {
// Verify verifies the given VerifiableChunk 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.
Verify(
ch *verification.VerifiableChunkData,
) (
[]byte,
error,
)
}