The Queue Is the Protocol: Finding DeFi Liveness Bugs with Stateful Invariants
summary
An Origin Protocol vault passes 18 safety invariants yet a matured withdrawal claim reverts because a fail-on-revert guard asks the vault itself "is claimable" and skips testing the failing path. Safety checks miss liveness: the action must remain possible. Fix uses a ghost-variable model that tracks owed liquidity, adds explicit liveness invariants, and runs a simulated bank run after every call to catch hidden exits. AI-generated handlers tend to add the same unsafe guard.
AI-written summary · about
