snapshots

package
v0.33.24-atree-inlining Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSnapshotHistoryLimit = errors.New("reached the snapshot history limit")
View Source
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

func GetCounterAndPhase(state protocol.State, height uint64) (uint64, flow.EpochPhase, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL