Skip to content

core, eth, trie: merge geth v1.17.0 (v1.17.4 sync, milestone 2/6) - #2319

Draft
pratikspatil024 wants to merge 245 commits into
ppatil-upstream-v1.16.9from
ppatil-upstream-v1.17.0
Draft

core, eth, trie: merge geth v1.17.0 (v1.17.4 sync, milestone 2/6)#2319
pratikspatil024 wants to merge 245 commits into
ppatil-upstream-v1.16.9from
ppatil-upstream-v1.17.0

Conversation

@pratikspatil024

Copy link
Copy Markdown
Member

Summary

Milestone 2/6 of the Bor ← go-ethereum v1.17.4 upstream sync: merges
go-ethereum v1.17.0 (upstream range v1.16.9-tip → v1.17.0 stable,
0cf3d3ba4) into Bor across 12 review-sized merge batches (~20 upstream
first-parent commits each) plus one standalone go-verkle-removal commit and a
milestone-chores commit.

Stacked on #2308 (v1.16.9, milestone 1/6). Base is ppatil-upstream-v1.16.9
for now; it retargets to upstream-merge-v1.17.4 when #2308 merges.

⚠️ Merge, never squash. Every batch is a real 2-parent merge commit so the
merge base advances and upstream history/authorship is preserved. Squash-merging
this PR (or any PR below it in the stack) rewrites SHAs and breaks every stacked
PR above it. Use a merge commit.

What landed

