-
Notifications
You must be signed in to change notification settings - Fork 199
/
interface.go
29 lines (25 loc) · 1.09 KB
/
interface.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
package sync
import (
"github.com/ElrondNetwork/elrond-go-core/data"
"github.com/ElrondNetwork/elrond-go/storage"
)
// blockBootstrapper is the interface needed by base sync to deal with shards and meta nodes while they bootstrap
type blockBootstrapper interface {
getCurrHeader() (data.HeaderHandler, error)
getPrevHeader(data.HeaderHandler, storage.Storer) (data.HeaderHandler, error)
getBlockBody(headerHandler data.HeaderHandler) (data.BodyHandler, error)
getHeaderWithHashRequestingIfMissing(hash []byte) (data.HeaderHandler, error)
getHeaderWithNonceRequestingIfMissing(nonce uint64) (data.HeaderHandler, error)
haveHeaderInPoolWithNonce(nonce uint64) bool
getBlockBodyRequestingIfMissing(headerHandler data.HeaderHandler) (data.BodyHandler, error)
isForkTriggeredByMeta() bool
requestHeaderByNonce(nonce uint64)
}
// syncStarter defines the behavior of component that can start sync-ing blocks
type syncStarter interface {
SyncBlock() error
}
// forkDetector is the interface needed by base fork detector to deal with shards and meta nodes
type forkDetector interface {
computeFinalCheckpoint()
}