core, eth, params: merge geth v1.17.6 (v1.17.6 sync) - #2461
Conversation
A corrupted node should not create a bad block, but rather error out --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Blocks heavy in precompile calls (e.g. Aztec's proof settlement txs) spend most of their processing time on operations (ECMUL, pairings, KZG point evaluation, MODEXP) that the state prefetcher has already computed and thrown away. This PR adds a precompile result cache shared between the prefetcher and block processing (and the miner), following the JumpDestCache pattern. Note that cached precompiles are keyed by address and input, with entries partitioned by the active precompile set, so a fork that changes the behavior behind an address can never be served results from before it. --------- Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This PR aligns the `Cells` and `GetCells` message implementations with the spec: https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getcells-0x14 Previously, `GetCellsPacket` and `CellsPacket` embedded `GetCellsRequest` and `CellsResponse`. This caused them to be encoded as nested lists, which does not match the wire format defined by the spec. This PR inlines their fields to flatten the RLP layout of `Cells` and `GetCells`.
This PR implements the parallel block executor, with the execution pre-state derived from the block-level access list.
…abled (#35316) If snap sync v2 is re-enabled after a previous sync already completed and committed its pivot, the leftover journal is now discarded instead of resumed.
…he entries (#35439) ## Description Blob mode cache entries (the default until a CL advertises `engine_getBlobsV4` via `engine_exchangeCapabilities`) carry no cells, but `Cache.GetCells` treated any entry as a hit and served null cells from the empty custody set instead of falling back to the pool. Found via the EELS execute-blobs simulator (EIP-8070 `engine_getBlobsV4` tests), which never calls `engine_exchangeCapabilities`: null cells appeared intermittently depending on the race with the 1s top-K preload. With the fix the suite passes 139/139 (from 87/139 on master).
i didn't try to trigger the nil deref, but fixing it shouldn't be controversial
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
… (#35460) Calling a function `do` is fine in go, but when interacting with other languages, namely C, this clashes with a known keyword, which some compilers don't like.
Small fix to the parsing of the `slotNumber` in the genesis file. Found during hive testing.
This PR implements the BAL downloader. Once the Amsterdam fork is enabled, BALs are scheduled for download for BAL-eligible blocks. Unlike mandatory components such as block bodies, BALs are optional and are downloaded on a best-effort basis. If a block's essential components are ready for delivery before its BAL has been retrieved, the block will be delivered without the BAL.
…st (#35486) Completes the regular → execution gas rename from #35457. The constant now matches the EIP-8037 spec name `EXECUTION_PER_AUTH_BASE_COST`. Pure mechanical rename, no value change.
…35493) Since #35386 blocks are delivered without waiting for their access list, a reserved BAL task can outlive its block and hit the stale branch of `reserveHeaders`, which logs at error level — demote that case to debug. --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
|
@claude review |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Discovery RPC input validation, ambiguous payload-detail matching, and release toolchain inconsistencies remain unresolved.
Review effort: Balanced
Findings: 3
Open (5)
What changed in this PR
Completes the Bor sync with go-ethereum v1.17.6, incorporating upstream state, RPC, networking, tracing, storage, tooling, and release changes while keeping Amsterdam dormant.
Changes:
- Migrates state finalization APIs to
params.Rulesand updates Bor execution paths. - Adds upstream RPC, discovery, database, tracing, and client fixes.
- Updates release metadata, dependencies, fixtures, and deprecated network/configuration surfaces.
| File | Description |
|---|---|
version/version.go |
Bumps version to 1.17.6. |
triedb/pathdb/metrics.go |
Corrects a metric namespace. |
tests/state_test.go |
Adapts state-root calls to rules. |
tests/state_test_util.go |
Propagates fork rules through state tests. |
tests/block_test_util.go |
Adds slot handling and numeric base-fee comparison. |
rpc/websocket.go |
Reads WebSocket frames atomically. |
rpc/http.go |
Adds framed HTTP body reading. |
rpc/client_test.go |
Delays fault injection until handshake completion. |
params/bootnodes.go |
Removes Holesky discovery configuration. |
p2p/server.go |
Uses the shared discovery UDP connection. |
p2p/pipes/pipe.go |
Closes listeners after dial failure. |
p2p/discover/v5_udp_test.go |
Uses fallback UDP configuration. |
p2p/discover/common.go |
Exposes shared UDP connection support. |
miner/worker.go |
Adds payload-reversion metadata fields. |
miner/pipeline.go |
Supplies fork rules when deriving roots. |
miner/payload_building.go |
Retains receipts and construction details. |
metrics/runtimehistogram.go |
Fixes negative histogram maximum handling. |
metrics/metered_lru.go |
Adds a metered LRU cache. |
internal/web3ext/web3ext.go |
Updates debug RPC extensions. |
internal/ethapi/transaction_args.go |
Validates recipient-less blob/set-code calls. |
internal/ethapi/testdata/eth_getTransactionReceipt-with-logs.json |
Refreshes RPC fixture hashes. |
internal/ethapi/testdata/eth_getTransactionReceipt-state-sync-tx.json |
Refreshes state-sync receipt fixture. |
internal/ethapi/testdata/eth_getTransactionReceipt-normal-transfer-tx.json |
Refreshes transfer receipt fixture. |
internal/ethapi/testdata/eth_getTransactionReceipt-dynamic-tx-with-logs.json |
Refreshes dynamic-fee fixture. |
internal/ethapi/testdata/eth_getTransactionReceipt-create-contract-with-access-list.json |
Refreshes contract receipt fixture. |
internal/ethapi/testdata/eth_getTransactionReceipt-create-contract-tx.json |
Refreshes creation receipt fixture. |
internal/ethapi/testdata/eth_getTransactionByHash-with-logs.json |
Refreshes transaction lookup fixture. |
internal/ethapi/testdata/eth_getTransactionByHash-state-sync-tx.json |
Refreshes state-sync lookup fixture. |
internal/ethapi/testdata/eth_getTransactionByHash-normal-transfer-tx.json |
Refreshes transfer lookup fixture. |
internal/ethapi/testdata/eth_getTransactionByHash-dynamic-tx-with-logs.json |
Refreshes dynamic transaction fixture. |
internal/ethapi/testdata/eth_getTransactionByHash-create-contract-with-access-list.json |
Refreshes access-list lookup fixture. |
internal/ethapi/testdata/eth_getTransactionByHash-create-contract-tx.json |
Refreshes creation lookup fixture. |
internal/ethapi/testdata/eth_getTransactionByBlockHashAndIndex-state-sync-tx.json |
Refreshes indexed state-sync fixture. |
internal/ethapi/testdata/eth_getTransactionByBlockHashAndIndex-create-contract-with-access-list.json |
Refreshes indexed creation fixture. |
internal/ethapi/testdata/eth_getHeaderByNumber-tag-pending.json |
Expects null pending headers. |
internal/ethapi/testdata/eth_getHeaderByNumber-tag-latest.json |
Refreshes latest-header fixture. |
internal/ethapi/testdata/eth_getHeaderByNumber-number-latest-1.json |
Refreshes previous-header fixture. |
internal/ethapi/testdata/eth_getHeaderByNumber-number-1.json |
Refreshes numbered-header fixture. |
internal/ethapi/testdata/eth_getHeaderByNumber-number-0.json |
Refreshes genesis-header fixture. |
internal/ethapi/testdata/eth_getHeaderByHash-hash-latest.json |
Refreshes hash-header fixture. |
internal/ethapi/testdata/eth_getHeaderByHash-hash-latest-1.json |
Refreshes previous hash-header fixture. |
internal/ethapi/testdata/eth_getHeaderByHash-hash-1.json |
Refreshes numbered hash-header fixture. |
internal/ethapi/testdata/eth_getHeaderByHash-hash-0.json |
Refreshes genesis hash-header fixture. |
internal/ethapi/testdata/eth_getBlockReceipts-tag-pending.json |
Refreshes pending-receipts fixture. |
internal/ethapi/testdata/eth_getBlockReceipts-tag-latest.json |
Refreshes latest-receipts fixture. |
internal/ethapi/testdata/eth_getBlockReceipts-block-with-legacy-transfer-tx.json |
Refreshes legacy receipt fixture. |
internal/ethapi/testdata/eth_getBlockReceipts-block-with-legacy-contract-call-tx.json |
Refreshes contract-call receipt fixture. |
internal/ethapi/testdata/eth_getBlockReceipts-block-with-dynamic-fee-tx.json |
Refreshes dynamic-fee receipt fixture. |
internal/ethapi/testdata/eth_getBlockReceipts-block-with-contract-create-tx.json |
Refreshes creation receipt fixture. |
internal/ethapi/testdata/eth_getBlockReceipts-block-with-blob-tx.json |
Refreshes blob receipt fixture. |
internal/ethapi/testdata/eth_getBlockByNumber-tag-pending.json |
Refreshes pending-block fixture. |
internal/ethapi/testdata/eth_getBlockByNumber-tag-pending-fullTx.json |
Refreshes full pending-block fixture. |
internal/ethapi/testdata/eth_getBlockByNumber-tag-latest.json |
Refreshes latest-block fixture. |
internal/ethapi/testdata/eth_getBlockByNumber-number-1.json |
Refreshes numbered-block fixture. |
internal/ethapi/testdata/eth_getBlockByNumber-number-0.json |
Refreshes genesis-block fixture. |
internal/ethapi/testdata/eth_getBlockByHash-hash-latest.json |
Refreshes latest block-by-hash fixture. |
internal/ethapi/testdata/eth_getBlockByHash-hash-genesis.json |
Refreshes genesis block-by-hash fixture. |
internal/ethapi/testdata/eth_getBlockByHash-hash-1.json |
Refreshes numbered block-by-hash fixture. |
internal/ethapi/simulate.go |
Uses EVM rules during simulation finalization. |
internal/ethapi/override/override.go |
Updates override finalization and difficulty semantics. |
internal/ethapi/api.go |
Updates header tags, access lists, and debug finalization. |
internal/cli/server/config.go |
Retains ignored state-size configuration compatibility. |
internal/build/util.go |
Adds nonfatal command execution support. |
graphql/schema.go |
Exposes slot and block-access-list fields. |
graphql/graphql.go |
Resolves block access-list hashes. |
ethdb/memorydb/memorydb.go |
Distinguishes empty-key and range deletion. |
ethdb/dbtest/testsuite.go |
Tests empty-key batch deletion. |
ethclient/simulated/backend.go |
Installs required system contracts. |
ethclient/ethclient.go |
Validates withdrawals and missing transaction counts. |
ethclient/ethclient_test.go |
Adds system contracts to test genesis. |
eth/tracers/logger/logger_json.go |
Enforces trace limits for call frames. |
eth/tracers/js/tracer_test.go |
Updates execution-gas assertions. |
eth/tracers/internal/tracetest/supply_test.go |
Adds system contracts to supply tests. |
eth/tracers/internal/tracetest/selfdestruct_state_test.go |
Adds system contracts to tracer fixtures. |
eth/state_accessor.go |
Commits reconstructed state using rules. |
eth/protocols/snap/sync.go |
Supports proofless zero-origin ranges. |
eth/protocols/snap/handler.go |
Correctly aborts bounded storage queries. |
eth/protocols/eth/handler.go |
Updates network documentation. |
eth/gasestimator/gasestimator.go |
Returns exact reduced transfer gas. |
eth/filters/api.go |
Validates ranges beginning at genesis. |
eth/fetcher/tx_fetcher.go |
Clarifies transaction-size enforcement. |
eth/ethconfig/gen_config.go |
Removes state-size TOML wiring. |
eth/ethconfig/config.go |
Removes state-size runtime configuration. |
eth/catalyst/simulated_beacon.go |
Applies Bor’s block-based Amsterdam gate. |
eth/catalyst/queue.go |
Looks up local payload construction details. |
eth/catalyst/api_test.go |
Deploys required system contracts. |
eth/backend.go |
Removes state-size trie configuration. |
crypto/kzg4844/kzg4844_gokzg.go |
Adds Go KZG cell recovery. |
crypto/kzg4844/kzg4844_ckzg_nocgo.go |
Adds the unsupported no-CGO stub. |
crypto/kzg4844/kzg4844_ckzg_cgo.go |
Adds C KZG cell recovery. |
crypto/bn256/cloudflare/twist.go |
Preserves projective state during negation. |
crypto/bn256/cloudflare/bn256_test.go |
Tests negative G2 pairing behavior. |
core/vm/jump_table.go |
Renames regular gas to execution gas. |
core/vm/interpreter_test.go |
Supplies rules during finalization. |
core/vm/interface.go |
Changes StateDB finalization to accept rules. |
core/vm/instructions_test.go |
Updates execution-gas assertions. |
core/vm/gas_table_test.go |
Updates finalization rules in gas tests. |
core/vm/evm_precompile_cache_test.go |
Updates precompile gas assertions. |
core/vm/eips.go |
Uses execution-gas accounting. |
core/vm/dispatch_test.go |
Updates dispatch finalization and gas fields. |
core/vm/dispatch_bench_test.go |
Updates benchmark finalization rules. |
core/vm/contracts_fuzz_test.go |
Adapts precompile invocation signature. |
core/v2_witness_regen_test.go |
Propagates rules through witness regeneration. |
core/v2_serial_parity_gen_test.go |
Updates generated-state commits. |
core/v2_serial_parity_fuzz_test.go |
Updates parity root derivation. |
core/v2_selfdestruct_self_beneficiary_test.go |
Updates self-destruct test finalization. |
core/v2_pre_exec_system_call_test.go |
Updates pre-execution state commits. |
core/v2_metamorphic_parity_test.go |
Updates metamorphic parity finalization. |
core/v2_exist_nonce_test.go |
Updates nonce parity commits. |
core/v2_blockstm_test.go |
Updates BlockSTM test commits. |
core/v1_differential_test.go |
Updates V1 differential root handling. |
core/types/state_account.go |
Adds buffered slim-account RLP encoding. |
core/txpool/locals/journal.go |
Reports journal close failures. |
core/txpool/legacypool/list_test.go |
Updates txpool state finalization. |
core/tracing/gen_gas_change_reason_stringer.go |
Adds new gas-change reason strings. |
core/stateless.go |
Derives stateless roots using fork rules. |
core/state/witness_readset_test.go |
Updates witness fixture commits. |
core/state/witness_prewalk_test.go |
Updates prewalk fixture commits. |
core/state/v2_executor_differential_test.go |
Updates executor parity finalization. |
core/state/v2_differential_test.go |
Updates differential state commits. |
core/state/trie_prefetcher_test.go |
Updates prefetcher state commits. |
core/state/sync_test.go |
Updates state-sync fixture commits. |
core/state/statedb_hooked.go |
Passes rules through hooked finalization. |
core/state/statedb_hooked_test.go |
Updates hooked-state tests. |
core/state/statedb_fuzz_test.go |
Updates fuzzed finalization calls. |
core/state/state_test.go |
Updates state test commits. |
core/state/safe_base_test.go |
Updates flat-diff commits. |
core/state/reader_test.go |
Updates cache-reader fixture commits. |
core/state/parallel_statedb.go |
Adapts parallel StateDB finalization. |
core/state/parallel_statedb_coverage_test.go |
Updates parallel finalization coverage. |
core/state/parallel_read_equivalence_test.go |
Updates read-equivalence finalization. |
core/state/amsterdam_witness_skew_test.go |
Updates Amsterdam witness fixture commits. |
core/state_transition_test.go |
Updates Amsterdam gas expectations. |
core/state_processor_test.go |
Adds system contracts to processor tests. |
core/state_prefetcher.go |
Uses EVM rules for prefetched roots. |
core/state_prefetcher_intermediate_root_test.go |
Updates prefetch commit rules. |
core/rawdb/freezer.go |
Handles independent freezer group tails. |
core/rawdb/freezer_table.go |
Resets tables truncated below their tail. |
core/rawdb/database.go |
Propagates iterator errors. |
core/rawdb/chain_freezer.go |
Closes freezer after era DB failure. |
core/rawdb/accessors_chain_test.go |
Tests canonical ancient access-list lookup. |
core/parallel_state_processor.go |
Propagates rules through parallel execution. |
core/parallel_state_processor_hooks_parity_test.go |
Extends V2 hook parity coverage. |
core/parallel_state_processor_fork_parity_test.go |
Updates rules-based fork expectations. |
core/mainnet_witness_benchmark_test.go |
Updates benchmark root finalization. |
core/genesis_test.go |
Removes Holesky genesis coverage. |
core/gen_genesis.go |
Hex-encodes genesis slot numbers. |
core/forkid/forkid_test.go |
Removes Holesky fork-ID cases. |
core/filtermaps/map_renderer.go |
Handles chain-shortening reorgs. |
core/filtermaps/checkpoints.go |
Removes Holesky checkpoints. |
core/eth_transfer_logs_test.go |
Adds system contracts to transfer tests. |
core/chain_makers_test.go |
Adds system contracts to PoS chains. |
core/blockchain_test.go |
Updates commits and shared genesis allocation. |
core/block_validator.go |
Validates state roots using rules. |
consensus/misc/eip7997.go |
Removes the superseded factory transition. |
consensus/ethash/consensus.go |
Finalizes Ethash state with rules. |
consensus/clique/clique.go |
Finalizes Clique state with rules. |
consensus/bor/statesync_gas_budget_test.go |
Updates state-sync root calls. |
consensus/bor/statesync_execution_parity_test.go |
Updates state-sync parity commits. |
consensus/bor/statefull/processor.go |
Finalizes Bor calls with EVM rules. |
consensus/bor/bor.go |
Uses rules for Bor root derivation. |
consensus/bor/bor_test.go |
Updates Cancun commit rules. |
consensus/beacon/consensus.go |
Finalizes beacon state with rules. |
common/mclock/simclock.go |
Renames timer callback storage. |
common/lru/blob_lru_test.go |
Tests key-size accounting. |
cmd/utils/flags_legacy.go |
Retains a deprecated state-size flag. |
cmd/keeper/go.mod |
Updates indirect dependencies. |
cmd/geth/main.go |
Marks state-size flag deprecated. |
cmd/geth/consolecmd_test.go |
Moves console tests from Holesky to Hoodi. |
cmd/geth/config.go |
Accepts the deprecated config field. |
cmd/geth/chaincmd.go |
Removes Holesky history import selection. |
cmd/evm/testdata/evmrun/9.out.2.txt |
Relaxes timing output matching. |
cmd/evm/testdata/35/txs.json |
Adds an empty transaction fixture. |
cmd/evm/testdata/35/env.json |
Adds a missing-base-fee environment. |
cmd/evm/testdata/35/alloc.json |
Adds an empty allocation fixture. |
cmd/evm/t8n_test.go |
Tests missing post-London base fee. |
cmd/evm/staterunner.go |
Updates diagnostic root derivation. |
cmd/evm/runner.go |
Updates state dump commits. |
cmd/evm/main.go |
Updates dump root derivation. |
cmd/evm/internal/t8ntool/transition.go |
Updates transition allocation roots. |
cmd/devp2p/README.md |
Documents Hoodi and combined discovery. |
cmd/devp2p/nodesetcmd.go |
Removes Holesky node filtering. |
cmd/devp2p/main.go |
Adds shared discovery RPC serving. |
cmd/devp2p/discv5cmd.go |
Adds discovery-v5 RPC methods. |
cmd/devp2p/discv4cmd.go |
Refactors discovery-v4 RPC serving. |
cmd/blsync/main.go |
Removes Holesky CLI support. |
build/deb/ethereum/deb.install |
Installs relocated completion files. |
build/completions/zsh/_geth |
Adds zsh completion support. |
build/completions/bash/geth |
Adds bash completion support. |
beacon/params/networks.go |
Removes Holesky light-client configuration. |
beacon/params/checkpoint_holesky.hex |
Removes the Holesky checkpoint. |
accounts/abi/type.go |
Normalizes contract ABI types as addresses. |
accounts/abi/bind/v2/lib.go |
Ignores mismatched watched events. |
accounts/abi/bind/v2/lib_test.go |
Tests mismatched event handling. |
accounts/abi/abigen/source2.go.tpl |
Uses original ABI error names. |
accounts/abi/abigen/source.go.tpl |
Skips mismatched generated events. |
accounts/abi/abigen/bindv2_test.go |
Tests normalized error names. |
.gitea/workflows/release.yml |
Changes release build toolchains. |
.gitea/workflows/release-copr.yml |
Adds COPR release publishing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Beyond the inline findings, I also checked eth/catalyst/api.go's bad-block-recording path for NewPayload import failures (around lines 912-933): the locally-built block looked up by state root shares the same hash as the payload that failed to import in this flow, so recording it under that hash is not a distinct bug.
Extended reasoning...
This is the tail of a large (290-file, +8657/-3656) upstream go-ethereum v1.17.6 merge into Bor, touching EVM/VM internals, state processing, consensus, RPC, and P2P. Three confirmed bugs were already surfaced as inline findings (two of them compile-breaking: a stale StateDB.Commit call signature in tests/bor/helper.go, and a broken core/vm/gen_dispatch generator), which alone means a human still needs to look at this PR. I additionally examined eth/catalyst/api.go's bad-block-recording path on NewPayload failure for a hash-mismatch concern and confirmed the looked-up local block and the failing payload share the same hash in that flow, so it is not a separate issue worth raising.
Additional findings (outside the current diff — GitHub can't attach inline comments there):
-
🔴
tests/bor/helper.go— tests/bor/helper.go:310 still calls the old state.Commit(block, deleteEmptyObjects bool, noStorageWiping bool) signature, but this diff changes StateDB.Commit to Commit(rules params.Rules, block uint64) everywhere else. Building with theintegrationtag now fails to compile since the args (uint64, bool, bool) no longer match. Every test using buildNextBlock (32 call sites in tests/bor/*_test.go) is unbuildable. Fix: update this call to state.Commit(chain.Config().Rules(b.header.Number, false, b.header.Time), block.NumberU64()), matching the rest of the merge's translation of Commit call sites.Why this was flagged
tests/bor/helper.go:310 has
state.Commit(block.NumberU64(), chain.Config().IsEIP158(b.header.Number), false), calling *state.StateDB.Commit with (uint64, bool, bool). core/state/statedb.go changed StateDB.Commit's signature toCommit(rules params.Rules, block uint64) (common.Hash, error)(core/state/statedb.go:188 area per diff) as part of this v1.17.6 merge. helper.go carries the go:build integration tag and was not in this diff's changed-files list, so it was missed during the signature migration. Every other Commit call site in the repo (core/genesis.go, core/blockchain.go, eth/state_accessor.go, etc.) was updated to the new signature; this one was not. Anyone building/running the bor integration test suite (go build -tags integration ./tests/bor/...orgo test -tags integration ./tests/bor/...) gets a compile error, whereas on the base branch this compiled and ran fine.Verification: normal (test build regression). The diff changes
*state.StateDB.Committo a 2-argument signature: core/state/statedb.go:2522func (s *StateDB) Commit(rules params.Rules, block uint64) (common.Hash, error). tests/bor/helper.go:310 still invokes the old 3-argument form:root, err := state.Commit(block.NumberU64(), chain.Config().IsEIP158(b.header.Number), false), passing (uint64, bool,… -
🔴
core/vm/gen_dispatch/main.go— Maintainers who rungo generate ./core/vm/(per the//go:generate go run ./gen_dispatch/in core/vm/interpreter.go:19) get a regenerated interpreter_dispatch.go that fails to compile. This diff renames GasBudget/GasCosts fields RegularGas->ExecutionGas (and UsedRegularGas->UsedExecutionGas) everywhere, including the committed core/vm/interpreter_dispatch.go, but the code generator that produces that exact file, core/vm/gen_dispatch/main.go, still emitscontract.Gas.RegularGasanddynamicCost.RegularGas(lines 256, 259, 417, 420, 442, 445), fields that no longer exist. Fix: rename these template strings to ExecutionGas too, covering all 6 occurrences. build/ci.go's check_generate step (go generate ./...…Why this was flagged
…then diff) will also fail CI once run, since it wasn't part of this PR's per-batch
go build/go vettesting.The trigger is any
go generate ./core/vm/invocation, e.g. by a contributor adding/editing an opcode, or by build/ci.go's doCheckGenerate (build/ci.go:493-533) which runsgo generate ./...and fails the build if generated output differs from committed files. core/vm/gen_dispatch/main.go emits Go source referencingcontract.Gas.RegularGasanddynamicCost.RegularGas(lines 256,259,417,420,442,445), but GasBudget/GasCosts (core/vm/gascosts.go) were renamed to ExecutionGas by this diff, and the committed core/vm/interpreter_dispatch.go already uses ExecutionGas. Regenerating overwrites it with code that won't compile, and check_generate flags the mismatch either way. The PR's own testing notes only rango build ./.../go vet ./..., notgo generate, so this wasn't caught.Verification: normal. This diff renamed GasCosts/GasBudget fields RegularGas->ExecutionGas (core/vm/gascosts.go) and updated the committed generated file core/vm/interpreter_dispatch.go (now uses contract.Gas.ExecutionGas, e.g. lines 62-65, 320-386), but did NOT touch the generator core/vm/gen_dispatch/main.go (empty git diff --stat for that path). gen_dispatch/main.go still emits the old field names verbatim…
- tests/bor/helper.go (integration build tag): convert the remaining StateDB.Commit call to the params.Rules form (#35498). Behaviour-identical: IsEIP158 from the chain config, and IsCancun false as the old literal was. - core/vm/gen_dispatch: apply the RegularGas -> ExecutionGas rename (#35457) to Bor's dispatch generator. go generate now reproduces the committed interpreter_dispatch.go byte for byte. - miner/payload_building.go: restore the "Updated payload" log, lost when the merge dropped upstream's BAL-only balhash attribute. - miner/worker.go: drop the environment's revertedTxs/revertedIdx fields. Upstream fills them in its commitTransactions, which Bor's miner doesn't use; Bor's miner doesn't record bad-block details. - 15 test files: move the params import into the go-ethereum import group (goimports). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Addressed in c11cdaa:
The remaining inline findings are upstream verbatim and are answered on their threads. |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (61.65%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## upstream-merge-v1.17.4 #2461 +/- ##
==========================================================
+ Coverage 56.42% 56.62% +0.20%
==========================================================
Files 944 944
Lines 174836 175181 +345
==========================================================
+ Hits 98645 99194 +549
+ Misses 70158 69997 -161
+ Partials 6033 5990 -43
... and 23 files with indirect coverage changes
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Carries the #2346 and #2354 review fixes up the stack: the switch-dispatch EIP-8037 state-gas charge (f2fde26), bor's tuning on the pebble v1 path (0166dcc) and EIP-8246 self-destruct settlement in V2 (aac7dd0). Clean textual merge, one adjustment: #35318 on this branch changed Run's dynamic-gas charge to ChargeRegularOnly when there is no state cost and GasBudget.charge otherwise, so gen_dispatch emits that same form here instead of #2346's chargeRegular/chargeState pair, and no longer imports core/tracing. interpreter_dispatch.go is regenerated. TestDispatchDifferentialAmsterdam fails against this branch's previous generated file and passes on the new one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Carries the #2346 and #2354 review fixes up the stack: the switch-dispatch EIP-8037 state-gas charge (f2fde26, adjusted in d96fcc8), bor's tuning on the pebble v1 path (0166dcc) and EIP-8246 self-destruct settlement in V2 (aac7dd0). Three conflicts, all from this branch's RegularGas -> ExecutionGas rename (#35646): - core/vm/gen_dispatch/main.go: the fallback charge mirrors this branch's Run, ChargeExecutionOnly when there is no state cost, GasBudget.charge otherwise. - core/vm/interpreter_dispatch.go: regenerated from the generator. - core/vm/dispatch_test.go: the new stateGas field reads ExecutionGas. Adapted outside the conflicts for #35498, where StateDB takes params.Rules: TestFinaliseFastSelfDestructParity passes rules to Finalise, IntermediateRoot and Commit, and FinaliseFast's comment no longer refers to stateAccessList, since serial Finalise now selects finaliseAmsterdam from rules.IsAmsterdam. FinaliseFast keeps its bools, like CommitSnapshot. TestDispatchDifferentialAmsterdam fails against this branch's previous generated file and passes on the new one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Carries #2346's review follow-up (49aa12b, BlockSTM pre-execution through PreExecution) and its #2354 adaptation (ab0921f), via #2455 (c27e0f2). One conflict, in core/parallel_state_processor_fork_parity_test.go: kept this branch's IsEIP158 entry (it follows the params.Rules both paths pass, #35498) and took the new IsVerkle classification (the gate lives only in PreExecution). Adapted outside the conflict: this branch's #35458 removed the EIP-7997 factory insert from PreExecution, so the BlockSTM processors drop it along with serial and TestV2PreExecEIP7997Activation, added on #2354, has nothing left to check. It is removed here, and the v1.17.6 ledger's #35458 row says so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Both were raised in AI review and are upstream verbatim, so the port keeps them: a CREATE whose precheck fails under Amsterdam gets no tracer frame, and direct EVM.Create callers (vm/runtime.Create, i.e. cmd/evm) skip the precheck. Block processing is unaffected, since the state transition checks CanTransfer and the nonce ceiling itself. Recorded as needs-wiring rows pointing at POS-3738 so both are rechecked when Amsterdam is scheduled, as asked in PR review. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
754d732 to
ada1fc7
Compare
Brings in #2455's merge into the base (174b61b) so this PR's diff is only v1.17.6 again. GitHub rebased #2455 onto the base when #2354 merged, so its commits (b4a3d86, 89d2fd3, ada1fc7) are new copies of the ones this branch already contains via 754d732. A normal three-way merge re-applies the same #2455 hunks and conflicts wherever v1.17.6 changed them further. This merge keeps this branch's tree unchanged (-s ours), and that is the correct result. The merged base's tree equals ada1fc7, which differs from 754d732 (an ancestor of this branch) only in core/vm/gen_dispatch/main.go and core/vm/interpreter_dispatch.go, where the rebase restored #2346's RegularGas form. This branch needs its own form there (ExecutionGas, mirroring this branch's Run), which it already has. Nothing else in the base is missing here. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
c6b3c0c
into
upstream-merge-v1.17.4


Important
Status, 2026-10-01: #2345, #2346, #2354 and #2455 have all merged into
upstream-merge-v1.17.4, and this is the last open PR of the sync. It targets the base directly and is no longer part of a GitHub stack. The base was merged in with0348dbfcb, which keeps this branch's tree unchanged: GitHub had rebased #2455, so the base's #2455 commits are copies of ones this branch already has, and the only difference (the switch-dispatch generator) must stay in this branch's v1.17.6 form. The diff is v1.17.6 only again. Merge with a merge commit. Never rebase this branch (no "Update branch" with rebase); it carries upstream authors' commits. The notes below describe the earlier stacked layout.Reviewer guide — stacked PR 13 of 13. Part of the combined go-ethereum v1.17.4 + v1.17.5 + v1.17.6 upstream sync, which ships as one stable release. v1.17.6 joins it because upstream schedules the fork this work builds toward (Amsterdam, on Sepolia) in v1.17.6. Every PR in the stack merges into the base branch
upstream-merge-v1.17.4; that base merges intodeveloponce, at the very end — not per-PR.Merge-commit only — never squash. Squashing rewrites a branch's SHAs and breaks every PR stacked above it.
Review bottom-up: #2308, #2319, #2325, #2328, #2337, #2340, #2341, #2342 and #2343 have merged into the base. The open stack is #2345 → #2346 → #2354 → #2455 → this PR. Start at #2345 — every PR above inherits it, so reviewing top-down means re-reviewing.
Review fixes and cascade, 2026-09-29: three findings from Marcello's review were fixed where the code lives and cascaded up. #2346
f2fde2692: the switch-dispatch interpreter (runSwitch, on by default on mainnet BPs) now charges EIP-8037 state gas likeRun, with a new Amsterdam differential test. #23540166dcc9d: the pebble v1 path, which every existing bor database opens through, keeps bor's tuning and metrics (new databases use pebble v2; upgrade command tracked in POS-3746). #2354aac7dd01e: V2'sFinaliseFastsettles EIP-8246 self-destructs like serialFinalise. Cascade: #2354256e10c39→ #2455d96fcc81b→ #2461440ed1ac4; at #2455 and #2461 the generator mirrors that level's renamedRunhelpers. All dormant until Amsterdam except the pebble fix, which restores today's behaviour for existing nodes. Every hop builds and passes the dispatch/V2/parity tests, and the witness regeneration tests pass on the top of the chain.Review follow-up and cascade, 2026-09-30: per Jerry's review on #2346 (
49aa12b54), both BlockSTM processors run their pre-execution system calls through the serialPreExecutioninstead of inline copies (no behaviour change there). Merged up into #2354 (ab0921f62), that closes a dormant gap: #35285 had moved the EIP-7997 factory insert (first Amsterdam block) intoPreExecution, which V1/V2 didn't call, so they would have disagreed with serial on the root at activation;TestV2PreExecEIP7997Activationcovers it. Cascade: #2354ab0921f62→ #2455c27e0f29a→ #2461caeadc89b, where upstream's #35458 drops the insert altogether and the test goes with it. Every hop builds and passes the parity/V2 tests, and the witness regeneration tests pass on the top of the chain.Expected-red / flaky checks (not code blockers):
Quality metrics(diffguard — skipped by team decision; it also mis-scopes across a stacked diff), andcodecov/patch(a diff that is mostly upstream code carried in verbatim). The kurtosis stateless leg's producer-rotation threshold flakes ondeveloptoo and is re-run by hand. Full per-batch conflict-resolution reasoning is indocs/upstream-merges/.Summary
Merges go-ethereum v1.17.6 into bor, completing the upstream sync. 136
upstream first-parent commits (
v1.17.5..v1.17.6), taken in 8 batches, eacha single GPG-signed merge commit whose resolution reasoning is recorded in the
ledger. The upstream
v1.17.6tag (3d84c6b2e) is an ancestor of this branch.v1.17.5..v1.17.6, 136 first-parent commitsv1.17.6AmsterdamBlockstays nil on every Bor surfaceDocumentation lives in
docs/upstream-merges/v1.17.6/:plan.md— batch boundaries, deviations, ordered follow-upsledger.md— every resolution, per batch, with reasoningfork-register.md— per-fork/EIP dormancy verificationneeds-wiring.md— everything intentionally not adopted, and what adopting it would takeConsensus-relevant items, for the reviewer's attention first
StateDBtakesparams.Rulesinstead of fork booleans (#35498, batch 3a).Finalise,IntermediateRoot,CommitandCommitWithUpdatechangedsignature, and every Bor call site was translated so behaviour is unchanged:
config.Rules(num, false, time), withisMergefalse because Bor'sDifficultycan be nil;trueuse the EVM's rules, since EIP-158 isactive from genesis on every Bor network;
falsebecomesparams.Rules{}.CommitSnapshotkeeps its bool signature.TestV2ForkParityclassifies thenew rules field.
Receipt hashing in a pipeline (#35738, batch 7) — declined. Upstream hashes
the receipt trie and bloom in a background pipeline fed from inside the tx
loop, and the validator reads its digest. On Bor,
Finalizeappends thepost-Madhugiri state-sync receipt after the loop, and BlockSTM assembles its
own results. A pipeline fed only from the loop would miss receipts and fail the
receipt-root check on import.
needs-wiring.mdrecords what a safe port needs.Gas tracing rework (#35646, batch 6) — tracing only, gas results unchanged.
The new
UsedExecutionGas -= coldCostin the EIP-2929 CALL variant (live onBor) doesn't reach
GasBudget.Used()or any receipt, block or refundcomputation. PIP-88 twin lockstep:
gasSLoadPIP88andmakeGasSStoreFuncPIP88are unchanged, their upstream originals are unchangedin the batch, and every shared function's divergence from upstream is the same
before and after the merge.
A Bor tracing bug was caught and fixed (batch 6). After #35646,
muxTracerexposes only the V2 depth hooks. Bor's
WrapStateSyncHookswrapped the V1fields only, so
debug_traceBlock*withmuxTraceron a block with astate-sync tx failed ("incorrect number of top-level calls"). The wrapper now
exposes V2 and forwards via the
Emit*helpers, keeping a per-frame entry-gasstack for V1 inner tracers.
Fork validation in the state transition (#35588, batch 5) — adopted.
Access-list, blob and set-code messages are rejected before their fork. Bor's
state-sync and system calls never go through
preCheck, and canonical historycan't contain those types before their fork.
Amsterdam on Sepolia (#35734, batch 7) — declined. Bor's Sepolia config has
no time-based forks.
BorMainnetChainConfig,AmoyChainConfig, the chainpresets and the genesis JSON are untouched.
Every upstream fork and EIP in this range is merged dormant, verified in
fork-register.md. Nothing here changes block production or validation onmainnet or Amoy.
Declined, each recorded in
needs-wiring.md(#35386, #35423 replay half), engine-API BAL fixes (#35580, #35664).
#35766), eth/71 and eth/72 devp2p tests, snap v2 (#35705), #35533 parallel
snap/1 processing.
ExecuteConfigtracer activation (#35512), otel spans in the parallelprocessor (#35693, which adds
ctxtoApplyTransaction).writeBlockWithState(#35595 write half — thefunction also writes witnesses), the downloader scheduling rework (#35680) and
download/snap progress metrics (#35678, #35689).
not wired.
Ported by hand
abortand #35722 zero-origin no-proof accountrange, both into Bor's pre-split
eth/protocols/snapSyncer.TestSyncFullAccountRangeNoProoffails without #35722's fix.Executed tests
Per batch (all eight):
go build ./...,go vet ./...— only the two known lock-copy findings.make testcontract (-p 1 -short, excludingcmd/) — 144/144 packagesat every batch after its fixes.
TestBorHardforkPrecompileContinuity,TestReinforceMultiClientPreCompilesTest,TestV2ForkParity,TestPDBMethodParity— pass.TestV2WitnessRegeneration{AllBlocks,PipelinedSRCAllBlocks,PipelinedSRCChained},non-short — pass; Chained 222/222.
Milestone:
BOR_BLOCKSTM_TEST=1 TestV2BlockSTMAllBlocks— 238/241 blocks consistent, thesame as the baseline.
cmd/tier — only the known pre-existing failures:cmd/geth(5),cmd/evm(4) and thecmd/devp2p/internal/ethtestnil-BorConfigpanic.Local kurtosis devnet (kurtosis-pos
v1.4.2, CI's pipeline-e2e topology:3 witness-producing validators with pipelined import, 2 stateless validators,
no-witness / witness / stateless RPC nodes, and a released
0xpolygon/bor:latestbaseline, plus anvil L1 and bridge/tx spammers), about1,980 blocks:
finalized hashes agree on all 9 nodes (including the released baseline),
milestones, checkpoints and state-sync advancing;
lastStateIdidentical onevery full-state node.
HF, fast-forward sync (124-block gap caught up in 16 s), milestone latency
under injected latency, load with producer rotation, extreme-latency
recovery, the L1→L2 bridge and producer restart recovery. The rotation
threshold flaked once, as it does on
develop, and passed on re-run.root mismatches, ~880 witnesses per witness-producing node, the pipeline
self-gated off on stateless nodes, and the released baseline agrees.
debug_traceBlockByNumberwithmuxTracerandcallTraceron a state-syncblock: no errors, output byte-identical to the released image.
Accepted-red CI checks
Quality metrics(diffguard) — skipped by team decision.Rollout notes
gate is flipped and no activation height is set.
a stack that ships as a single stable release.
eth_getHeaderByNumber("pending")returnsnull, as does asafe/finalizedtag that can't be resolved (#35627).nullfor a required non-pointer argument returnsinvalid argument N(#35576).
debug_traceCall's block parameter is optional and defaults tolatest(#35583).
eth_call/eth_estimateGasreject blob or set-code arguments withoutto(#35695).block before the matching fork now fail (#35588).
eth_createAccessListno longer rejects up front a call with moreauthorizations than its gas covers (#35698).
go mod tidyraising the indirects itrequires. The Go toolchain stays at 1.26.8.
version/version.gonow reads1.17.6/stable, matching upstream'srelease commit.
Follow-ups owed on top of this milestone
Amsterdam's on real Bor configs. The EIP-8037 tests now run with
Bor = nil;core/vm/eip8038_test.go,core/eip7708_test.goandcore/eip8246_test.goare held back;
TestEstimateGasAmsterdamand the Amsterdam subtest ofTestCreateAccessListAuthorizationGasare skipped ("missing head header").state.Error()check before sealing (upstream#35427); also on
develop.🤖 Generated with Claude Code