fix: restrict builder deposits to payload builders - #9621
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the builder deposit request processing to ignore deposits with unexpected withdrawal credential prefixes by validating them with isBuilderWithdrawalCredential. It also replaces the use of withdrawalCredentials[0] or BUILDER_WITHDRAWAL_PREFIX with PAYLOAD_BUILDER_VERSION when registering a builder or setting up test states. Corresponding unit tests have been added and updated to verify that both new builder requests and top-ups are dropped if they have invalid withdrawal credential prefixes. There are no review comments, so I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
see ethereum/consensus-specs#5439 Builder deposit requests are ignored unless the withdrawal credentials start with `BUILDER_WITHDRAWAL_PREFIX`. Accepted new builders are registered with `PAYLOAD_BUILDER_VERSION`. Checks: - `pnpm exec biome check packages/state-transition/src/block/processBuilderDepositRequest.ts packages/state-transition/test/unit/block/processBuilderDepositRequest.test.ts packages/state-transition/test/unit/block/processBuilderExitRequest.test.ts` - `pnpm --filter @lodestar/state-transition check-types` > This PR was written primarily by Codex.
see ethereum/consensus-specs#5439 Builder deposit requests are ignored unless the withdrawal credentials start with `BUILDER_WITHDRAWAL_PREFIX`. Accepted new builders are registered with `PAYLOAD_BUILDER_VERSION`. Checks: - `pnpm exec biome check packages/state-transition/src/block/processBuilderDepositRequest.ts packages/state-transition/test/unit/block/processBuilderDepositRequest.test.ts packages/state-transition/test/unit/block/processBuilderExitRequest.test.ts` - `pnpm --filter @lodestar/state-transition check-types` > This PR was written primarily by Codex.
see ethereum/consensus-specs#5439
Builder deposit requests are ignored unless the withdrawal credentials start with
BUILDER_WITHDRAWAL_PREFIX. Accepted new builders are registered withPAYLOAD_BUILDER_VERSION.Checks:
pnpm exec biome check packages/state-transition/src/block/processBuilderDepositRequest.ts packages/state-transition/test/unit/block/processBuilderDepositRequest.test.ts packages/state-transition/test/unit/block/processBuilderExitRequest.test.tspnpm --filter @lodestar/state-transition check-types