Skip to content

v2.7.0#2162

Merged
pratikspatil024 merged 93 commits into
masterfrom
v2.7.0-candidate
Mar 26, 2026
Merged

v2.7.0#2162
pratikspatil024 merged 93 commits into
masterfrom
v2.7.0-candidate

Conversation

@pratikspatil024

Copy link
Copy Markdown
Member

Merge v2.7.0 to master for stable release.

kamuikatsurgi and others added 30 commits February 6, 2026 17:40
* Fix more race conditions detected by -race

* Address comments
* added rate limiting to address biased trie cache preloading

* updated default limit to 512KB/sec and a small update in limiter

* added unit tests

* updated default to 1MB/s and updated comments

* reduced code duplication

* triedb/pathdb: skip the node in preloading if it's size is > burst size
* consensus/bor: add test coverage

* Add missing files

* Refactor

* Refactor & deduplicate
Removed extra spaces in static-nodes list.
* feat: add network diagnostics and state dump action

* remove: exit 1
* enabling pip-66 back and wait moved from seal to prepare

* bring subsecond extra time

* prefetch from pool

* more prefetch metrics

* address early announcement for rio blocks

* separate worker cache metrics

* optinal flag to disable prefetch

* prefetch gas limit flag

* tests and lint

* small fixes

* remove logs

* address duplicates

* small fix on integration test

* prefetch coverage histogram and fmt

* verify headers coverage and bor test resiliency

* address duplicates

* duplicates and lint

* addressing comments

* small fix

* address comments

* fix push tx for rpc nodes

* rename meter and intermediateroot prefetch

* address lint

* address succession number check

* fixing concurrency issues and tests for prefetch state being thrown away by gc

* make lint

* e2e worker tests

* benchmark tests

* worker tests fixed and interrupt watch while waiting

* remove parallel from tests
* core/state: reduce lock contention in triePrefetcher.used()

The used() method previously held a global write lock while doing a map lookup, a blocking fetcher.wait(), and slice appends — serializing all N parallel IntermediateRoot goroutines behind a single mutex. Fix this by downgrading to a read lock for the map lookup and moving slice appends behind a per-subfetcher usedLock via a new appendUsed() method.

* fix linter
Fix formatting of static-nodes in config.toml
* (feat): new approach for private tx relay and preconfs

* (feat): refactor relay service

* small nit

* eth/relay: fix lint

* eth: add tests for disable tx propagation

* eth: add tests for private transactions

* eth/relay: small fixes

* eth/relay: small fixes

* eth/relay: add tests for private tx store

* eth/relay: add tests for multiclient

* eth/relay: fix call to send private tx

* eth/relay: add a sub test for multiclient

* eth/relay: add tests for relay service

* address claude comments, fix non-deterministic tests

* eth/relay: update relay to server preconf for any tx hash, update tests

* eth: close relay service in backend

* eth: disable tx propagation for rebroadcast

* eth/relay: handle 'already known' errors

* eth/relay: small nits

* internal/ethapi: update txpool_txStatus api comment

* eth: check tx status in local db

* eth/relay: fix tests

* address claude comments

* eth/relay: handle race condition for updating task in cache

* internal/ethapi: ignore already known error for preconfs

* eth/relay: add CLAUDE.md with some context

* internal/ethapi: update hash when tx is already known

* eth/relay: fix lint

* eth/relay: small delay before task being consumed in test

* internal/ethapi: lint fix

* internal/ethapi: use tx subscription for offering preconf

* Revert "internal/ethapi: use tx subscription for offering preconf"

This reverts commit a33980b.

* eth: move log to debug

* eth/relay: add private tx store metrics

* eth/relay: add more metrics

* eth/relay, internal/ethapi: handle private tx via new rpc endpoint

* internal/ethapi, eth/relay: address security comments

* eth/relay: wait for go routines to exit for clean shutdown

* eth/relay: add more tests for relay

* eth/relay: address blocking semaphore

* internal/ethapi: add tests for rpc methods

* eth: test backend method wiring

* eth: add tests for graceful shutdown

* docs/cli: update cli flags

