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

Balancer withdrawal fuzzing test #1791

Open
sparrowDom opened this issue Aug 28, 2023 · 0 comments
Open

Balancer withdrawal fuzzing test #1791

sparrowDom opened this issue Aug 28, 2023 · 0 comments
Labels
contracts Works related to contracts OETH OETH related things

Comments

@sparrowDom
Copy link
Member

This is the main PR for creating a Balancer Metapool strategy. And when withdrawing from the strategy, the strategy contract withdraws funds from the Balancer Pool. We've identified an issue where the Balancer pool would under-deliver the funds requested by the exit pool request.

For that reason we leave the exit pool's request for min amount of tokens empty and only specify min amounts of tokens in the encoded user data request. As described in the linked issue above, if min expected token arrays on withdrawal are populated in both places the transaction reverts in some cases.

To mitigate the issue further, we also overshoot the required withdrawal amounts by 2 wei so that 1 WEI rounding error from Balancer doesn't revert the strategy's withdrawal transaction.

We would like to confirm that withdrawing rETH and stETH with different values don't cause the withdraw transaction to reverts. Withdrawing stETH could potentially be another source of problems since we are withdrawing wstETH from the pool and unwrapping it. Multiple rounding errors (Balancer pool + unwrapping) could cause larger than 2 WEI rounding error and revert the transaction.

We have some fork tests for withdrawing from wstETH pool and rETH pool. These are tests with hand-picked values, and if we could convert those to proper fuzzing tests we'd gain a lot greater amount of certainty that no combination of values would cause our transactions to revert.

@sparrowDom sparrowDom added contracts Works related to contracts OETH OETH related things labels Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Works related to contracts OETH OETH related things
Projects
None yet
Development

No branches or pull requests

1 participant