Builder deposits optimisation#9311
Open
pawanjay176 wants to merge 11 commits into
Open
Conversation
This file contains hidden or 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
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.
Issue Addressed
N/A
Proposed Changes
Adds an
OnboardBuildersCacheto the beacon chain to pre-verify and cache builder deposits. Caching is important in 2 places:onboard_builders_from_pending_depositsis a fork transition function that scales with the number of pending deposits. Under worst case, the pending deposits queue can be dos'd with a number of 1eth deposits to make nodes do more work verifying it at the fork boundary. Even though the pending_deposits queue is effectively capped by the gas limit, this cache makes even a theoretic attack ineffective by doing the full verification in miliseconds instead of seconds.Some numbers claude cooked up
process_operationsmay need to verify all builder deposits in the hot path. the engine api currently allows max 8192 deposit requests to be sent for block production, so in worst case, we may need to verify 8192 signatures during block processing. The deposits we need to process are received in the payload envelope ~6 seconds into the slot. we process these deposits when a new beacon block that builds on the payload arrives ~3 seconds into the next slot. So we have a lot of time to verify these signatures before we actually need to process themThe cache is threaded to both the
per_slot_processingfor the first case andper_block_processingfor the second case.Additional Info
tested with the following kurtosis config: