Commit graph

16070 commits

Author SHA1 Message Date
spencer-tb
b326264d4b params: fix 7934 size limit. 2025-07-03 18:28:42 +09:00
lightclient
df12e79e83
core/vm: implement eip-7939 CLZ instruction
Co-authored-by: Giulio <giulio.rebuffo@gmail.com>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
2025-06-23 20:12:07 +02:00
lightclient
0d58def611
core/vm, crypto/secp2561r1: implement secp256r1 precompile
Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
2025-06-23 20:10:44 +02:00
lightclient
156280d84a
core,miner,params: implement EIP-7934 - RLP Execution Block Size Limit
Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
2025-06-23 20:10:16 +02:00
lightclient
3b8609a605
consensus: implement EIP-7918
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-06-23 20:09:36 +02:00
lightclient
32b2d3e51d
all: add eip-7907 base without db table
Co-authored-by: lightclient <lightclient@proton.com>
Co-authored-by: Qi Zhou <qizhou@ethstorage.io>
2025-06-23 20:09:27 +02:00
lightclient
5ddd08720b
params: add bpo forks
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2025-06-23 20:08:40 +02:00
lightclient
61d8a93182
core/vm: implement EIP 7825 - Transaction Gas Limit Cap
Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
2025-06-23 20:08:14 +02:00
GarmashAlex
b62c0c67fa
cmd/clef: update readme (#32070)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
Replaced the outdated and broken link to the Web3 Secret Storage
Definition with the current official URL from ethereum.org in the Clef
README. This ensures users have access to up-to-date and accurate
documentation for the keystore file format.
2025-06-23 09:13:48 +02:00
Delweng
78b6059341
eth: quick canceling block inserting when debug_setHead is invoked (#32067)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
If Geth is engaged in a long-run block synchronization, such as a full
syncing over a large number of blocks, invoking `debug_setHead` will
cause `downloader.Cancel` to wait for all fetchers to stop first.
This can be time-consuming, particularly for the block processing
thread.

To address this, we manually call `blockchain.StopInsert` to interrupt
the blocking processing thread and allow it to exit immediately, and
after that call `blockchain.ResumeInsert` to resume the block
downloading process.

Additionally, we add a sanity check for the input block number of
`debug_setHead` to ensure its validity.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-23 14:04:21 +08:00
rjl493456442
21920207e4
triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
Previously, PathDB used a single buffer to aggregate database writes,
which needed to be flushed atomically. However, flushing large amounts
of data (e.g., 256MB) caused significant overhead, often blocking the
system for around 3 seconds during the flush.

To mitigate this overhead and reduce performance spikes, a double-buffer
mechanism is introduced. When the active buffer fills up, it is marked
as frozen and a background flushing process is triggered. Meanwhile, a
new buffer is allocated for incoming writes, allowing operations to
continue uninterrupted.

This approach reduces system blocking times and provides flexibility in
adjusting buffer parameters for improved performance.
2025-06-22 20:40:54 +08:00
Csaba Kiraly
338d754ed0
core/state: fix prefetch on single core CPU (#32075)
We need at least one prefetch goroutine. SetLimit(0) would block
prefetch.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-06-22 20:28:29 +08:00
Csaba Kiraly
6eab053088
core/state: improve the prefetcher concurrency allowance (#32071)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Docker Image (push) Has been cancelled
Improve the prefetcher concurrency allowance.
2025-06-21 13:00:32 +08:00
rjl493456442
c7b8924fe4
core/state: expose the state reader stats (#31998)
This pull request introduces a mechanism to expose statistics from the
state reader, specifically related to cache utilization during state prefetching.

To improve state access performance, a pair of state readers is constructed 
with a shared local cache. One reader to execute transactions  ahead of time
to warm up the cache. The other reader is used by the actual chain processing 
logic, which can benefit from the prefetched states.

This PR adds visibility into how effective the cache is by exposing relevant 
usage statistics.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-06-21 12:58:04 +08:00
Ha DANG
846d13a31a
ethdb: Implement DeleteRange in batch (#31947)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
implement #31945

---------

Co-authored-by: prpeh <prpeh@proton.me>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-20 19:40:41 +08:00
Antonio Sanso
f26b5653e8
crypto/bn256: add documentation on subgroup checks for G2 (#32066)
This PR improves the IsOnCurve methods for BN254 G2 points by:

* Clarifying its behavior the docstring, making it explicit that it
verifies both the point being on the curve and in the correct subgroup.

* Adding an in-line comment explaining the subgroup membership check
(c.Mul(Order)).

 * Minor wording adjustments for readability and consistency.
2025-06-20 13:18:20 +02:00
Marius van der Wijden
6723388b01
crypto/bn256/gnark: align marshaling behavior (#32065)
Aligns the marshaling behavior of gnark to google and cloudflare

Co-authored-by: kevaundray <kevtheappdev@gmail.com>
2025-06-20 12:47:48 +02:00
Felix Lange
35dd61a3bf .gitea: show environment in release-ppa.yml
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-06-19 20:37:02 +02:00
maskpp
09289fd154
trie: delete secKeyCacheOwner (#31785)
The optimization tried to defer allocating the cache map until it was used for the
first time. It's a relic from earlier times, when tries were copied often. This seems
unnecessary now, so we can just create the map when the trie is created.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-19 16:19:54 +02:00
Felix Lange
d4462828e9 .gitea: touch cron workflow files 2025-06-19 14:56:12 +02:00
rjl493456442
ac50181b74
core: consolidate BlockChain constructor options (#31925)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
In this pull request, the original `CacheConfig` has been renamed to `BlockChainConfig`.

Over time, more fields have been added to `CacheConfig` to support
blockchain configuration. Such as `ChainHistoryMode`, which clearly extends
beyond just caching concerns.

Additionally, adding new parameters to the blockchain constructor has
become increasingly complicated, since it’s initialized across multiple
places in the codebase. A natural solution is to consolidate these arguments 
into a dedicated configuration struct.

As a result, the existing `CacheConfig` has been redefined as `BlockChainConfig`.
Some parameters, such as `VmConfig`, `TxLookupLimit`, and `ChainOverrides`
have been moved into `BlockChainConfig`. Besides, a few fields in `BlockChainConfig`
were renamed, specifically:

- `TrieCleanNoPrefetch` -> `NoPrefetch`
- `TrieDirtyDisabled` -> `ArchiveMode`

Notably, this change won't affect the command line flags or the toml
configuration file. It's just an internal refactoring and fully backward-compatible.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-19 12:21:15 +02:00
zhiqiangxu
6762006383
core: simplify effectiveTip calculation (#31771)
Since we have the effective gas price in the message, we can compute tip by
simply subtracting the basefee. No need to recompute the effective price.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-19 11:43:24 +02:00
Ömer Faruk Irmak
4997a248ab
core/rawdb: don't decode the full block body in ReadTransaction (#32027)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
Reading a single transaction out of a block shouldn't need decoding the
entire body

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-19 10:05:32 +08:00
Delweng
8219bfcadd
eth,core: terminate the downloader immediately when shutdown signal is received (#32062)
Closes https://github.com/ethereum/go-ethereum/issues/32058
2025-06-19 09:44:39 +08:00
Stephen Buttolph
0ce13346ce
crypto/bn256/cloudflare: pull in upstream fix for R27 and R29 usage (#32057)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Pulls in https://github.com/cloudflare/bn256/pull/48 to remove usage of
R27 and R29 [which are reserved](https://go.dev/doc/asm#arm64).
2025-06-18 14:17:30 +02:00
nthumann
cc1293b8f1
all: reuse the global hash buffer (#31839)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
As https://github.com/ethereum/go-ethereum/pull/31769 defined a global
hash pool, so we can reuse it, and also remove the unnecessary
KeccakState buffering

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-18 15:29:14 +08:00
Marius van der Wijden
4ea9eea75f
eth/catalyst: fetch header on forkchoiceUpdated (#31928)
closes https://github.com/ethereum/go-ethereum/issues/31254

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-18 15:06:49 +08:00
levisyin
fa8f391db3
build: upgrade -dlgo version to Go 1.24.4 (#31978)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-06-17 23:42:06 +02:00
Marius van der Wijden
6bba9d42a5
tests/fuzzers: added bn marshaling fuzzers (#32053)
Adds marshaling fuzzing for G1 and G2 to oss-fuzz. 

Also aligns the behavior of the google library to that of gnark and
cloudflare, which only ever read the first 64 / 128 bytes of the input,
regardless of how long the input is
2025-06-17 23:02:36 +02:00
kevaundray
190b236966
crypto/bn256: fix gnark deserialisation (#32055)
fixes the gnark deserialisation

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-17 21:58:31 +02:00
dependabot[bot]
f745c529a2
go.mod: bump golang.org/x/net from 0.36.0 to 0.38.0 (#31658)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-06-17 14:59:37 +02:00
Herbert
2e6d978e35
accounts: fix data race when closing manager (#31982)
Fixes a data race on the `wallets` slice when closing account Manager.

At the moment, there is a data race between a go-routine calling the
Manager's `Close` function and the background go-routine handling most
operations on the `Manager`. The `Manager`'s `wallets` field is accessed
without proper synchronization.

By moving the closing of wallets from the `Close()` function into the
background thread, this issue can be resolved.
2025-06-17 14:44:51 +02:00
rjl493456442
71653cf0c2
ethdb/pebble: lower the compaction debt (#31988)
This pull request reduces the threshold for triggering compaction at
level0, leading to less compaction debt. This change is helpful in the
case of heavy write-load, mitigating the case of heavy write stalls
caused by compaction.

closes https://github.com/ethereum/go-ethereum/issues/31830
2025-06-17 14:23:45 +02:00
cz
05e199408f
fix: skip storage entries with missing preimage keys (#32051)
When `GetKey`  is called, a missing preimage can cause the function to return a `nil`
key. This, in turn, makes `account.Storage` persist an incorrect value.
2025-06-17 20:13:03 +08:00
Felix Lange
65d77c5129 Revert "crypto/bn256: default to gnark (#32024)"
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This reverts commit e0cf89ecfa.
2025-06-17 00:42:07 +02:00
Felix Lange
9402187733
node: fix data race on httpConfig.prefix (#32047)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
This fixes a data race when accessing the `httpConfig.prefix` field.
This field can be modified while the server is running through
`enableRPC`. The fix is storing the prefix in the handler, which is
accessed through the atomic pointer.

alternative to #32035
fixes https://github.com/ethereum/go-ethereum/issues/32019
2025-06-16 18:44:18 +02:00
Ignacio Hagopian
e2007e513c
tracers/prestate: always remove empty accounts from pre-state (#31427)
The prestateTracer had the intention of excluding accounts that were
empty prior to execution from the prestate. This was being done only for
created contracts. This PR makes it so all such empty accounts are
excluded. This behavior is configurable using the `includeEmpty: true`
flag introduced in #31855.

---------

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-06-16 15:34:48 +02:00
Ömer Faruk Irmak
8b86ff7979
go.mod: update gnark-crypto to v0.18.0 (#32034)
mainly to pull in https://github.com/Consensys/gnark-crypto/pull/693
2025-06-16 13:23:10 +02:00
kevaundray
e0cf89ecfa
crypto/bn256: default to gnark (#32024) 2025-06-16 13:10:14 +02:00
Nebojsa Urosevic
fd4e1f83cb
eth/tracers: flag for empty acounts in prestateTracer (#31855)
Some checks are pending
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
This PR introduces a flag that enables returning of newly created state
objects in the prestateTracer.

**Rationale**
Having this information is useful because local execution can more
easily distinguish between newly created objects and system contracts.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-06-16 12:31:09 +02:00
shazam8253
72d92698a4
Makefile: add make evm (#32029)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Docker Image (push) Has been cancelled
2025-06-13 16:16:49 +02:00
jwasinger
e5da461f29
core/vm: implement updates to modexp gas cost changes in EIP-7883 (#32015)
Implements the updated gas cost changes introduced in
5cdd75157d
2025-06-13 14:01:50 +02:00
Ömer Faruk Irmak
ece4b48d84
metrics: remove use of reflect in metrics registration code (#31962)
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2025-06-13 13:47:26 +02:00
Delweng
999f09f8af
trie: no need to store preimage if not enabled (#32012)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
As the preimage will only be stored if `t.preimages != nil`, so no need
to save them into local cache if not enabled. This will reduce the memory 
wasted to copy the bytes

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2025-06-13 15:04:24 +08:00
Sean Liao
82c2c8191f
metrics: add chain/gas for cumulative gas usage (#32004)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
This is a followup to #31753.

A cumulative counter is more useful when we need to measure / aggregate
the metric over a longer period of time. It also means we won't miss data,
e.g. our prometheus scrapes every 30 seconds, and so may miss a transient 
spike in the pre-aggregated mgas/s.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-12 20:30:54 +08:00
Marius van der Wijden
5605f9d7ad
crypto/kzg4844: remove kzg initialization (#32017)
This fixes a regression in the state tests where we always initialized
the KZG library. This was added to test some stuff in #31791
2025-06-12 17:53:16 +08:00
Felix Lange
9e0611b660
core/vm, cmd/evm: remove EOF (#32000)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Docker Image (push) Has been cancelled
With EOF removed from the Osaka fork, and no longer being tested, the
implementation will now just be bitrotting. I'm opting to remove it so
it doesn't get in the way of other changes.
2025-06-11 14:50:46 +02:00
Sina M
0983cd789e
eth/filters: add timestamp to derived logs (#31887)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
The block timestamp field is now added to the logs returned
by eth_getLogs.
2025-06-10 11:52:02 +02:00
Felix Lange
3cc0e7a31a
params: enable osaka fork in MergedTestChainConfig (#31993)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-06-09 16:44:42 +02:00
rjl493456442
51c1bb76f4
cmd/workload: introduce transaction-trace test (#31288)
This pull request introduces a new test suite in workload framework, for
transaction tracing.

**test generation**
`go run . tracegen --trace-tests trace-test.json http://host:8545`

and you can choose to store the trace result in a specific folder
`go run . tracegen --trace-tests trace-test.json --trace-output
./trace-result http://host:8545`

**test run**
`./workload test -run Trace/Transaction --trace-invalid ./trace-invalid
http://host:8545`

The mismatched trace result will be saved in the specific folder for
further investigation.
2025-06-09 16:36:24 +02:00