Most of v1.17.0 is bugfix/tooling/test sweeps that adopted cleanly. The
consensus-relevant decisions, per-batch, are in
docs/upstream-merges/v1.17.4/ledger.md; fork decisions in fork-register.md;
the deferred backlog (with adopt-steps) in needs-wiring.md.

  • No fork/EIP activated. Every v1.17.0 fork/EIP surface is merged dormant
    on Bor networks (EIP-8024 ExtraEips-only; Verkle gate nil). No precompile-set,
    gas-schedule, or activation-block change on any Bor preset. params.Rules.ChainID
    retained (declined upstream removal) to satisfy Bor's precompile-parity guard.
  • Adopted (consensus-relevant): crypto/keccak vendoring (#33323); eip4844
    latestBlobConfig(BlobConfig,error) keeping Bor's block-based gating + no-config
    return 0; opKeccak256 Keccak256Cache adapted to upstream's hasher; trienode-history
    (#32621/#33551/#33584) + NodeFullValueCheckpoint (#32727), both dormant by default;
    eth_getProofs-for-history; callTracer log index (goldens regenerated preserving Bor's
    0x1010 fee logs); pathdb history-index mutex combined with upstream's iterator
    refactor; trie decode CountValues error check; freezer fd-leak fix.
  • go-verkle scaffolding removed (mirrors upstream #33461; kept the dormant Verkle
    gate + binary-tree + stateless.Witness).
  • Deferred / declined (reverted to Bor HEAD, tracked in needs-wiring.md with
    adopt-steps — nothing dropped silently): the state code-read metrics line, core/vm
    write-protection + selfdestruct cluster, OpenTelemetry line (#33452/#33484/#33521/#33780;
    Bor has its own server-side OTel), delayed-p2p-decoding (#33835), EraE format (#32157),
    syncModer, slow-block stats, tx-announcement validation, snap-sync locking, legacypool
    alloc, --miner.maxblobs. These clash with Bor divergences (BlockSTM state, SafePool,
    ExcludeStateSyncReceipt, TD-in-DB, forked downloader, per-fork signer chain).
  • Milestone chores: regenerated eth/ethconfig/gen_config.go (TrienodeHistory +
    NodeFullValueCheckpoint + NoSnapServing TOML); exempted DumpBinTrieLeaves in the
    StateDB↔ParallelStateDB parity guard.

Executed tests

Beyond the standard CI gates:

  • go build ./... — clean. go vet ./... — clean except two pre-existing
    //nolint:govet copylocks (identical to develop). go mod tidy — no drift
    (this milestone adds no dependencies).
  • Full go test ./... — green after fixing the only two merge artifacts it
    surfaced (ethclient rpc.NewServer signature; internal/ethapi blockTimestamp
    goldens). Remaining failures are pre-existing and byte-identical to develop
    (VEBLOP miner nil-deref on non-Bor-network test harnesses in cmd/geth/cmd/devp2p/ethtest;
    t8n golden drift; a core/vm interrupt-race flake).
  • make test-integration (-tags integration ./tests/...) — pass, zero failures,
    including the tests/bor consensus e2e suite (621s).
  • govulncheck ./... — no merge-introduced vulnerabilities (3 called vulns are all
    pre-existing/develop-inherent dependency/toolchain versions).

Not run in-session (operator/CI release gates): diffguard mutation, kurtosis devnet,
and the devnet→testnet soak ladder. Kurtosis marginal value is low here — tests/bor
(consensus e2e) is green and the only observed panics are non-Bor-network paths.

Rollout notes

  • Not consensus-affecting on Bor networks. No fork activated, no precompile/gas/
    activation-height change; all adopted features either dormant-by-default or
    non-consensus (tooling/RPC/metrics/tests). Deferred upstream features were reverted
    to Bor HEAD.
  • Backward-compatible; no coordinated upgrade required for this milestone.
  • Operator-visible additions: blockTimestamp field on eth_getTransactionBy* RPC
    responses (additive); download progress-bar behavior; HTTP/2 JSON-RPC.
  • Follow-ups for the team (pre-existing, outside this sync): nil-guard the VEBLOP miner
    timeout (miner/worker.go:774) so non-Bor-network tests stop panicking; dependency
    bumps (x/text→v0.39.0, cascade develop's x/crypto v0.52.0, Go→1.26.5).

🤖 Generated with Claude Code

fjl and others added 30 commits November 4, 2025 13:28
Because the map iteration is unstable, we need to order logs by tx index
and keep the same order with receipts and their logs, so we can still
get the same `LogsHash` across runs.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
The version check incorrectly used `&&` instead of `||`, causing
versions like v1.0.x through v1.4.x to be allowed when they should be
rejected. These versions don't support EIP-712 signing which was
introduced in firmware v1.5.0.
Removes an unnecessary todo. This case is handled, the comment was an
artifact from Kev's refactor
…r (#33098)

failed in 32bit:

```
--- FAIL: TestDecodeSingleCorruptedData (0.00s)
panic: runtime error: slice bounds out of range [:-1501805520] [recovered, repanicked]

goroutine 38872 [running]:
testing.tRunner.func1.2({0x838db20, 0xa355620})
	/opt/actions-runner/_work/_tool/go/1.25.3/x64/src/testing/testing.go:1872 +0x29b
testing.tRunner.func1()
	/opt/actions-runner/_work/_tool/go/1.25.3/x64/src/testing/testing.go:1875 +0x414
panic({0x838db20, 0xa355620})
	/opt/actions-runner/_work/_tool/go/1.25.3/x64/src/runtime/panic.go:783 +0x103
github.com/ethereum/go-ethereum/triedb/pathdb.decodeSingle({0x9e57500, 0x1432, 0x1432}, 0x0)
	/opt/actions-runner/_work/go-ethereum/go-ethereum/triedb/pathdb/history_trienode.go:399 +0x18d6
github.com/ethereum/go-ethereum/triedb/pathdb.TestDecodeSingleCorruptedData(0xa2db9e8)
	/opt/actions-runner/_work/go-ethereum/go-ethereum/triedb/pathdb/history_trienode_test.go:698 +0x180
testing.tRunner(0xa2db9e8, 0x83c86e8)
	/opt/actions-runner/_work/_tool/go/1.25.3/x64/src/testing/testing.go:1934 +0x114
created by testing.(*T).Run in goroutine 1
	/opt/actions-runner/_work/_tool/go/1.25.3/x64/src/testing/testing.go:1997 +0x4b4
FAIL	github.com/ethereum/go-ethereum/triedb/pathdb	41.453s
?   	github.com/ethereum/go-ethereum/version	[no test files]
FAIL
```

Found in
https://github.com/ethereum/go-ethereum/actions/runs/18912701345/job/53990136071?pr=33052
- Replace hardcoded DigestLength 
- Add hash length validation
Rollups may want to use these to dynamically adjust blobs posted after
BPO forks.
The periodic sealing loop failed to reset its timer when sealBlock
returned an error, causing the timer to never fire again and effectively
halting block production in developer periodic mode after the first
failure. This is a bug because the loop relies on the timer to trigger
subsequent sealing attempts, and transient errors (e.g., pool races or
chain rewinds) should not permanently stop the loop. The change moves
timer.Reset after the sealing attempt unconditionally, ensuring the loop
continues ticking and retrying even when sealing fails, which matches
how other periodic timers in the codebase behave and preserves forward
progress.
[powdr](github.com/powdr-labs/powdr) has tested keeper in their womir
system and managed to get it to work. This PR adds wasm as a keeper
target. There's another plan by the zkevm team to support wasm with wasi
as well, so these PR adds both targets.

These currently uses the `example` tag, as there is no precompile
intefrace defined for either target yet. Nonetheless, this is useful for
testing these zkvms so it makes sense to support these experimental
targets already.
While updating to latest Geth, I noticed `OnCodeChangeV2` was not
properly handled in `SelfDestruct/6780`, this PR fixes this and bring a
unit test. Let me know if it's deemed more approriate to merge the tests
with the other one.
Context from Cloudflare blog:
https://blog.cloudflare.com/go-and-enhance-your-calm/#reading-bodies-in-go-can-be-unintuitive

We were able to reproduce the same issue discussed by Cloudflare in
their recent blog post above using the `ethclient`.
Add BlobTxs flag to filter.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Add nil check before calling tx.Type() to prevent panic when transaction
is not found.
The iterator loop in findTxInBlockBody returned the outer-scoped err
when iter.Err() was non-nil, which could incorrectly propagate a nil or
stale error and hide actual RLP decoding issues. This patch returns
iter.Err() as intended by the rlp list iterator API, matching
established patterns elsewhere in the codebase and improving diagnostics
when encountering malformed transaction entries.
…3186)

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
…T, and move the transition tree to its own package (#32445)

This is broken off of #31730 to only focus on testing networks that
start with verkle at genesis.

The PR has seen a lot of work since its creation, and it now targets
creating and re-executing tests for a binary tree testnet without the
transition (so it starts at genesis). The transition tree has been moved
to its own package. It also replaces verkle with the binary tree for
this specific application.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Show the actual gas used in the block limit error so RPC clients see
useful numbers.
Fixes a potential panic in `randomDuration` when `min == max` by
handling the edge case explicitly.
`StateDB` lacks recording functionality, so it has been replaced with
`tractStateDB` and advanced
fjl and others added 22 commits February 14, 2026 00:00
…#33835)

This changes the p2p protocol handlers to delay message decoding. It's
the first part of a larger change that will delay decoding all the way
through message processing. For responses, we delay the decoding until
it is confirmed that the response matches an active request and does not
exceed its limits.

In order to make this work, all messages have been changed to use
rlp.RawList instead of a slice of the decoded item type. For block
bodies specifically, the decoding has been delayed all the way until
after verification of the response hash.

The role of p2p/tracker.Tracker changes significantly in this PR. The
Tracker's original purpose was to maintain metrics about requests and
responses in the peer-to-peer protocols. Each protocol maintained a
single global Tracker instance. As of this change, the Tracker is now
always active (regardless of metrics collection), and there is a
separate instance of it for each peer. Whenever a response arrives, it
is first verified that a request exists for it in the tracker. The
tracker is also the place where limits are kept.
This prevents orphaned spans from appearing in traces.
Defensively check parent's base fee before using it for calculations.
This PR adds initial OpenTelemetry tracing to the Engine API, focusing
on engine_newPayload*.

```
jsonrpc.engine/newPayloadV4 
|  |- engine.newPayload  [block.number, block.hash, tx.count]
|     |- core.blockchain.InsertBlockWithoutSetHead
|        |- bc.processor.Process
|        |  |- core.ApplyTransactionWithEVM  [tx.hash, tx.index]
|        |  |- core.ApplyTransactionWithEVM  [tx.hash, tx.index]
|        |  |- ...  (one per transaction)
|        |  |- core.postExecution
|        |- bc.validator.ValidateState
```

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Regenerate gen_config.go for TrienodeHistory + NodeFullValueCheckpoint
TOML marshaling (+ sync NoSnapServing); exempt DumpBinTrieLeaves in the
StateDB/ParallelStateDB parity check; commit the v1.17.4-sync tracking docs.
Adapt TestBlockReceiptsPreservesCanonicalFlag to Bor's rpc.NewServer
signature; regenerate eth_getTransactionBy* goldens for the adopted
blockTimestamp field (state-sync-tx fixtures preserved).
@socket-security

socket-security Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​grafana/​pyroscope-go@​v1.4.199100100100100

View full report

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.75668% with 1261 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.24%. Comparing base (5f1acde) to head (b598953).

Files with missing lines Patch % Lines
core/state/database_history.go 0.00% 114 Missing ⚠️
ethclient/gethclient/gen_callframe_json.go 0.00% 85 Missing ⚠️
eth/catalyst/api.go 0.00% 75 Missing ⚠️
core/txpool/blobpool/blobpool.go 45.60% 66 Missing and 2 partials ⚠️
internal/debug/pyroscope.go 0.00% 53 Missing ⚠️
ethclient/gethclient/gethclient.go 0.00% 48 Missing ⚠️
trie/bintrie/trie.go 17.24% 47 Missing and 1 partial ⚠️
trie/bintrie/internal_node.go 18.96% 38 Missing and 9 partials ⚠️
crypto/keccak/sha3.go 67.17% 34 Missing and 9 partials ⚠️
ethclient/gethclient/gen_calllog_json.go 0.00% 43 Missing ⚠️
... and 103 more

❌ Your patch check has failed because the patch coverage (38.75%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           ppatil-upstream-v1.16.9    #2319      +/-   ##
===========================================================
+ Coverage                    54.21%   54.24%   +0.02%     
===========================================================
  Files                          908      912       +4     
  Lines                       162245   164111    +1866     
===========================================================
+ Hits                         87966    89015    +1049     
- Misses                       68842    69540     +698     
- Partials                      5437     5556     +119     
Files with missing lines Coverage Δ
accounts/accounts.go 100.00% <100.00%> (ø)
accounts/keystore/keystore.go 77.01% <100.00%> (+0.14%) ⬆️
beacon/light/canonical.go 67.60% <100.00%> (+1.42%) ⬆️
beacon/light/sync/head_sync.go 75.89% <100.00%> (+0.21%) ⬆️
beacon/params/config.go 42.46% <100.00%> (-0.59%) ⬇️
beacon/types/beacon_block.go 55.95% <100.00%> (ø)
common/bitutil/bitutil.go 94.38% <100.00%> (-0.70%) ⬇️
common/size.go 100.00% <100.00%> (ø)
core/blockchain.go 63.10% <100.00%> (+0.02%) ⬆️
core/blockchain_insert.go 87.64% <ø> (+10.41%) ⬆️
... and 154 more

... and 32 files with indirect coverage changes

Files with missing lines Coverage Δ
accounts/accounts.go 100.00% <100.00%> (ø)
accounts/keystore/keystore.go 77.01% <100.00%> (+0.14%) ⬆️
beacon/light/canonical.go 67.60% <100.00%> (+1.42%) ⬆️
beacon/light/sync/head_sync.go 75.89% <100.00%> (+0.21%) ⬆️
beacon/params/config.go 42.46% <100.00%> (-0.59%) ⬇️
beacon/types/beacon_block.go 55.95% <100.00%> (ø)
common/bitutil/bitutil.go 94.38% <100.00%> (-0.70%) ⬇️
common/size.go 100.00% <100.00%> (ø)
core/blockchain.go 63.10% <100.00%> (+0.02%) ⬆️
core/blockchain_insert.go 87.64% <ø> (+10.41%) ⬆️
... and 154 more

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Develop-drift cascade: carries develop's #2347 (Kurtosis e2e and
stateless-e2e on every PR base) and #2333 (complete witnesses under
BlockSTM v2) one hop further up the stack.

Clean at this hop; this branch still predates upstream #34106.
The develop-drift cascade brought in #2333's prewalk and read-set tests,
which call newTrieReader with the verkle point-cache argument develop still
has. Upstream dropped that parameter within the v1.17.0 range, so the calls
carry one argument too many from this branch upward and the core/state test
package no longer typechecks. Same two-line adaptation the merge into
ppatil-upstream-v1.17.2 already carried; this branch and the one above it
were missed.

The reason they were missed is worth recording, because the failure mode is
easy to repeat: the cascade's lower hops were verified with go build, and
go build does not compile test files. Nothing was wrong with the merge — it
was clean and the production tree built — but a test package that cannot
typecheck fails both the lint and unit-tests jobs, which is exactly what CI
reported. go vet ./... catches this and go build ./... never will.

Verified: build clean; full-tree go vet clean apart from the two
pre-existing lock-copy findings in core/parallel_state_processor.go and
trie/secure_trie.go; make lint reports 0 issues; all seven of #2333's
prewalk and read-set tests pass.
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.