[r3.5] fix: PoS dev mode — enable Fusaka (Fulu CL + Osaka EL) block production#21728
Merged
Merged
Conversation
…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>
taratorio
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #21646 to release/3.5.