* update all config.toml files for packages with new flags
* Enable rebroadcast by default (#2028)

* chore: bump version

* consensus/misc/eip4844: small update to fix simulatev1 crash (#2054)

* core, internal, params: lisovoPro HF and version bump (#2055)

* core, internal, params: lisovoPro HF and version bump

* core: add lisovoPro instructionset

* core: lisovo-lisovoPro instructionset test

* consensus/bor: fix goroutine leak in runMilestoneFetcher when Heimdall is unreachable (#2056)

FetchMilestone was called with context.Background(), which has no deadline. When Heimdall becomes unreachable, FetchWithRetry enters an infinite retry loop that never returns. Since the ticker fires every second, a new blocked goroutine accumulates each tick — leading to OOM within minutes.

Add a 30s context timeout to bound each call, matching the existing pattern in retryHeimdallHandler (eth/backend.go). This caps in-flight goroutines at ~30 instead of growing unboundedly.

* consensus, crypto, p2p: fix issues 44, 47, 48, 49

* bump go

* ci: update workflows

* consensus/bor: better naming on heimdallgrpc client context for ss txs

* consensus/bor: lower global timeout for ss txs

* fix(shutdown): cancel in-flight Heimdall queries on engine shutdown (#2058)

* fix(shutdown): cancel in-flight Heimdall queries on engine shutdown

* chore: nit

* consensus/bor: fix sub-second late block detection producing empty blocks (#2060)

The late-block adjustment in Prepare() uses an integer-second comparison
(header.Time < now.Unix()) to detect when a block is behind schedule and
needs additional build time. Because header.Time is an integer (seconds)
while the actual target time can have sub-second precision, a block can
be up to 999ms late without triggering the adjustment.

Example: with period=1s and parent.Time=T:

  header.Time        = T + 1                     (integer seconds)
  now                = T + 1.820                  (parent block is 820ms late)
  now.Unix()         = T + 1                      (truncated to seconds)
  header.Time < now.Unix() → false                (adjustment skipped!)

This affects both the default path (blockTime=0, where GetActualTime()
falls back to time.Unix(header.Time, 0)) and the custom blockTime path
(where ActualTime has sub-second precision from the parent cache chain).

With no adjustment, GetActualTime() returns a time already in the past.
The interrupt timer in commitWork() expires immediately, which sets the
interruptBlockBuilding flag before fillTransactions() runs. The txpool's
Pending() checks this flag on every address iteration and returns an
empty map, producing a block with 0 transactions even when the pool has
pending transactions.

Fix by replacing the integer comparison with a direct time comparison
against the block's actual target time:

  if now.After(header.GetActualTime()) {

GetActualTime() returns header.ActualTime when set (custom blockTime
with Rio, sub-second precision), or time.Unix(header.Time, 0) as
fallback (default path). This correctly detects lateness in both cases
without over-triggering for on-time blocks, since on-time blocks have
their target time in the future.

* fix(core): cap verifyPendingHeaders to prevent OOM from unbounded header reads (#2057)

* exp: disable verifyPendingHeaders

* fix: cap verify pending headers at default span length + 1

* fix: add reorg metrics in verify pending headers

* chore: add tests

* refactor: use milestone fetcher and milestone's end block as the start block

* fix: tests

* cmd: bump go

* builder, internal, params: pip-82 and lisovo HF in mainnet (#2064)

* builder, internal, params: implement new burnContract in lisovo / define lisovo height for mainnet / bump version

* fix lint

* fix: tests

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: findfluctuate <findfluctuate@outlook.com>
Signed-off-by: liuyueyangxmu <liuyueyangxmu@outlook.com>
Co-authored-by: Jerry <jerrycgh@gmail.com>
Co-authored-by: marcello33 <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Lewis <lewis.kim@kaia.io>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: cui <cuiweixie@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Csaba Kiraly <cskiraly@users.noreply.github.com>
Co-authored-by: mishraa-G <divyansh.mishra.mec23@itbhu.ac.in>
Co-authored-by: Galoretka <galoretochka@gmail.com>
Co-authored-by: hero5512 <lvshuaino@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: aodhgan <36907214+aodhgan@users.noreply.github.com>
Co-authored-by: aodhgan <gawnieg@gmail.com>
Co-authored-by: Youssef Azzaoui <y@azzaoui.fr>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: CertiK <138698582+CertiK-Geth@users.noreply.github.com>
Co-authored-by: Bosul Mun <bsbs8645@snu.ac.kr>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Kyrin <kyrincode@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Rizky Ikwan <rizzikwann@gmail.com>
Co-authored-by: anim001k <140460766+anim001k@users.noreply.github.com>
Co-authored-by: Austin Larson <78000745+alarso16@users.noreply.github.com>
Co-authored-by: Coder <161350311+MamunC0der@users.noreply.github.com>
Co-authored-by: wit liu <wit765765346@gmail.com>
Co-authored-by: maradini77 <140460067+maradini77@users.noreply.github.com>
Co-authored-by: findfluctuate <findfluctuate@outlook.com>
Co-authored-by: liuyueyangxmu <liuyueyangxmu@outlook.com>
Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>
Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Raneet Debnath <35629432+Raneet10@users.noreply.github.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Raneet Debnath <raneetdebnath10@gmail.com>
Co-authored-by: ChanHongMing <91173675+ChanHongMing@users.noreply.github.com>
Co-authored-by: Adam Dossa <adossa@polygon.technology>
Co-authored-by: Adam Dossa <adam.dossa@gmail.com>
Co-authored-by: Léo Vincent <28714795+leovct@users.noreply.github.com>
Co-authored-by: Sanket Saagar Karan <ssaagar@polygon.technology>
* (chore): bump go version to 1.26

* (chore): update golandci-lint version
…) (#2072)

* core/stateless: fix witness RLP backward compat with WIT/0 peers

Nodes upgraded from WIT/0 to WIT/1 were incorrectly jailing WIT/0 peers
with "rlp: too few elements for stateless.ExtWitness". A 5-field
ExtWitness encoding (Context, Headers, Codes, State, Keys) was
accidentally introduced during an upstream geth merge, replacing the
original 3-field wire format (Context, Headers, State) that WIT/0 peers
still use.

Introduce BorWitness as the canonical 3-field wire format. EncodeRLP now
encodes using BorWitness (State only, codes excluded). DecodeRLP tries
BorWitness first and falls back to ExtWitness for backward compatibility
with peers that temporarily ran the extended encoding.

ExtWitness is retained as the representation for the JSON debug API
(ExecutionWitness, ExecutionWitnessByHash) and as the fallback decode
target for the transitional period.

* Add test

Co-authored-by: Jerry <jerrycgh@gmail.com>
(chore): correct go version to 1.26.0
…ler (#2079)

* core/rawdb, p2p, eth: fix graceful shutdown of pruner and dial scheduler

* fix: lint
…othash

fix root hash calculation during reorgs
Bumps [github.com/pion/dtls/v3](https://github.com/pion/dtls) from 3.0.10 to 3.0.11.
- [Release notes](https://github.com/pion/dtls/releases)
- [Commits](pion/dtls@v3.0.10...v3.0.11)

---
updated-dependencies:
- dependency-name: github.com/pion/dtls/v3
  dependency-version: 3.0.11
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
pratikspatil024 and others added 13 commits March 13, 2026 13:47
…s-through (#2149)

* eth/filters, rpc: add `--rpc.rangelimit` flag and fix filter config pass-through (#2147)

* Include range limit filter flag

* update docs

* apply more range checks

* Including RPCLogQueryLimit

* make docs
* core/vm: add kzg precompile back for madhugiri forks

* core/vm: remove kzg from prague

* core/vm: update kzg tests to ensure activation and removal

* core/vm: improve test

* core/vm: typo

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* core/vm: improve test

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* build(deps): bump google.golang.org/grpc from 1.77.0 to 1.79.3 (#2148)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.77.0 to 1.79.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.77.0...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* eth/ethconfig: remove redundant RPCLogQueryLimit field

LogQueryLimit was introduced from an upstream Geth merge (dce511c);
RPCLogQueryLimit was added later when wiring the internal CLI, creating
a duplicate. Both were always set to the same value from
--rpc.logquerylimit; filters read RPCLogQueryLimit while LogQueryLimit
was dead code.

Remove RPCLogQueryLimit and make LogQueryLimit the single field.
No user-facing change: the --rpc.logquerylimit CLI flag and the
logquerylimit TOML key are unchanged.

* address lint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#2151)

* build(deps): bump google.golang.org/grpc from 1.77.0 to 1.79.3 (#2148)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.77.0 to 1.79.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.77.0...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Increase txAnn limit

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 25, 2026 17:25

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@pratikspatil024 pratikspatil024 added the do not squash and merge This PR will be NOT be squashed and merged label Mar 25, 2026
@pratikspatil024 pratikspatil024 changed the title v2.7.0 [WIP] v2.7.0 Mar 25, 2026
@claude

claude Bot commented Mar 25, 2026

Copy link
Copy Markdown

Code Review

Found 3 issues in the new eth/relay/ package. All relate to goroutine lifecycle and resource management during shutdown. See inline comments for details.

Checked for bugs and CLAUDE.md compliance.

@claude

claude Bot commented Mar 25, 2026

Copy link
Copy Markdown

Issue 1: Retry goroutines not tracked for shutdown — use-after-close of RPC clients

File: eth/relay/multiclient.go:221-224

The background retry goroutine spawned here is not tracked by Service.wg, and the caller in service.go:288 discards the done channel. When Service.close() runs, it calls s.wg.Wait() (which does not cover retry goroutines) then mc.close() which closes all RPC clients. A retry goroutine that passed the mc.closed.Load() check before shutdown, or is in time.Sleep, will then call client.CallContext on a closed *rpc.Client.

Suggested fix: Track retry goroutines in a sync.WaitGroup and wait for them before closing clients, or use a context cancelled on shutdown instead of time.Sleep + atomic flag.


Issue 2: Subscription leak on error path

File: eth/relay/private_tx_store.go:113-114

When chainEventSub.Err() fires, cleanup() returns the error without calling chainEventSub.Unsubscribe(). The cleanupLoop then calls cleanup() again, creating a new subscription at line 98. The old subscription is never unsubscribed, leaking resources in the event feed on each retry.

Suggested fix: Add chainEventSub.Unsubscribe() before the return err on line 114, or use defer chainEventSub.Unsubscribe() after creating the subscription.


Issue 3: Data race on txGetter field (low severity)

File: eth/relay/service.go:98-99

SetTxGetter writes s.txGetter without synchronization, while CheckTxPreconfStatus and SubmitPrivateTx read it concurrently. Practical severity is low since the write happens once at startup, but go test -race would flag it.

Suggested fix: Pass txGetter as a parameter to NewService() before goroutines start, or protect with a mutex.

@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.76839% with 342 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.29%. Comparing base (6b0405c) to head (debca88).
⚠️ Report is 94 commits behind head on master.

Files with missing lines Patch % Lines
eth/filters/IBackend.go 0.00% 79 Missing ⚠️
eth/api_backend.go 41.81% 32 Missing ⚠️
eth/relay/multiclient.go 91.89% 15 Missing and 6 partials ⚠️
consensus/bor/bor.go 76.74% 14 Missing and 6 partials ⚠️
consensus/bor/heimdallws/client.go 89.75% 14 Missing and 3 partials ⚠️
eth/relay/private_tx_store.go 80.00% 16 Missing and 1 partial ⚠️
core/blockchain.go 71.11% 9 Missing and 4 partials ⚠️
consensus/bor/heimdall/health_registry.go 95.02% 8 Missing and 4 partials ⚠️
eth/handler.go 77.77% 10 Missing and 2 partials ⚠️
core/rawdb/database.go 70.96% 6 Missing and 3 partials ⚠️
... and 34 more

❌ Your patch status has failed because the patch coverage (83.76%) 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             @@
##           master    #2162      +/-   ##
==========================================
- Coverage   51.63%   51.29%   -0.34%     
==========================================
  Files         877      882       +5     
  Lines      155302   154212    -1090     
==========================================
- Hits        80190    79110    -1080     
+ Misses      70012    69944      -68     
- Partials     5100     5158      +58     
Files with missing lines Coverage Δ
accounts/abi/bind/backends/simulated.go 60.68% <100.00%> (ø)
common/format.go 8.33% <100.00%> (+8.33%) ⬆️
consensus/bor/heimdall/client.go 49.84% <100.00%> (+11.57%) ⬆️
consensus/bor/statefull/processor.go 0.00% <ø> (ø)
core/blockstm/dag.go 71.03% <100.00%> (+25.93%) ⬆️
core/chain_makers.go 51.99% <100.00%> (ø)
core/rawdb/pruner_strategy_wit.go 90.00% <100.00%> (+12.00%) ⬆️
core/rawdb/witness_store.go 100.00% <100.00%> (ø)
core/rawdb/witness_store_db.go 100.00% <100.00%> (ø)
core/rawdb/witness_store_fs.go 100.00% <100.00%> (ø)
... and 99 more

... and 35 files with indirect coverage changes

Files with missing lines Coverage Δ
accounts/abi/bind/backends/simulated.go 60.68% <100.00%> (ø)
common/format.go 8.33% <100.00%> (+8.33%) ⬆️
consensus/bor/heimdall/client.go 49.84% <100.00%> (+11.57%) ⬆️
consensus/bor/statefull/processor.go 0.00% <ø> (ø)
core/blockstm/dag.go 71.03% <100.00%> (+25.93%) ⬆️
core/chain_makers.go 51.99% <100.00%> (ø)
core/rawdb/pruner_strategy_wit.go 90.00% <100.00%> (+12.00%) ⬆️
core/rawdb/witness_store.go 100.00% <100.00%> (ø)
core/rawdb/witness_store_db.go 100.00% <100.00%> (ø)
core/rawdb/witness_store_fs.go 100.00% <100.00%> (ø)
... and 99 more

... and 35 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.

* added giugliano block for mainnet

* added LisovoProBlock and GiuglianoBlock to GatherForks
Copilot AI review requested due to automatic review settings March 26, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@pratikspatil024 pratikspatil024 changed the title [WIP] v2.7.0 v2.7.0 Mar 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.7% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@pratikspatil024 pratikspatil024 merged commit 21a6320 into master Mar 26, 2026
17 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not squash and merge This PR will be NOT be squashed and merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.