Fork accountability
Problem Statement
Tendermint consensus algorithm guarantees the following specifications for all heights:- agreement — no two correct full nodes decide differently.
- validity — the decided block satisfies the predefined predicate valid().
- termination — all correct full nodes eventually decide,
The Misbehavior of Faulty Validators
Forks are the result of faulty validators deviating from the protocol. In principle several such deviations can be detected without a fork actually occurring:- double proposal: A faulty proposer proposes two different values (blocks) for the same height and the same round in Tendermint consensus.
- double signing: Tendermint consensus forces correct validators to prevote and precommit for at most one value per round. In case a faulty validator sends multiple prevote and/or precommit messages for different values for the same height/round, this is a misbehavior.
- lunatic validator: Tendermint consensus forces correct validators to prevote and precommit only for values v that satisfy valid(v). If faulty validators prevote and precommit for v although valid(v)=false this is misbehavior.
- amnesia: Tendermint consensus has a locking mechanism. If a validator has some value v locked, then it can only prevote/precommit for v or nil. Sending prevote/precomit message for a different value v’ (that is not nil) while holding lock on value v is misbehavior.
- spurious messages: In Tendermint consensus most of the message send instructions are guarded by threshold guards, e.g., one needs to receive 2f + 1 prevote messages to send precommit. Faulty validators may send precommit without having received the prevote messages.
Two types of forks
- Fork-Full. Two correct validators decide on different blocks for the same height. Since also the next validator sets are decided upon, the correct validators may be partitioned to participate in two distinct branches of the forked chain.
- Fork-Light. All correct validators decide on the same block for height h, but faulty processes (validators or not), forge a different block for that height, in order to fool users (who use the light client).
Attack scenarios
On-chain attacks
Equivocation (one round)
There are several scenarios in which forks might happen. The first is double signing within a round.- F1. Equivocation: faulty validators sign multiple vote messages (prevote and/or precommit) for different values during the same round r at a given height h.
Flip-flopping
Tendermint consensus implements a locking mechanism: If a correct validator p receives proposal for value v and 2f + 1 prevotes for a value id(v) in round r, it locks v and remembers r. In this case, p also sends a precommit message for id(v), which later may serve as proof that p locked v. In subsequent rounds, p only sends prevote messages for a value it had previously locked. However, it is possible to change the locked value if in a future round r’ > r, if the process receives proposal and 2f + 1 prevotes for a different value v’. In this case, p could send a prevote/precommit for id(v’). This algorithmic feature can be exploited in two ways:- F2. Faulty Flip-flopping (Amnesia): faulty validators precommit some value id(v) in round r (value v is locked in round r) and then prevote for different value id(v’) in higher round r’ > r without previously correctly unlocking value v. In this case faulty processes “forget” that they have locked value v and prevote some other value in the following rounds. Some correct validators might have decided on v in r, and other correct validators decide on v’ in r’. Here we can have branching on the main chain (Fork-Full).
- F3. Correct Flip-flopping (Back to the past): There are some precommit messages signed by (correct) validators for value id(v) in round r. Still, v is not decided upon, and all processes move on to the next round. Then correct validators (correctly) lock and decide a different value v’ in some round r’ > r. And the correct validators continue; there is no branching on the main chain. However, faulty validators may use the correct precommit messages from round r together with a posteriori generated faulty precommit messages for round r to forge a block for a value that was not decided on the main chain (Fork-Light).
Off-chain attacks
F1-F3 may contaminate the state of full nodes (and even validators). Contaminated (but otherwise correct) full nodes may thus communicate faulty blocks to light clients. Similarly, without actually interfering with the main chain, we can have the following:- F4. Phantom validators: faulty validators vote (sign prevote and precommit messages) in heights in which they are not part of the validator sets (at the main chain).
- F5. Lunatic validator: faulty validator that sign vote messages to support (arbitrary) application state that is different from the application state that resulted from valid state transitions.
Types of victims
We consider three types of potential attack victims:- FN: full node
- LCS: light client with sequential header verification
- LCB: light client with bisection based header verification
| Attack | FN | LCS | LCB |
|---|---|---|---|
| F1 | direct | FN | FN |
| F2 | direct | FN | FN |
| F3 | direct | FN | FN |
| F4 | direct | ||
| F5 | direct |
Detailed Attack Scenarios
Equivocation based attacks
In case of equivocation based attacks, faulty validators sign multiple votes (prevote and/or precommit) in the same round of some height. This attack can be executed on both full nodes and light clients. It requires 1/3 or more of voting power to be executed.Scenario 1: Equivocation on the main chain
Validators:- CA - a set of correct validators with less than 1/3 of the voting power
- CB - a set of correct validators with less than 1/3 of the voting power
- CA and CB are disjoint
- F - a set of faulty validators with 1/3 or more voting power
- A faulty proposer proposes block A to CA
- A faulty proposer proposes block B to CB
- Validators from the set CA and CB prevote for A and B, respectively.
- Faulty validators from the set F prevote both for A and B.
- The faulty prevote messages
- for A arrive at CA long before the B messages
- for B arrive at CB long before the A messages
- Therefore correct validators from set CA and CB will observe more than 2/3 of prevotes for A and B and precommit for A and B, respectively.
- Faulty validators from the set F precommit both values A and B.
- Thus, we have more than 2/3 commits for both A and B.
- Creating evidence of misbehavior is simple in this case as we have multiple messages signed by the same faulty processes for different values in the same round.
- We have to ensure that these different messages reach a correct process (full node, monitor?), which can submit evidence.
- This is an attack on the full node level (Fork-Full).
- It extends also to the light clients,
- For both we need a detection and recovery mechanism.
Scenario 2: Equivocation to a light client (LCS)
Validators:- a set F of faulty validators with more than 2/3 of the voting power.
- for the main chain F behaves nicely
- F coordinates to sign a block B that is different from the one on the main chain.
- the light clients obtains B and trusts at as it is signed by more than 2/3 of the voting power.
Flip-flopping: Amnesia based attacks
In case of amnesia, faulty validators lock some value v in some round r, and then vote for different value v’ in higher rounds without correctly unlocking value v. This attack can be used both on full nodes and light clients.Scenario 3: At most 2/3 of faults
Validators:- a set F of faulty validators with 1/3 or more but at most 2/3 of the voting power
- a set C of correct validators
- Faulty validators commit (without exposing it on the main chain) a block A in round r by collecting more than 2/3 of the voting power (containing correct and faulty validators).
- All validators (correct and faulty) reach a round r’ > r.
- Some correct validators in C do not lock any value before round r’.
- The faulty validators in F deviate from Tendermint consensus by ignoring that they locked A in r, and propose a different block B in r’.
- As the validators in C that have not locked any value find B acceptable, they accept the proposal for B and commit a block B.
Scenario 4: More than 2/3 of faults
In case there is an attack with more than 2/3 of the voting power, an attacker can arbitrarily change application state. Validators:- a set F1 of faulty validators with 1/3 or more of the voting power
- a set F2 of faulty validators with less than 1/3 of the voting power
- Similar to Scenario 3 (however, messages by correct validators are not needed)
- The faulty validators in F1 lock value A in round r
- They sign a different value in follow-up rounds
- F2 does not lock A in round r
- The validators in F1 will be detectable by the fork accountability mechanisms.
- The validators in F2 cannot be detected using this mechanism. Only in case they signed something which conflicts with the application this can be used against them. Otherwise, they do not do anything incorrect.
Back to the past
In this kind of attack, faulty validators take advantage of the fact that they did not sign messages in some of the past rounds. Due to the asynchronous network in which Tendermint operates, we cannot easily differentiate between such an attack and delayed message. This kind of attack can be used at both full nodes and light clients.Scenario 5
Validators:- C1 - a set of correct validators with over 1/3 of the voting power
- C2 - a set of correct validators with 1/3 of the voting power
- C1 and C2 are disjoint
- F - a set of faulty validators with less than 1/3 voting power
- one additional faulty process q
- F and q violate the Cosmos failure model.
- in a round r of height h we have C1 precommitting a value A,
- C2 precommits nil,
- F does not send any message
- q precommits nil.
- In some round r’ > r, F and q and C2 commit some other value B different from A.
- F and fp “go back to the past” and sign precommit message for value A in round r.
- Together with precomit messages of C1 this is sufficient for a commit for value A.
- Only a single faulty validator that previously precommited nil did equivocation, while the other 1/3 of faulty validators actually executed an attack that has exactly the same sequence of messages as part of amnesia attack. Detecting this kind of attack boil down to mechanisms for equivocation and amnesia.
Phantom validators
In case of phantom validators, processes that are not part of the current validator set but are still bonded (as attack happen during their unbonding period) can be part of the attack by signing vote messages. This attack can be executed against both full nodes and light clients.Scenario 6
Validators:- F — a set of faulty validators that are not part of the validator set on the main chain at height h + k
-
There is a fork, and there exist two different headers for height h + k, with different validator sets:
- VS2 on the main chain
- forged header VS2’, signed by F (and others)
- a light client has a trust in a header for height h (and the corresponding validator set VS1).
- As part of bisection header verification, it verifies the header at height h + k with new validator set VS2’.
- To detect this, a node needs to see both, the forged header and the canonical header from the chain.
- If this is the case, detecting these kind of attacks is easy as it just requires verifying if processes are signing messages in heights in which they are not part of the validator set.