Documentation ¶
Index ¶
- Variables
- func GetClosestDynamicBootstrapSnapshot(state protocol.State, refSnapshot protocol.Snapshot, snapshotHistoryLimit int) (protocol.Snapshot, error)
- func GetCounterAndPhase(state protocol.State, height uint64) (uint64, flow.EpochPhase, error)
- func GetDynamicBootstrapSnapshot(state protocol.State, refSnapshot protocol.Snapshot) (protocol.Snapshot, error)
- func IsEpochOrPhaseDifferent(counter1, counter2 uint64, phase1, phase2 flow.EpochPhase) bool
Constants ¶
This section is empty.
Variables ¶
var ErrSnapshotHistoryLimit = errors.New("reached the snapshot history limit")
var ErrSnapshotPhaseMismatch = errors.New("snapshot does not contain a valid sealing segment")
Functions ¶
func GetClosestDynamicBootstrapSnapshot ¶
func GetClosestDynamicBootstrapSnapshot(state protocol.State, refSnapshot protocol.Snapshot, snapshotHistoryLimit int) (protocol.Snapshot, error)
GetClosestDynamicBootstrapSnapshot will return a valid snapshot for dynamic bootstrapping Expected error returns during normal operations: If a snapshot does contain an invalid sealing segment query the state by height of each block in the segment and return a snapshot at the point where the transition happens. * ErrSnapshotPhaseMismatch - snapshot does not contain a valid sealing segment * ErrSnapshotHistoryLimit - reached the snapshot history limit All other errors should be treated as exceptions.
func GetCounterAndPhase ¶
GetCounterAndPhase returns the current epoch counter and phase, at `height`. No errors are expected during normal operation.
func GetDynamicBootstrapSnapshot ¶
func GetDynamicBootstrapSnapshot(state protocol.State, refSnapshot protocol.Snapshot) (protocol.Snapshot, error)
GetDynamicBootstrapSnapshot returns `refSnapshot` if it is valid for use in dynamic bootstrapping. Otherwise returns an error. (Effectively this validates that the input snapshot can be used in dynamic bootstrapping.) Expected error returns during normal operations: * ErrSnapshotPhaseMismatch - snapshot does not contain a valid sealing segment All other errors should be treated as exceptions.
func IsEpochOrPhaseDifferent ¶
func IsEpochOrPhaseDifferent(counter1, counter2 uint64, phase1, phase2 flow.EpochPhase) bool
Types ¶
This section is empty.