Skip to content

Builder deposits optimisation#9311

Open
pawanjay176 wants to merge 11 commits into
sigp:unstablefrom
pawanjay176:builder-deposits-optimisation
Open

Builder deposits optimisation#9311
pawanjay176 wants to merge 11 commits into
sigp:unstablefrom
pawanjay176:builder-deposits-optimisation

Conversation

@pawanjay176
Copy link
Copy Markdown
Member

Issue Addressed

N/A

Proposed Changes

Adds an OnboardBuildersCache to the beacon chain to pre-verify and cache builder deposits. Caching is important in 2 places:

  1. onboard_builders_from_pending_deposits is 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
Deposits Capital Cached Batch verify (without cache)
10K $26M ~35ms ~520ms
50K $130M ~175ms ~2.6s
96K $250M 271ms (measured) ~5s
100K $260M ~285ms ~5.2s
  1. Post fork, process_operations may 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 them

The cache is threaded to both the per_slot_processing for the first case and per_block_processing for the second case.

Additional Info

tested with the following kurtosis config:

participants_matrix:
     el:
       - el_type: geth
         el_image: ethpandaops/geth:bal-devnet-6
         el_extra_params: ["--rpc.txfeecap=0", "--rpc.gascap=0"]
     cl:
       - cl_type: lighthouse
         cl_image: lighthouse-local:latest
         cl_log_level: debug
         count: 2
       - cl_type: prysm
         cl_image: ethpandaops/prysm-beacon-chain:glamsterdam-devnet-3-deposits
         count: 2
network_params:
  gloas_fork_epoch: 1
  withdrawal_type: "0x01"
  validator_balance: 40000
  gas_limit: 5000000000
  genesis_gaslimit: 5000000000

additional_services:
  - dora
  - assertoor

assertoor_params:
  image: ethpandaops/assertoor:master
  run_stability_check: false
  run_block_proposal_check: false
  tests:
    - file: "https://raw.githubusercontent.com/ethpandaops/assertoor/refs/heads/master/playbooks/gloas-dev/builder-deposit-spam.yaml"
      config:
        batchSize: 256
        pendingBatches: 16 # 8192 deposits per block
        # totalDeposits: 96214
        totalDeposits: 262140
        skipForkActivationCheck: true

dora_params:
  image: ethpandaops/dora:master⏎

@pawanjay176 pawanjay176 added work-in-progress PR is a work-in-progress optimization Something to make Lighthouse run more efficiently. gloas labels May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas optimization Something to make Lighthouse run more efficiently. work-in-progress PR is a work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant