|
| 1 | + Protocol update |
| 2 | + |
| 3 | +Protocol Version: 8 |
| 4 | +Builds on Protocol Version: 7 |
| 5 | + |
| 6 | + Abstract |
| 7 | + |
| 8 | +This document describes the changes in Concordium protocol version 8 compared to |
| 9 | +protocol version 7. |
| 10 | + |
| 11 | +The protocol change supports suspending inactive validators automatically when they |
| 12 | +consistently fail to participate in the consensus protocol. Suspended validators |
| 13 | +can be reactivated manually by a transaction from the validator's account. |
| 14 | + |
| 15 | + Background |
| 16 | + |
| 17 | +Validators in the Concordium consensus protocol play two related roles. First, they |
| 18 | +propose blocks to add to the chain when they are chosen as the leader of a round. |
| 19 | +The round leader is determined by a lottery weighted by the validator's effective |
| 20 | +stake. If a validator fails to produce a block in its round, the round will |
| 21 | +eventually time-out, progressing to the next round with no block produced. |
| 22 | +Time-outs increase the confirmation time (that is, the time until a transaction is |
| 23 | +finalized on the chain) and decrease the throughput (that is, the maximum number |
| 24 | +of transactions the chain can incorporate in a given period of time). |
| 25 | + |
| 26 | +The second role of validators is to sign off on rounds by either attesting to a |
| 27 | +valid block in the round, or to the fact that the round timed-out. To progress to |
| 28 | +the next round, two thirds of the finalization committee (weighted by stake) must |
| 29 | +agree. If more than one third of the committee does not sign off on a round, then |
| 30 | +the blockchain halts until two thirds of the committee eventually agrees. |
| 31 | + |
| 32 | +Inactive validators are therefore detrimental to the operation of the consensus |
| 33 | +protocol. Protocol version 8 introduces a mechanism to automatically suspend |
| 34 | +validators that consistently fail to participate in the protocol. Suspended |
| 35 | +validators are excluded from the committee of validators, and will therefore |
| 36 | +not be selected to propose blocks nor be required to sign off on rounds. |
| 37 | +Consequently, suspended validators do not earn rewards for themselves or their |
| 38 | +pool. |
| 39 | + |
| 40 | +The account associated with a suspended validator can lift the suspension by |
| 41 | +sending a transaction to do so. The validator will then be included in the |
| 42 | +committee the next time it is determined. (The committee is determined one |
| 43 | +epoch before each pay day.) |
| 44 | + |
| 45 | +The procedure for automatically suspending a validator is as follows: |
| 46 | + |
| 47 | +- For each current validator, continuously track the number of missed rounds |
| 48 | + since the validator last successfully produced a block. A missed round is a |
| 49 | + round in which the validator was the round leader, but no block was produced. |
| 50 | + |
| 51 | +- At each payday, if the number of missed rounds for a validator exceeds a |
| 52 | + threshold (determined by the "maximum missed rounds" chain parameter) |
| 53 | + then mark the validator as "primed for suspension". |
| 54 | + |
| 55 | +- At each snapshot (that is, the start of an epoch prior to a payday), if |
| 56 | + a validator is primed for suspension, then it is marked as suspended. |
| 57 | + Suspended validators are not included in the calculation of the validator |
| 58 | + committee. |
| 59 | + |
| 60 | +- Whenever a validator produces a block, or is a signatory of a quorum |
| 61 | + certificate that is in a block, its missed rounds counter is reset and it is |
| 62 | + no longer marked as primed for suspension. |
| 63 | + |
| 64 | + Changes |
| 65 | + |
| 66 | +The following behaviours are changed in protocol version 8. |
| 67 | + |
| 68 | +1. A new chain parameter, `maximum_missed_rounds`, is added. This is updated |
| 69 | + by a level 2 update instruction (payload `ValidatorScoreParametersCPV3`) |
| 70 | + that is authorized by the pool parameters keys. |
| 71 | + |
| 72 | +2. The validator record on accounts includes a new boolean flag indicating if |
| 73 | + the validator is currently suspended. |
| 74 | + |
| 75 | +3. The validator pool reward details add a counter of the number of missed rounds |
| 76 | + and whether the validator is primed for suspension. |
| 77 | + |
| 78 | +4. On executing each block: |
| 79 | + |
| 80 | + (a) Validators that signed the quorum certificate for the parent block |
| 81 | + have their missed-round counter reset to zero and have their primed- |
| 82 | + for-suspension flag cleared. |
| 83 | + |
| 84 | + (b) If the previous round timed out, for each missed round, the missed round |
| 85 | + counter is incremented for the validator that was the leader of that |
| 86 | + round (in the present epoch). |
| 87 | + |
| 88 | + (c) The validator that produced the block has its missed-round counter reset |
| 89 | + to zero and its primed-for-suspension flag cleared. |
| 90 | + |
| 91 | +5. When executing a snapshot block (i.e. the first block of an epoch before a |
| 92 | + pay day, in which the committee is determined for the upcoming pay day): |
| 93 | + |
| 94 | + (a) Validators that are suspended or were primed for suspension at the |
| 95 | + start of the block are not included in the calculation of the |
| 96 | + committee for the next payday. |
| 97 | + |
| 98 | + (b) Validators that were primed for suspension at the start of the block |
| 99 | + are marked as suspended at the end of the block. |
| 100 | + |
| 101 | +6. When executing a pay day block (i.e. the first block of a new pay day, |
| 102 | + in which rewards are paid out): |
| 103 | + |
| 104 | + (a) Validators with a missed-round counter that exceeds |
| 105 | + `maximum_missed_rounds` are marked as primed for suspension. |
| 106 | + |
| 107 | + (b) Validators for the new pay day that were not validators for the |
| 108 | + previous pay day begin with their missed-round counter at 0 and |
| 109 | + their primed-for-suspension flag cleared. Validators that |
| 110 | + continue from the previous pay day maintain their missed-round |
| 111 | + counter and primed-for-suspension flag. |
| 112 | + |
| 113 | +7. The `ConfigureValidator` (also known as `ConfigureBaker`) transaction |
| 114 | + is extended with an optional boolean indicating whether the validator is |
| 115 | + suspended. If present, this updates the suspended flag on the account's |
| 116 | + validator record. When first configuring a validator, the field is not |
| 117 | + required and the validator will not be suspended by default. |
| 118 | + |
| 119 | + Effects |
| 120 | + |
| 121 | +1. The `ConfigureValidator` transaction will produce a `BakerSuspended` or |
| 122 | + `BakerResumed` event if it sets or clears the suspended flag, |
| 123 | + respectively. |
| 124 | + |
| 125 | +2. Whenever a validator is marked as primed for suspension, a |
| 126 | + `ValidatorPrimedForSuspension` event is added to the special events for |
| 127 | + the block. |
| 128 | + |
| 129 | +3. Whenever a validator is automatically marked as suspended, a |
| 130 | + `ValidatorSuspended` event is added to the special events for the block. |
| 131 | + |
| 132 | + Protocol update instruction |
| 133 | + |
| 134 | +The protocol update instruction is identified by the SHA256 hash of this |
| 135 | +file. The instruction needs the following auxiliary data: |
| 136 | + |
| 137 | +- The initial value of the `maximum_missed_rounds` parameter. |
0 commit comments