Curriculum·Graduate·G201
Invariant Thinking
The Nomad bridge, 1 August 2022. In a routine upgrade Nomad set the value of a trusted message root to 0x00.
Start with lesson 14 lessons · about 2 hours · free account to read in full
Lesson 1 opens on
The Nomad bridge, 1 August 2022
In a routine contract upgrade Nomad set the value of a trusted message root to 0x00. On this bridge a message that has never been proven also carries a root of zero, so after the change every unproven message matched the trusted value and was treated as already proven. The Replica contract's process() function could be called directly, without the earlier prove() step, and it accepted any message.
The lessons
- G201-01What an invariant is, and the one Nomad turned offDefine a protocol invariant as a statement that must be true after every transaction, and give three examples for a system you useabout 30 min · opens on The Nomad bridge, 1 August 2022
- G201-02Writing the invariants of a position you holdWrite the full set of invariants for a leveraged position you hold, not just the one that is obviousabout 30 min · opens on Aave v2 CRV bad debt, 22 November 2022
- G201-03The invariant enforced by an assumptionIdentify the hidden assumption behind an invariant, such as an honest validator set or an uncompromised key thresholdabout 31 min · opens on The Harmony Horizon bridge, 23 June 2022
- G201-04The invariant nobody wrote downExplain why the most dangerous invariant is the one no one stated, using the Parity library freezeabout 30 min · opens on The Parity multisig library freeze, 6 November 2017
