-
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
Pruning pending deposits in deposit cache for post-Electra(EIP-6110) #14698
Comments
Thanks for this we haven't had time to review the findings but appreciate it, will be looking into this soon. |
I think i'm misunderstanding something here( will be reaching out to team members who have worked on EIP4881) but eth1_deposit_index should be updated here (
|
https://eips.ethereum.org/EIPS/eip-6110#eth1data-poll-deprecation In post-Electra, |
correct, but we won't need the deposit cache afterwards 🤔 once everything is transitioned to the 6110 process.
I was stuck on this comment. I initially thought it was around this transition period that we maybe missed something, but if its post electra it should just be deprecated and eventually removed. |
Indeed, IMO we don't need deposit snapshot except for this API( |
💎 Issue
Background
As EIP-6110 is included in the upcoming upgrade(Electra), deposits are directly bridged from EL to CL via execution requests(EIP-7685). Thus, the implementation of EIP-4881 only matters when providing a deposit snapshot via RPC(Let me know if there's other things to consider).
When a block producer builds a block,
packDepositsAndAttestations
will always return empty deposit list from local when EIP-6110 is fully enabled. Returning early can help for reducing the total building time in this case, so I already worked on this issue at PR #14697.Description
However, I found we need to tackle with the pending deposits which are managed by
DepositCache
. (NOTE: This pending deposit is not equal to the new field introduced in Electra) Aseth1_deposit_index
will be anchored to the certain value,insertFinalizedDeposits
will never finalize the included deposits after EIP-6110 applied.prysm/beacon-chain/blockchain/process_block_helpers.go
Lines 538 to 575 in 30a136f
As a result, pending deposits are never pruned by this logic, leading the heap memory allocation will never be freed. I had investigated this issue for a couple of hours, but it seems there needs a way to notify the "finalized" deposit index to the deposit cache to prune the pending deposits.
prysm/beacon-chain/core/electra/deposits.go
Lines 591 to 614 in 30a136f
My first idea is following. Feedback is welcomed.
The text was updated successfully, but these errors were encountered: