Skip to content

Include execution requests in produced block#14326

Merged
domiwei merged 3 commits into
mainfrom
bugfix/missing_execution_request_produce_block
Mar 31, 2025
Merged

Include execution requests in produced block#14326
domiwei merged 3 commits into
mainfrom
bugfix/missing_execution_request_produce_block

Conversation

@domiwei

@domiwei domiwei commented Mar 27, 2025

Copy link
Copy Markdown
Member

@domiwei domiwei requested a review from Copilot March 27, 2025 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the GetAssembledBlock API to include execution requests in the returned bundle and propagates the changes through client interfaces, mocks, and related block production code.

  • Updated function signatures and return values to include an execution requests bundle.
  • Propagated the new return type across client interfaces, mocks, and block production handling.
  • Added a new setter and JSON field for execution requests in beacon block types.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
turbo/execution/eth1/eth1_chain_reader/chain_reader.go Updated GetAssembledBlock signature to include an execution requests bundle.
cl/phase1/execution_client/interface.go Updated interface to propagate the new bundle return type.
cl/phase1/execution_client/execution_engine_mock.go Modified mocks to support the new signature.
cl/phase1/execution_client/execution_client_direct.go Updated direct client signature accordingly.
cl/cltypes/beacon_block_blinded.go Added setter for execution requests to the blinded beacon body.
cl/beacon/handler/block_production.go Integrated execution requests bundle in block production logic.
cl/beacon/builder/types.go Added a JSON field for execution requests in the execution header message.
Comments suppressed due to low confidence (1)

turbo/execution/eth1/eth1_chain_reader/chain_reader.go:417

  • The return type for the execution requests bundle uses 'types2.RequestsBundle', which is inconsistent with the 'typesproto.RequestsBundle' used in other parts of the code. Please verify and update to use a consistent type across the codebase.
func (c ChainReaderWriterEth1) GetAssembledBlock(id uint64) (*cltypes.Eth1Block, *engine_types.BlobsBundleV1, *types2.RequestsBundle, *big.Int, error) {

Comment thread cl/beacon/handler/block_production.go Outdated
log.Error("BlockProduction: Failed to decode withdrawal request", "err", err)
}
case types.ConsolidationRequestType:
if err := beaconBody.ExecutionRequests.Consolidations.DecodeSSZ(requestData, int(stateVersion)); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no "already exists" check here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. I missed check & log here. Thanks

@yperbasis yperbasis linked an issue Mar 28, 2025 that may be closed by this pull request
@domiwei domiwei merged commit a593226 into main Mar 31, 2025
@domiwei domiwei deleted the bugfix/missing_execution_request_produce_block branch March 31, 2025 06:40
@yperbasis

Copy link
Copy Markdown
Member

@domiwei please cherry-pick to release/3.0

@yperbasis yperbasis added this to the 3.0.1 milestone Apr 1, 2025
@yperbasis yperbasis removed this from the 3.0.1 milestone Apr 2, 2025
yperbasis added a commit that referenced this pull request Mar 18, 2026
…requests (#14337)

Verify that EIP-7685 execution requests (withdrawal requests via the
EIP-7002 system contract) survive the full block production round-trip:
build → assemble → validate → extend chain.

- Enhance TestEngineApiBuiltBlockWithWithdrawalRequest to verify request
  contents (source address, validator pubkey, amount), not just presence.
- Add TestAssembleBlockWithWithdrawalRequest that exercises
  ChainReaderWriterEth1.GetAssembledBlock — the interface Caplin uses in
  production, and the code path fixed by PR #14326 for issue #14319.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yperbasis added a commit that referenced this pull request Mar 18, 2026
Test produceBeaconBody against a real Erigon execution layer: submit a
withdrawal request to the EIP-7002 system contract, then have Caplin's
actual block production code call ForkChoiceUpdate, GetAssembledBlock,
and decode execution requests into the beacon body. Verified to fail
when the PR #14326 fix is reverted.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 20, 2026
)

## Summary
- Enhance `TestEngineApiBuiltBlockWithWithdrawalRequest` to verify
execution request **contents** (source address, validator pubkey,
amount), not just presence
- Add `TestAssembleBlockWithWithdrawalRequest` exercising
`ChainReaderWriterEth1.GetAssembledBlock` — the interface Caplin uses in
production (the code path fixed by PR #14326)
- Add `TestCaplinBlockProductionWithWithdrawalRequest` where **real
Caplin code** (`produceBeaconBody`) drives block production against a
real Erigon EL: submits a withdrawal request to the EIP-7002 system
contract, then Caplin calls `ForkChoiceUpdate` → `GetAssembledBlock` →
decodes execution requests into the beacon body

All three tests use real EL code (no mocks for the execution layer). The
Caplin-driven test is verified to fail when the PR #14326 fix is
reverted.

Closes #14337

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Caplin loses EIP-7685 requests when publishing produced blocks

4 participants