github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/collection/compliance.go (about) 1 package collection 2 3 import ( 4 "github.com/onflow/flow-go/model/flow" 5 "github.com/onflow/flow-go/model/messages" 6 "github.com/onflow/flow-go/module/component" 7 ) 8 9 // Compliance defines the interface to the cluster consensus logic that precedes hotstuff logic. 10 // It's responsible for processing incoming block proposals broadcast by other cluster consensus participants 11 // as well as blocks obtained via the chain sync protocol. 12 // Compliance logic performs validation of incoming blocks by checking headers and payloads. 13 // Compliance logic guarantees that only valid blocks are added to chain state, passed to hotstuff and other 14 // components. 15 // Implementation need to be non-blocking and concurrency safe. 16 type Compliance interface { 17 component.Component 18 19 // OnClusterBlockProposal feeds a new block proposal into the processing pipeline. 20 // Incoming proposals will be queued and eventually dispatched by worker. 21 // This method is non-blocking. 22 OnClusterBlockProposal(proposal flow.Slashable[*messages.ClusterBlockProposal]) 23 // OnSyncedClusterBlock feeds a block obtained from sync proposal into the processing pipeline. 24 // Incoming proposals will be queued and eventually dispatched by worker. 25 // This method is non-blocking. 26 OnSyncedClusterBlock(block flow.Slashable[*messages.ClusterBlockProposal]) 27 }