-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prune pending deposits from the deposit cache post-Electra #14829
Prune pending deposits from the deposit cache post-Electra #14829
Conversation
Rationale: As deposit_fetcher.go contains all pruning logics, it would be better to separate its interest into fetcher/inserter/pruner.
Electra will be looking to release in the next month , we would like to get this into the release depending on your findings with testing. we mostlikely will be releasing in testnet without this feature yet. |
@james-prysm Yes, I agree to the point. Then I'll keep this PR in draft mode. |
please let us know if you think this will be ready in the next few weeks for mainnet 🙏 thank you for the work |
@james-prysm
|
@syjn99 we're going to try to get this into the release for testnet actually. I'll see if I can pick up where you left off here if nishant had any comments. he'll review tomorrow and we'll get this merged. please let us know if there are any concerns. |
@syjn99 are you able to let me push changes directly to your branch? otherwise I can create a fork of your branch I think or start a new one with acknowledgment to you |
@james-prysm Just pushed a commit that applies all reviews from team! |
@syjn99 looks like unit tests are failing Test_executePostFinalizationTasks I think that's a test I added in the past, it's an electra state 😓 so I guess it shouldn't have that log anymore |
@james-prysm How about adding test cases, and separating them into pre-Electra and post-Electra? |
I think this is silly... there's a bug I think, because it's a fake state eth1depositindex of 0 is the same as the requests start index of 0 I don't think that's possible in any other state but probably a bug with this test not using realistic values.
|
}) | ||
t.Run("deposit requests started", func(t *testing.T) { | ||
require.NoError(t, headState.SetEth1DepositIndex(1)) | ||
require.NoError(t, headState.SetDepositRequestsStartIndex(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this is still too much copy paste, just wanted to fix it
@syjn99 Thanks for your work on this ! it was a great catch, we'll get this merged |
What type of PR is this?
Feature
What does this PR do? Why is it needed?
After conversations with @james-prysm and @nisdas at #14698, this will be a first step to mitigate an memory effect after post-Electra.
This PR adds
DepositPruner
, which prunes all pending deposits and proofs after Electra(when legacy eth1 polling is deprecated). a7eae66 moves some functions indeposit_fetcher.go
intodeposit_pruner.go
, as it seems more suitable.deposit_pruner.go
might contain pruning whole deposits, but I thought that it could be handled at other PRs.I did some experiment on local devnet. I spammed deposit transactions at those devnets, and here's the metrics:
Normally, after post-Electra, pending deposits are not pruned at all, it leads pending deposits to infinitely grow like the panel shows.
When this PR applied, pending deposits are pruned(Red line) at every finalization event. (You can see the config file for kurtosis at this gist.)
depositsnapshot
doesn't affect the consensus after post-Electra at all.Which issues(s) does this PR fix?
Resolves #14698
Other notes for review
Adding
DepositPruner
could be quite controversial, so feedbacks are welcomed.Acknowledgements