fix(l1): support Amsterdam block production in dev mode#6731
Conversation
The dev block producer fetched payloads via engine_getPayloadV5 (which returns the Block Access List) but submitted them via engine_newPayloadV4, which rejects the BAL field and -38005s on Amsterdam timestamps. Add an engine_new_payload_v5 method to EngineClient and route the producer to it when the payload carries a BAL, keeping V4 for pre-Amsterdam blocks.
|
l1-bal.json mirrors l1.json with amsterdamTime=0 (plus osaka/amsterdam blob schedules) so dev mode can produce EIP-7928 BAL-carrying blocks: ethrex --dev --network fixtures/genesis/l1-bal.json
Lines of code reportTotal lines added: Detailed view |
|
Smoke test: Before this fix, every slot failed: After: BAL-carrying Amsterdam blocks produced each slot, which also unblocks the |
🤖 Kimi Code ReviewReview of PR #6731 - Amsterdam (Block Access List) Support SummaryAdds support for the Amsterdam fork (EIP-7928) by implementing Code Review1.
|
🤖 Codex Code Review
Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
Greptile SummaryThis PR fixes Amsterdam block production in dev mode by routing payloads that carry a
Confidence Score: 4/5Safe to merge — the routing logic correctly fixes the Amsterdam block production failure, and the only gap is that engine_newPayloadV5 is not declared in the client's advertised capability list. The core fix (V4→V5 dispatch for BAL-carrying payloads) is correct and well-scoped. The EngineClient::capabilities() list was not updated to include engine_newPayloadV5, leaving the client's self-advertisement inconsistent with both the server's capabilities and its own runtime behavior. crates/networking/rpc/clients/auth/mod.rs — the capabilities() method needs engine_newPayloadV5 added.
|
| Filename | Overview |
|---|---|
| crates/blockchain/dev/block_producer.rs | Routes Amsterdam payloads (where block_access_list.is_some()) to the new engine_new_payload_v5 and pre-Amsterdam payloads to V4; refactors versioned hash computation out of the match arm. |
| crates/networking/rpc/clients/auth/mod.rs | Adds engine_new_payload_v5 method that wraps NewPayloadV5Request; capabilities() still omits engine_newPayloadV5 despite the client now using it. |
| fixtures/genesis/l1-bal.json | New Amsterdam-active genesis fixture (mirrors l1.json with amsterdamTime: 0 and osaka/amsterdam blob schedules) for testing BAL block production in dev mode. |
Sequence Diagram
sequenceDiagram
participant BP as BlockProducer (dev)
participant EE as ExecutionEngine (ethrex)
BP->>EE: engine_forkchoiceUpdatedV3(state, payloadAttrs)
EE-->>BP: "ForkChoiceResponse { payload_id }"
BP->>EE: engine_getPayloadV5(payload_id)
EE-->>BP: "ExecutionPayloadResponse { execution_payload, blobs_bundle }"
alt execution_payload.block_access_list is Some (Amsterdam+)
BP->>EE: engine_newPayloadV5(payload, versioned_hashes, parent_beacon_root)
else block_access_list is None (pre-Amsterdam)
BP->>EE: engine_newPayloadV4(payload, versioned_hashes, parent_beacon_root)
end
EE-->>BP: "PayloadStatus { latest_valid_hash }"
BP->>BP: "head_block_hash = latest_valid_hash"
Comments Outside Diff (1)
-
crates/networking/rpc/clients/auth/mod.rs, line 193-201 (link)engine_newPayloadV5missing from advertised capabilitiesThe
capabilities()list is sent to the peer duringengine_exchangeCapabilities. Any consensus client that gates on this list (or any future external consumer) will not seeengine_newPayloadV5advertised, even though the client now uses it for Amsterdam blocks. The server-side list inengine/mod.rsalready includesengine_newPayloadV5, so the client-side list is now out of sync.Prompt To Fix With AI
This is a comment left during a code review. Path: crates/networking/rpc/clients/auth/mod.rs Line: 193-201 Comment: **`engine_newPayloadV5` missing from advertised capabilities** The `capabilities()` list is sent to the peer during `engine_exchangeCapabilities`. Any consensus client that gates on this list (or any future external consumer) will not see `engine_newPayloadV5` advertised, even though the client now uses it for Amsterdam blocks. The server-side list in `engine/mod.rs` already includes `engine_newPayloadV5`, so the client-side list is now out of sync. How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
crates/networking/rpc/clients/auth/mod.rs:193-201
**`engine_newPayloadV5` missing from advertised capabilities**
The `capabilities()` list is sent to the peer during `engine_exchangeCapabilities`. Any consensus client that gates on this list (or any future external consumer) will not see `engine_newPayloadV5` advertised, even though the client now uses it for Amsterdam blocks. The server-side list in `engine/mod.rs` already includes `engine_newPayloadV5`, so the client-side list is now out of sync.
```suggestion
fn capabilities() -> Vec<String> {
vec![
"engine_exchangeCapabilities".to_owned(),
"engine_forkchoiceUpdatedV3".to_owned(),
"engine_getPayloadV4".to_owned(),
"engine_getPayloadV5".to_owned(),
"engine_newPayloadV4".to_owned(),
"engine_newPayloadV5".to_owned(),
]
}
```
Reviews (1): Last reviewed commit: "chore(l1): add Amsterdam-active dev gene..." | Re-trigger Greptile
🤖 Claude Code ReviewNow I have everything I need to write the review. PR Review: fix(l1): support Amsterdam block production in dev modeOverviewDev mode was fetching payloads via The fix is correct and targeted. A few issues below. Bug:
|
| Severity | Finding |
|---|---|
| Bug | engine_newPayloadV5 not in capabilities() |
| Bug (pre-existing) | execution_requests silently dropped; replicated into V5 |
| Minor | Log messages lost version number |
| Nit | Fork detection comment could be more explicit |
The core fix (routing BAL-carrying payloads to V5) is correct. The capabilities omission should be addressed before merge as it can break CL interoperability. The execution_requests issue is pre-existing but worth tracking.
Automated review by Claude (Anthropic) · sonnet · custom prompt
Dev mode fetched payloads via
engine_getPayloadV5(which returns the EIP-7928 Block Access List) but submitted them viaengine_newPayloadV4. V4 rejects any payload carrying ablock_access_listfield and returns-38005 Unsupported forkfor Amsterdam-timestamped blocks, so dev mode could not produce a single Amsterdam block.Added
engine_new_payload_v5toEngineClientincrates/networking/rpc/clients/auth/mod.rs. The BAL travels insideexecution_payload.block_access_list, so no extra argument is needed.block_producer.rsnow routes BAL-carrying payloads to V5 and falls back to V4 for pre-Amsterdam blocks.Discovered while verifying #6678 (BAL Prometheus metrics):
bal_*metrics were never populated because dev mode failed every slot withengine_newPayloadV4: block_access_list not allowed. After this fix, a dev node with an Amsterdam-active genesis produces blocks andbal_*metrics populate as expected.Genesis fixture
Also adds
fixtures/genesis/l1-bal.json, an Amsterdam-active dev genesis (mirrorsl1.jsonwithamsterdamTime: 0plus osaka/amsterdam blob schedules), so dev mode can produce BAL-carrying blocks out of the box:Test plan
cargo check -p ethrex-rpc -p ethrex-devbuilds cleanethrex --dev --network fixtures/genesis/l1-bal.json --metrics: previously failed every slot withengine_newPayloadV4: block_access_list not allowed; now produces Amsterdam blocks each slot