Skip to content

[r3.5] fix: PoS dev mode — enable Fusaka (Fulu CL + Osaka EL) block production#21728

Merged
yperbasis merged 1 commit into
release/3.5from
cherry-pick-21646-to-release-3.5
Jun 12, 2026
Merged

[r3.5] fix: PoS dev mode — enable Fusaka (Fulu CL + Osaka EL) block production#21728
yperbasis merged 1 commit into
release/3.5from
cherry-pick-21646-to-release-3.5

Conversation

@yperbasis

Copy link
Copy Markdown
Member

Cherry-pick of #21646 to release/3.5.

…on (#21646)

## Summary

`--chain dev` couldn't produce blocks past genesis. Two bugs, plus a
builder cleanup found while addressing review:

- **Beacon API routes not registered** — dev mode set
`BeaconAPIRouter.Active=true` but never enabled endpoint groups
(`Beacon`, `Node`, `Validator`, `Config`, `Events`). The embedded dev
validator polls `/eth/v1/beacon/genesis` which returned 404, deadlocking
block production.

- **CL/EL fork mismatch: Prague/Osaka not activated, system contracts
missing** — the CL ran Fulu (epoch 0) but the EL had `PragueTime=nil`
and `OsakaTime=nil`. Pre-Prague EL headers carry no `requestsHash`,
while the CL reconstructs the header with `SHA256("")` = `e3b0c442…`
over the (empty) execution-requests list, so every produced block was
rejected with "mismatching hash" (`cl/cltypes/eth1_block.go`).
Activating Prague in turn requires the system-contract predeploys in the
dev genesis alloc.

- **Dead `requestsHash` override in the builder removed** —
`execution/builder/exec.go` re-derived `header.RequestsHash` after
`AssembleBlock`, but on a discarded header copy: the final block is
rebuilt from `current.Header` in `finishBlock`, which
`merge.FinalizeAndAssemble` already stamps with `outRequests.Hash()`
(`empty.RequestsHash` for empty request sets). An earlier revision of
this PR changed the dead write from `common.Hash{}` to
`empty.RequestsHash`; it is now deleted outright, leaving
`FinalizeAndAssemble` as the single source of truth. Verified dead by
running the new regression test against the old zero-hash code (passes)
and against zero-hash corruption injected into the live `merge.go` path
(fails with "invalid block hash").

The dev genesis is now a faithful Cancun+Prague genesis and lives in the
genesis layer:

- All five system contracts are predeployed via `allocs/dev.json`
(copied verbatim from `allocs/hoodi.json`): EIP-6110 deposit contract
(with `DepositContract` set in the chain config — fixes the
`ParseDepositLogs` WARN on every block), EIP-4788 beacon roots
(otherwise a silent no-op with Cancun at genesis), EIP-2935 history
storage, EIP-7002 withdrawal requests, EIP-7251 consolidation requests.
- Fork times (Shanghai/Cancun/Prague/Osaka at 0), TTD=0 and the deposit
contract address moved from `SetEthConfig` into
`DeveloperGenesisBlock()`; the remaining Caplin/beacon-genesis setup is
extracted into `setDevnetEthConfig`, leaving the `SetEthConfig` switch
case at one line.
- `TestEngineApiBuiltBlockEmptyRequestsHash` pins the requests hash of
an empty-request Prague block end to end (FCU → getPayload → newPayload
→ canonical header via RPC).

Dev mode now runs full Fusaka: Fulu on CL, Osaka on EL.

Note: the dev genesis hash changes (new predeploys in the alloc) — wipe
existing `--chain dev` datadirs.

## Test plan

- [x] `erigon --chain dev --dev.slot-time 2` produces Fulu/Osaka blocks
at 2s intervals
- [x] Transactions confirmed on-chain (ETH transfers, contract
deployment)
- [x] No `ParseDepositLogs` WARNs; EIP-4788 ring buffer populated
(`eth_getStorageAt` of slot `timestamp % 8191` returns the block
timestamp); block `requestsHash` is `e3b0c442…`
- [x] `TestEngineApiBuiltBlockEmptyRequestsHash` fails on injected
live-path corruption, passes otherwise
- [ ] CI passes

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
@yperbasis yperbasis added this to the 3.5.0 milestone Jun 10, 2026
@yperbasis yperbasis requested a review from taratorio June 10, 2026 13:01
@yperbasis yperbasis enabled auto-merge (squash) June 10, 2026 13:01
@yperbasis yperbasis merged commit 9f3ed1d into release/3.5 Jun 12, 2026
89 checks passed
@yperbasis yperbasis deleted the cherry-pick-21646-to-release-3.5 branch June 12, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants