github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/persister.go (about)

     1  package hotstuff
     2  
     3  // Persister is responsible for persisting state we need to bootstrap after a
     4  // restart or crash.
     5  type Persister interface {
     6  	// GetSafetyData will retrieve last persisted safety data.
     7  	// During normal operations, no errors are expected.
     8  	GetSafetyData() (*SafetyData, error)
     9  
    10  	// PutSafetyData persists the last safety data.
    11  	// This method blocks until `safetyData` was successfully persisted.
    12  	// During normal operations, no errors are expected.
    13  	PutSafetyData(safetyData *SafetyData) error
    14  
    15  	// GetLivenessData will retrieve last persisted liveness data.
    16  	// During normal operations, no errors are expected.
    17  	GetLivenessData() (*LivenessData, error)
    18  
    19  	// PutLivenessData persists the last liveness data.
    20  	// This method blocks until `safetyData` was successfully persisted.
    21  	// During normal operations, no errors are expected.
    22  	PutLivenessData(livenessData *LivenessData) error
    23  }