<aside> 👉 This Design extends and is based on [deprecated] Spork-less Epoch Fallback Recovery Design I: Injected Fallback Epochs.
</aside>
Epoch Fallback Mode (see Epoch Fallback Mode (EFM)) is a protocol-wide state which is triggered if an irrecoverable error occurs during the Epoch Preparation Protocol (see Epoch Preparation Protocol). Upon entering EFM, the protocol ceases transitioning between epochs. Until the next spork, automated reward payouts and identity table changes are disabled.
In other words, the only way to recover from EFM is with a spork.
The goal of this document is to describe how EFM can be changed to support recovery without the need for a spork (Spork-less EFM Recovery).
EFM is triggered in the same way as currently (invalid or lack of Service Event), however:
EpochExtension
s, each of which adds a new range of views past the epoch’s original range for which leaders are defined.EpochRecover
which:
resetEpoch
invocation on the FlowEpoch
smart contract, force-inserting a new epoch config and immediately transitioning into that epoch.EpochRecover
acts like an EpochSetup
and EpochCommit
event combined (i.e. fully specifying the next epoch’s config) that moves the Protocol State’s evolution back to the happy path.An EpochExtension
is an addition to the current epoch data model, which allows the final view of the epoch to be increased one or more times.
// NOTE: this is an abstract representation of an epoch, not a specific struct.
Epoch {
Counter uint64
// ...
// **NEW:** FinalView is now mutable, it can be increased by an EpochExtension.
// It cannot be decreased.
FinalView uint64
// **NEW:** Extensions is a new field. In the happy path it is nil.
// Epochs in which EFM is triggered will have at least one EpochExtension.
// Extensions is an ordered list, such that for each consecutive pair of
// EpochExtensions e1, e2, e1.FinalView+1 = e2.FirstView.
Extensions []EpochExtension
}
// EpochExtension represents a range of views which contiguously extends the
// current epoch E.
type EpochExtension struct {
FirstView uint64
FinalView uint64
TargetEndTime uint64
}
EpochExtension
s are tracked in the ProtocolStateMachine
as an additional field within EpochStateContainer
.
type EpochStateContainer struct {
// ...
EpochExtensions []EpochExtension
}
EpochExtension
s are accessible via the DynamicProtocolState
API. (if needed?)