Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fuzz tests that verify invariants #507

Open
maltekliemann opened this issue Mar 28, 2022 · 1 comment
Open

Add fuzz tests that verify invariants #507

maltekliemann opened this issue Mar 28, 2022 · 1 comment
Labels
p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement

Comments

@maltekliemann
Copy link
Contributor

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 maltekliemann added p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement labels Mar 28, 2022
@maltekliemann
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement
Projects
None yet
Development

No branches or pull requests

1 participant