Skip to content

V2.3.4 to master#1849

Merged
pratikspatil024 merged 246 commits intomasterfrom
v2.3.4-candidate
Oct 29, 2025
Merged

V2.3.4 to master#1849
pratikspatil024 merged 246 commits intomasterfrom
v2.3.4-candidate

Conversation

@pratikspatil024
Copy link
Copy Markdown
Member

Description

Please provide a detailed description of what was done in this PR

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

fjl and others added 30 commits May 5, 2025 16:20
```
go get github.com/cockroachdb/pebble@v1.1.5
go mod tidy
```

Co-authored-by: lightclient <lightclient@protonmail.com>
This fixes an issue where blocks containing CL requests triggered an
error in the engine API. The encoding of requests used base64 instead of
hex.
Add metics detailing reasons we reject inbound connections for, and
reasons these connections fail during the handshake.
The function `BacktraceAt` has been removed in #28187 . But the API
end-point `debug_backtraceAt` is not removed from the file
`internal/web3ext/web3ext.go`.
This pull request introduces a SyncKeyValue function to the
ethdb.KeyValueStore
interface, providing the ability to forcibly flush all previous writes
to disk.

This functionality is critical for go-ethereum, which internally uses
two independent
database engines: a key-value store (such as Pebble, LevelDB, or
memoryDB for
testing) and a flat-file–based freezer. To ensure write-order
consistency between
these engines, the key-value store must be explicitly synced before
writing to the
freezer and vice versa.

Fixes 
- ethereum/go-ethereum#31405
- ethereum/go-ethereum#29819
This pull request bumps the timeout for flaky console tests on appveyor.
Delete the unused `Account.PrivateKey` variable.
…781)

This PR fixes an issue that could lead to data corruption.

Writing the state history may fail due to insufficient disk space or
other potential errors. With this change, the entire state insertion 
will be aborted instead of silently ignoring the error.

Without this fix, state transitions would continue while the associated
state history is lost. After a restart, the resulting gap would be detected, 
making recovery impossible.
This pull request enhances the block prefetcher by executing transactions 
in parallel to warm the cache alongside the main block processor.

Unlike the original prefetcher, which only executes the next block and
is limited to chain syncing, the new implementation can be applied to any 
block. This makes it useful not only during chain sync but also for regular 
block insertion after the initial sync.


---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This PR creates a global hasher pool that can be used by all packages.
It also removes a bunch of the package local pools.

It also updates a few locations to use available hashers or the global
hashing pool to reduce allocations all over the codebase.
This change should reduce global allocation count by ~1%

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This PR introduces an allocation-free version of the
Transaction.EffectiveGasTip method to improve performance by reducing
memory allocations.

## Changes
- Added a new `EffectiveGasTipInto` method that accepts a destination
parameter to avoid memory allocations
- Refactored the existing `EffectiveGasTip` method to use the new
allocation-free implementation
- Updated related methods (`EffectiveGasTipValue`, `EffectiveGasTipCmp`,
`EffectiveGasTipIntCmp`) to use the allocation-free approach
- Added tests and benchmarks to verify correctness and measure
performance improvements

## Motivation
In high-transaction-volume environments, the `EffectiveGasTip` method is
called frequently. Reducing memory allocations in this method decreases
garbage collection pressure and improves overall system performance.

## Benchmark Results

As-Is
BenchmarkEffectiveGasTip/Original-10 42089140 27.45 ns/op 8 B/op 1
allocs/op

To-Be
BenchmarkEffectiveGasTip/IntoMethod-10 72353263 16.73 ns/op 0 B/op 0
allocs/op


## Summary of Improvements
- **Performance**: ~39% faster execution (27.45 ns/op → 16.73 ns/op)
- **Memory**: Eliminated all allocations (8 B/op → 0 B/op)
- **Allocation count**: Reduced from 1 to 0 allocations per operation

This optimization follows the same pattern successfully applied to other
methods in the codebase, maintaining API compatibility while improving
performance.

## Safety & Compatibility
This optimization has no side effects or adverse impacts because:
- It maintains functional equivalence as confirmed by comprehensive
tests
- It preserves API compatibility with existing callers
- It follows clear memory ownership patterns with the destination
parameter
- It maintains thread safety by only modifying the caller-provided
destination parameter

This optimization follows the same pattern successfully applied to other
methods in the codebase, providing better performance without
compromising stability or correctness.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
This adds a metric called `chain/mgasps`, which records how many million
gas per second are being used during block insertion.

The value is calculated as `usedGas * 1000 / elapsed`, and it's updated
in the `insertStats.report` method. Also cleaned up the log output to
reuse the same value instead of recalculating it.

