-
Notifications
You must be signed in to change notification settings - Fork 193
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
Account's stETH
balance getting lower on 1 or 2 wei due to rounding down integer math
#442
Comments
stETH
balance getting lower on 1 or 2 wei due to rounded down integers
stETH
balance getting lower on 1 or 2 wei due to rounded down integersstETH
balance getting lower on 1 or 2 wei due to rounding down integer math
stETH
balance getting lower on 1 or 2 wei due to rounding down integer mathstETH
balance getting lower on 1 or 2 wei due to rounding down integer math
Possible explanation (made on the basis of the original statement by @skozin): Let's have the following designations:
Given that:
and
we may conclude:
or, simplifying finally:
thus, transferring Since While the current APR is 4%, after the Merge it might increase to as high as 8%, |
This issue is currently breaking collateralSwap and repayWithCollateral features on the aave protocol which have now been disabled on the decentralized interface for this very reason. Would love to see this resolved 👍 |
Hi, we just got the case : |
Yess |
We had been got already familiar with the 1 wei corner case before a protocol-wide regression test coverage was introduced. Since the integration tests adoption moment we have been discovering the possibility to face the 2 wei corner case. It happens due to the fact that
stETH
balance calculation depends on two integer divisions (each one has 1 wei "loss" at most).It should be addressed somehow in the future to prevent dealing with such peculiarities, especially for the upcoming Withdrawals support (Capella hardfork). Thus, I mark the issue with the "next-upgade" label here to catch up during a development stage.
The text was updated successfully, but these errors were encountered: