Skip to content
New issue

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

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

Already on GitHub? # to your account

Volatile gasLimit for _submit() method #499

Closed
TheDZhon opened this issue Jan 18, 2023 · 3 comments · Fixed by #500 or #482
Closed

Volatile gasLimit for _submit() method #499

TheDZhon opened this issue Jan 18, 2023 · 3 comments · Fixed by #500 or #482
Assignees
Labels
next-upgrade Things to pickup for the next protocol upgrade

Comments

@TheDZhon
Copy link
Contributor

Context
For the _submit() transactions, the estimated gas limit is not correct sometimes.
The problem was introduced with the Merge-ready protocol upgrade.
On average, every 8th transaction is reverted

Purpose
The difference appears due to the condition within the calculateCurrentStakeLimit() method of the StakeLimitUtils library.
Depending on the block.number and with the same state, the gas consumption changes when condition is met, imposing additional 80 gas.

Solution
The possible solution to overcome the issue is to make the method gas consumption constant with respect to the current block.number (if the same state invariant is preserved)

@TheDZhon TheDZhon added the next-upgrade Things to pickup for the next protocol upgrade label Jan 18, 2023
@TheDZhon TheDZhon self-assigned this Jan 18, 2023
@TheDZhon TheDZhon linked a pull request Jan 30, 2023 that will close this issue
@TheDZhon TheDZhon linked a pull request Jan 31, 2023 that will close this issue
@TheDZhon
Copy link
Contributor Author

TheDZhon commented Mar 1, 2023

Fixed in #500

@TheDZhon TheDZhon closed this as completed Mar 1, 2023
@TheDZhon
Copy link
Contributor Author

TheDZhon commented Apr 6, 2023

Decided to re-open because V2 isn't deployed on mainnet yet

@TheDZhon TheDZhon reopened this Apr 6, 2023
@TheDZhon
Copy link
Contributor Author

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
next-upgrade Things to pickup for the next protocol upgrade
Projects
None yet
1 participant