Useful for monitoring block processing throughput.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This pull request adds a more Pebble metrics, tracking the amount of
write stalls with specific reasons
fix #31793: resolve conflict markers in structs-abi.go.txt
I saw in ethereum/go-ethereum#31378 introduced
github.com/crate-crypto/go-eth-kzg to calculate the kzg hash, and
github.com/crate-crypto/go-kzg-4844 was only used in the test files, so
propose to drop it with go-eth-kzg instead
… (#31768)

Co-authored-by: lightclient <lightclient@protonmail.com>
This PR contains three refactors:
- refactor the latest fork check that we use quite extensively 
- refactor the nil checks in NewPayloads

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
Fix a todo: force-enable this in --dev mode

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
This adds support for naming the source iterators of FairMix, like so:

  mix.AddSource(enode.WithSourceName("mySource", iter))

The source that produced the latest node is returned by the new NodeSource method.
…gen-7 testnet (#31014)

Adding values to the witness introduces a new class of issues for
computing gas: if there is not enough gas to cover adding an item to the
witness, then the item should not be added to the witness.

The problem happens when several items are added together, and that
process runs out of gas. The witness gas computation needs a way to
signal that not enough gas was provided. These values can not be
hardcoded, however, as they are context dependent, i.e. two calls to the
same function with the same parameters can give two different results.

The approach is to return both the gas that was actually consumed, and
the gas that was necessary. If the values don't match, then a witness
update OOG'd. The caller should then charge the `consumed` value
(remaining gas will be 0) and error out.

Why not return a boolean instead of the wanted value? Because when
several items are touched, we want to distinguish which item lacked gas.

---------

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
This adds a geth subcommand for downloading era1 files and placing them into
the correct location. The tool can be used even while geth is already running
on the datadir. Downloads are checked against a hard-coded list of checksums
for mainnet and sepolia.

```
./geth download-era --server $SERVER --block 333333
./geth download-era --server $SERVER --block 333333-444444
./geth download-era --server $SERVER --epoch 0-10
./geth download-era --server $SERVER --all
```

The implementation reuses the file downloader we already had for
fetching build tools. I've done some refactoring on it to make sure it
can support the new use case, and there are some changes to the build
here as well.
They were not widely used in users setups.
…30661)

In this pull request, snapshot generation in pathdb has been ported from 
the legacy state snapshot implementation. Additionally, when running in 
path mode, legacy state snapshot data is now managed by the pathdb
based snapshot logic.

Note: Existing snapshot data will be re-generated, regardless of whether 
it was previously fully constructed.
This PR implements eth/69. This protocol version drops the bloom filter
from receipts messages, reducing the amount of data needed for a sync
by ~530GB (2.3B txs * 256 byte) uncompressed. Compressed this will
be reduced to ~100GB

The new version also changes the Status message and introduces the
BlockRangeUpdate message to relay information about the available history
range.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
manav2401 and others added 24 commits October 7, 2025 15:22
Backmerge master to develop
…king

Avoid wraparound of total delay values when logging due to integer underflow. Switch to using int64 instead of uint64. The log initially assumed that current time would always be ahead of header's block time which is not true anymore (as blocks can be announced early) breaking this assumption.
Backport master to develop
* disabling mine

* disable pip-66 integration test

* fix message
Backport from master to develop
* cli: Don't force HTTP modules in dev-mode

The HTTP modules were forced to a specific list in dev mode, thus
disabling the user's choice of active modules.

* state: Don't log prefetcher error when terminated

This is useless, it's not an actual error.
Backfill StateSync Command Improvements
* core: Use `TriesInMemory` from config

The config setting got mistakenly removed in this PR https://github.com/maticnetwork/bor/pull/1300/files

* eth/fetcher: Fix race condition in tests

The `tester.fetcher` is already started in `newTester`

* eth/fetcher: Fix race condition in test

The bool was modified in a goroutine, read in another.
Backport from master to develop
* feat: disabling gogc override

* internal/cli: add GC variables in config

* core,eth,internal/cli,triedb/pathdb: add maxdifflayers to config

* consensus/bor: fix header timestamp when time is in the past

When the calculated header timestamp based on parent time and producer delay
falls in the past, ensure we add the full producer delay to the current time
rather than just setting it to current time. This prevents immediate timeout
issues in the commit interrupt mechanism where blocks would be interrupted
immediately due to negative time delays.

Previously, when header.Time < now, we would set header.Time = now, which
could still result in timing issues during block building. Now we properly
calculate header.Time = now + CalcProducerDelay() to ensure adequate time
for block building operations.

* consensus/bor,internal/cli,params: add header timestamp fix when in past

* perf(core/blockstm): optimize HasReadDep for small input sizes

Add performance optimization to HasReadDep function based on production metrics
showing ~3M calls with median size of 15. For small inputs (<=512 elements),
use direct nested loop comparison instead of map allocation to improve performance
due to better cache locality and avoiding allocation overhead.

Additionally:
- Replace map[Key]bool with map[Key]struct{} to reduce memory usage
- Add Prometheus metrics to track function calls and input sizes
- Add detailed comments explaining the optimization rationale

The cutoff of 512 was determined through benchmarking and captures >50% of
production calls, providing significant performance improvement for the
common case while maintaining O(n+m) complexity for larger inputs.

* core: add hasReadDepCallCounter and readsMapSizeHist metrics

* eth.internal/cli,triedb: fix lint

* core,eth,internal/cli,triedb/pathdb: rm maxdifflayers config

* core: add dagBuildTimer

* Revert "consensus/bor,internal/cli,params: add header timestamp fix when in past"

This reverts commit 76f6ac5.

* triedb/pathdb: rm invalid comment

* internal/cli: rm unused function

---------

Co-authored-by: John Hilliard <praetoriansentry@gmail.com>
…llel-evm

Fix self destruct in parallel evm
* Cutomizable block time in block producer

* minor fix

* Fix test

* Refactor

* Add tests
* pruning refactor and freeze disable

* block pruner

* lint

* minor fixes

* update pruner

* include witness producers on pruning

* Info logs

* improve logs

* increase block prune interval

* fix receipts and logs on stateless node

* genesis protection

* remove genesis from tests

* meaningful info logs

* fix block pruner cursor key
@pratikspatil024 pratikspatil024 requested a review from a team October 29, 2025 15:20
@pratikspatil024 pratikspatil024 added the do not squash and merge This PR will be NOT be squashed and merged label Oct 29, 2025
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6 Security Hotspots
9.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@pratikspatil024 pratikspatil024 merged commit 7f9a889 into master Oct 29, 2025
16 of 17 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.