## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

- Auto
- Light
- Dark

# Algorand Specifications

The recovery algorithm is executed periodically, whenever a BundlecertBundlecert has not been observed before DeadlineTimeout(p) for a given period pp.

* * *

Algorithm 9: Recovery

1: function Recovery()  
2:   ResynchronizationAttempt()  
3:   for a ∈ A do  
4:     credentials ← Sortition(aI, r, p, s)  
5:     if credentialsj > 0 then  
6:       if ∃v = Proposalv(proposal, proposalp, proposalI) for some proposal ∈ P | IsCommittable(v) then  
7:         Broadcast(Vote(aI, r, p, s, v, credentials))  
8:       else if ∃s0 > cert | Bundle(r, p − 1, s0, ⊥) ⊆ V ∧ ∃s1 > cert | Bundle(r, p − 1, s1, v¯) ⊆ V then  
9:         Broadcast(Vote(aI, r, p, s, v¯, credentials))  
10:      else  
11:        Broadcast(Vote(aI, r, p, s, ⊥, credentials))  
12:      end if  
13:    end if  
14:  end for  
15:  step ← step + 1  
16: end function

* * *

> Important  
> **IMPLEMENTATION:**  
> Next vote issuance [reference implementation](https://github.com/algorand/go-algorand/blob/d52e3dd8b31a17dfebac3d9158a76e8e62617462/agreement/player.go#L214).

The node starts by making a resynchronization attempt (Line 2).

Afterward (Lines 3:5), the node plays independently for each _online_ account (registered on the node). This means that for _every account_ available in AA, the SortitionSortition algorithm is run, and accounts selected in the recovery committee (i.e., the players) for the _current step_ nextknextk (that is, those whose credentialsj > 0) will produce one of the following three distinct outputs (Lines 6:14):

- If a _proposal-value_ v can be committed in the current context, then the player broadcasts a nextknextk vote for v.

- If no _proposal-value_ can be committed, and
  
  - No recovery step Bundle for the _empty proposal-value_ (⊥) was observed in the _previous period_, and
  - A recovery step Bundle for the _pinned value_ was observed in the _previous period_ [1](https://specs.algorand.co/abft/non-normative/abft-nn-recovery#footnote-1),

then a nextknextk vote for v¯ is broadcast by the player.

- Finally, if none of the above conditions were met, a nextknextk vote for ⊥ is broadcast.

A player is forbidden from equivocating in nextknextk votes.

Lastly (Line 15), the node’s current step is updated.

> For a formal definition of this functionality, refer to the ABFT [normative section](https://specs.algorand.co/abft/abft#recovery).

* * *

1. This implies v¯ ≠ ⊥. [↩](https://specs.algorand.co/abft/non-normative/abft-nn-recovery#fr-1-1)
