zeitgeist icon indicating copy to clipboard operation
zeitgeist copied to clipboard

Add fuzz tests that verify invariants

Open maltekliemann opened this issue 2 years ago • 1 comments

To guarantee that certain security-critical invariants are maintained, we should add tests that fuzz our pallets and check if certain invariants remain intact (for example, the total weight of a CPMM pool is always close to 1).

maltekliemann avatar Mar 28 '22 15:03 maltekliemann

To elaborate: Testing something like "If a user join and exits a pool and exits it with the same amount, the balance should not change" (see p. 8 of https://github.com/balancer-labs/balancer-core/blob/master/Trail%20of%20Bits%20Full%20Audit.pdf) doesn't really make sense with a couple of singular values, which are unlikely to discover rounding errors or provide a reliable esimate for the (hopefully negligible) change in balance. But fuzzing these types of problems might be the correct approach.

maltekliemann avatar Mar 28 '22 16:03 maltekliemann