-
Notifications
You must be signed in to change notification settings - Fork 172
/
execution_data_requester.go
27 lines (21 loc) · 1.18 KB
/
execution_data_requester.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
package state_synchronization
import (
"github.com/onflow/flow-go/consensus/hotstuff/model"
"github.com/onflow/flow-go/module/component"
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
)
// OnExecutionDataReceivedConsumer is a callback that is called ExecutionData is received for a new block
type OnExecutionDataReceivedConsumer func(*execution_data.BlockExecutionDataEntity)
// ExecutionDataRequester is a component that syncs ExecutionData from the network, and exposes
// a callback that is called when a new ExecutionData is received
type ExecutionDataRequester interface {
component.Component
// OnBlockFinalized accepts block finalization notifications from the FollowerDistributor
OnBlockFinalized(*model.Block)
// AddOnExecutionDataReceivedConsumer adds a callback to be called when a new ExecutionData is received
AddOnExecutionDataReceivedConsumer(OnExecutionDataReceivedConsumer)
// HighestConsecutiveHeight returns the highest consecutive block height for which ExecutionData
// has been received.
// This method must only be called after the component is Ready. If it is called early, an error is returned.
HighestConsecutiveHeight() (uint64, error)
}