-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: deposit_v4 with cheaper depositTopUp #2102
Draft
86667
wants to merge
6
commits into
main
Choose a base branch
from
1991-incorrect-estimation-and-high-gas-costs-on-first-call-to-deposittopupdeposit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: deposit_v4 with cheaper depositTopUp #2102
86667
wants to merge
6
commits into
main
from
1991-incorrect-estimation-and-high-gas-costs-on-first-call-to-deposittopupdeposit
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86667
force-pushed
the
1991-incorrect-estimation-and-high-gas-costs-on-first-call-to-deposittopupdeposit
branch
2 times, most recently
from
January 7, 2025 11:41
6911fa3
to
58da64d
Compare
Bencher Report
Click to view all benchmark results
|
* build(deps): bump foundry-compilers from 0.12.8 to 0.12.9 (#2096) Bumps [foundry-compilers](https://github.com/foundry-rs/compilers) from 0.12.8 to 0.12.9. - [Changelog](https://github.com/foundry-rs/compilers/blob/main/CHANGELOG.md) - [Commits](foundry-rs/compilers@v0.12.8...v0.12.9) --- updated-dependencies: - dependency-name: foundry-compilers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: remove _stakerKeys from deposit contract * fix: use onlyControlAddress() --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
86667
force-pushed
the
1991-incorrect-estimation-and-high-gas-costs-on-first-call-to-deposittopupdeposit
branch
from
January 8, 2025 17:13
0128502
to
bfd580a
Compare
86667
force-pushed
the
1991-incorrect-estimation-and-high-gas-costs-on-first-call-to-deposittopupdeposit
branch
from
January 8, 2025 18:05
bfd580a
to
a73922a
Compare
86667
force-pushed
the
1991-incorrect-estimation-and-high-gas-costs-on-first-call-to-deposittopupdeposit
branch
from
January 9, 2025 09:17
44900a5
to
575142b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Work done by
updateLatestComputedEpoch()
within functions called by delegators, iedepositTopUp()
,unstake()
andwithdraw()
is expensive in some circumstances, ie when a deposit has occurred and one or more epochs passed since. This is because the new staker key is written to future committees.This work aims to remove costly writes to
_committee[]
from the above functions and instead have all writes done indeposit()
. To achieve this i've changed how_committee
works slightly such that we only write to_committee[]
if there are changes and do not copy data if data hasnt changed.Results
Before
deposit owner1: Gas used 410503
Rolling ahead 2 epochs
deposit owner2: Gas used 644369
Rolling ahead 1 epochs
1st top up owner 1: Gas used 179666
1st top up owner 2: Gas used 16149
Rolling ahead 2 epochs
2nd top up owner 1: Gas used 273779
2nd top up owner 2: Gas used 16158
After
deposit owner1: Gas used 334749
Rolling ahead 2 epochs
deposit owner2: Gas used 446585
Rolling ahead 1 epochs
1st top up owner 1: Gas used 14174
1st top up owner 2: Gas used 14174
Rolling ahead 2 epochs
2nd top up owner 1: Gas used 13987
2nd top up owner 2: Gas used 13990