<aside> 👉 This Design extends and is based on [deprecated] Spork-less Epoch Fallback Recovery Design I: Injected Fallback Epochs.

</aside>

Context

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).

Terminology and Nomenclature

High-Level Design

EFM is triggered in the same way as currently (invalid or lack of Service Event), however:

Implementation Details

Epoch Extension

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
}

EpochExtensions are tracked in the ProtocolStateMachine as an additional field within EpochStateContainer.

type EpochStateContainer struct {
  // ...
  EpochExtensions []EpochExtension
}

EpochExtensions are accessible via the DynamicProtocolState API. (if needed?)