-
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( |
@syjn99 If you are interested to tackle this what we can simply do is to check if the if state.Eth1DepositIndex >= state.DepositRequestsStartIndex {
// Prune all deposit proofs in cache
// Prune all pending deposits in cache Ultimately we should also pause deposit log processing once this threshold is hit as that is what leads to all the pending deposits being stored in our cache. But it requires more thought on how to disable that cleanly as its tied up with many things in our execution service.
We ultimately want to remove all the deposit log processing logic so there isn't any benefit to adding in a feed here as it will utimately also be removed after electra. |
@nisdas Thank you for your comment. I wonder whether Do we have to return error(like "not supported") if it is post-Electra? If not, what number do we have to return for Also, as you mentioned, there are some parts like rpc packacge that relies on the execution service, so removing the service could be a heavy work. I'm glad to tackle this issue in any way. A starting point of this issue is to add a new function for pruning all things in cache, like prysm/beacon-chain/blockchain/process_block_helpers.go Lines 553 to 592 in 5d6a406
|
The deposit snaphot api will be deprecated after electra is transitioned. Like most of the other things such as eth1data voting and deposit log processing it would be deprecated the same way. Clients could still be theoretically support providing snapshots even though it is no longer needed. We can leave it on for now |
Thanks! It seems much clear. Can I tackle this? I'd first add a function for pruning caches in post-Electra. |
Please do so, I have assigned it to you |
💎 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: