core, eth, trie: merge geth v1.17.0 (v1.17.4 sync, milestone 2/6) - #2319
Draft
pratikspatil024 wants to merge 245 commits into
Draft
core, eth, trie: merge geth v1.17.0 (v1.17.4 sync, milestone 2/6)#2319pratikspatil024 wants to merge 245 commits into
pratikspatil024 wants to merge 245 commits into
Conversation
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
…#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).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Codecov Report❌ Patch coverage is ❌ 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@@ 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
... and 32 files with indirect coverage changes
🚀 New features to boost your workflow:
|
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.
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.
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.0stable,0cf3d3ba4) into Bor across 12 review-sized merge batches (~20 upstreamfirst-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.9for now; it retargets to
upstream-merge-v1.17.4when #2308 merges.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 infork-register.md;the deferred backlog (with adopt-steps) in
needs-wiring.md.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.ChainIDretained (declined upstream removal) to satisfy Bor's precompile-parity guard.
crypto/keccakvendoring (#33323); eip4844latestBlobConfig→(BlobConfig,error)keeping Bor's block-based gating + no-configreturn 0;opKeccak256Keccak256Cache 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
0x1010fee logs); pathdb history-index mutex combined with upstream's iteratorrefactor; trie decode
CountValueserror check; freezer fd-leak fix.gate + binary-tree +
stateless.Witness).needs-wiring.mdwithadopt-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).eth/ethconfig/gen_config.go(TrienodeHistory+NodeFullValueCheckpoint+NoSnapServingTOML); exemptedDumpBinTrieLeavesin theStateDB↔ParallelStateDB parity guard.
Executed tests
Beyond the standard CI gates:
go build ./...— clean.go vet ./...— clean except two pre-existing//nolint:govetcopylocks (identical todevelop).go mod tidy— no drift(this milestone adds no dependencies).
go test ./...— green after fixing the only two merge artifacts itsurfaced (
ethclientrpc.NewServersignature;internal/ethapiblockTimestampgoldens). 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/vminterrupt-race flake).make test-integration(-tags integration ./tests/...) — pass, zero failures,including the
tests/borconsensus e2e suite (621s).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
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.
blockTimestampfield oneth_getTransactionBy*RPCresponses (additive); download progress-bar behavior; HTTP/2 JSON-RPC.
timeout (
miner/worker.go:774) so non-Bor-network tests stop panicking; dependencybumps (x/text→v0.39.0, cascade
develop's x/crypto v0.52.0, Go→1.26.5).🤖 Generated with Claude Code