Commit graph

16044 commits

Author SHA1 Message Date
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
Felix Lange
7ec493f66b
eth: initialize blobTxPool (#31992)
Fixes a regression introduced in #31791, see
https://github.com/ethereum/go-ethereum/pull/31791#issuecomment-2955554641
2025-06-09 15:16:06 +02:00
rjl493456442
08a03c7761
ethdb/pebble: adjust the number of memory tables (#31970)
This pull request adjusts the number of allowed memory tables in Pebble.

Pebble allows configuring an arbitrary number of memory tables to hold 
unflushed data. When the current memtable becomes full, it is scheduled 
for flushing, and a new memtable is allocated to accept subsequent
writes. However, if too many memtables accumulate and are waiting to be 
flushed, subsequent writes will stall.

Originally, only two memtables were configured, each with a size of 512
MB for Ethereum mainnet. While this setup works well under normal
conditions, it becomes problematic under heavy write loads. In such scenarios,
flushing is only triggered when more than 512 MB of data is pending, which may
not be responsive enough. Even worse, if compactions are running
concurrently, flushing memtables can become slow due to the heavy IO 
overhead, leading to write stalls across the system.

This pull request tries to mitigate the performance degradation by having 
more memory tables but with a smaller size. In this case, the pending
writes can be flushed more smoothly and responsively.
2025-06-09 18:01:38 +08:00
Marius van der Wijden
c7e6c08e54
eth/catalyst: implement getBlobsV2 (#31791)
Implements `engine_getBlobsV2` which is needed for PeerDAS.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-09 11:34:24 +02:00
jwasinger
35dd84ce29
core/vm: implement EIP 7883 - ModExp Gas Cost Increase (#31606)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Docker Image (push) Has been cancelled
https://eips.ethereum.org/EIPS/eip-7883

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-05 16:47:49 +02:00
Felix Lange
0007f62da5
cmd/geth: fix era1 download location to match store (#31951)
This changes the era1 downloader to place the files into the correct
location where geth will actually use them. Also adds integration with
the new --datadir.era flag.
2025-06-05 16:19:47 +02:00
Csaba Kiraly
4bb097b7ff
eth, p2p: improve dial speed by pre-fetching dial candidates (#31944)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR improves the speed of Disc/v4 and Disc/v5 based discovery by
adding a prefetch buffer to discovery sources, eliminating slowdowns
due to timeouts and rate mismatch between the two processes.

Since we now want to filter the discv4 nodes iterator, it is being removed
from the default discovery mix in p2p.Server. To keep backwards-compatibility,
the default unfiltered discovery iterator will be utilized by the server when
no protocol-specific discovery is configured.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-05 12:14:35 +02:00
Ömer Faruk Irmak
d675721276
crypto/kzg4844: avoid copying blobs for marshaling (#31911)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
LLVM is not able to handle large arrays on stack
2025-06-04 20:52:27 +02:00
jwasinger
5e98c97abb
core/vm: implement EIP 7823 - Set upper bounds for MODEXP (#31818) 2025-06-04 18:19:11 +02:00
Sina M
5346b8ff28
eth/downloader: fix missing receipt (#31952)
This fixes a regression introduced by #29158 where receipts of empty blocks
were stored into the database as an empty byte array, instead of an RLP empty list.

Fixes #31938

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-04 16:07:16 +02:00
Joe Chen
35c5b4fafd
cmd/utils: update SepoliaFlag usage (#31961)
The Sepolia testnet has transitioned to pos following The Merge.
2025-06-04 15:07:15 +02:00
jwasinger
fe95bfdc89
accounts/abi: error when packing negative values in unsigned types (#31790)
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 an alternative approach to
https://github.com/ethereum/go-ethereum/pull/31607 , that doesn't break
backwards-compatibility with abigen.

Note that this does change the behavior of `Argument.Pack`: previously,
packing negative values for a `uint` parameter would cause them to be
represented in signed binary representation via two's complement. Now,
it will fail explicitly in this case.

However, I don't see a reason to support this functionality. The ABI
already explicitly supports signed integers. There's no reason that a
smart contract author would choose to store signed values in a `uint`
afaict.

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
2025-06-04 14:47:01 +02:00
Marius van der Wijden
23f07d8c93
eth/catalyst: use atomics instead of locks (#31955)
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-04 12:18:20 +08:00
Ömer Faruk Irmak
500ed3b22c
metrics: disable CPU metrics on tinygo (#31953) 2025-06-04 00:19:23 +02:00
Lunor
778430a689
eth/filters: fix pruned history error for genesis block (#31941)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
Fixes an issue where querying logs for block ranges starting from 0 would fail with an irrelevant
error on a pruned node. Now the correct "history is pruned" error will be returned.
2025-06-03 17:13:35 +02:00
William Morriss
ef464179a1
eth/catalyst: change warning to error for 'too many bad block attempts' (#31940)
This situation was failing quietly for me recently when I had a partial
data corruption issue. Changing the log level to Error would increase
visibility for me.
2025-06-03 14:36:00 +02:00
Felföldi Zsolt
91900e79ea
core/filtermaps: remove filter base row cache, add group read (#31852)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR changes the database access of the base part of filter rows that
are stored in groups of 32 adjacent maps for improved database storage
size and data access efficiency.
Before this grouped storage was introduced, filter rows were not cached
because the access pattern of either the index rendering or the search
does not really benefit from caching. Also no mutex was necessary for
filter row access. Storing adjacent rows in groups complicated the
situation as a search typically required reading all or most of adjacent
rows of a group, so in order to implement the single row read operation
without having to read the entire group up to 32 times, a cache for the
base row groups was added. This also introduced data race issues for
concurrenct read/write in the same group which was avoided by locking
the `indexLock` mutex. Unfortunately this also led to slowed down or
temporarily blocked search operations when indexing was in progress.
This PR returns to the original concept of uncached, no-mutex filter map
access by increasing read efficiency in a better way; similiarly to
write operations that already operate on groups of filter maps, now
`getFilterMapRow` is also replaced by `getFilterMapRows` that accepts a
single `rowIndex` and a list of `mapIndices`. It slightly complicates
`singleMatcherInstance.getMatchesForLayer` which now has to collect
groups of map indices accessed in the same row, but in exchange it
guarantees maximum read efficiency while avoiding read/write mutex
interference.

Note: a follow-up refactoring is WIP that further changes the database
access scheme by prodiving an immutable index view to the matcher, makes
the whole indexer more straightforward with no callbacks, and entirely
removes the concept of matcher syncing with `validBlocks` and the
resulting multiple retry logic in `eth/filters/filter.go`. This might
take a bit longer to finish though and in the meantime this change could
hopefully already solve the blocked request issues.
2025-06-03 12:54:13 +02:00
Sina M
a7d9b52eaf
core/rawdb: integrate eradb backend for RPC (#31604)
This implements a backing store for chain history based on era1 files.
The new store is integrated with the freezer. Queries for blocks and receipts
below the current freezer tail are handled by the era store.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-06-03 10:47:38 +02:00
Felix Lange
c87b856c1a
eth: return null for not-found in BlockByNumberOrHash (#31949)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This changes the API backend to return null for not-found blocks. This behavior
is required by the RPC When `BlockByNumberOrHash` always returned an error
for this case ever since being added in https://github.com/ethereum/go-ethereum/pull/19491.
The backend method has a couple of call sites, and all of them handle a `nil`
block result because `BlockByNumber` returns `nil` for not-found.

The only case where this makes a real difference is for `eth_getBlockReceipts`,
which was changed in #31361 to actually forward the error from `BlockByNumberOrHash`
to the caller.
2025-06-02 16:11:19 +02:00
Felix Lange
99c0ed1154
.gitea: modify scheduled workflow times (#31946)
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-02 13:00:58 +02:00
Ömer Faruk Irmak
2a1784baef
go.mod: bump flock package version (#31909)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Docker Image (push) Has been cancelled
The newer version has a stub implementation for unsupported targets,
which allows us to compile to more exotic targets.
2025-05-29 12:26:50 +02:00
Felix Lange
8712a2cdba
.travis.yml: remove master branch push builds (#31927)
Release artefact building has been migrated to another system (Gitea),
so we can finally stop using Travis CI. However, in order to have a
fail-safe for the release, I'm leaving the config in and it will still
trigger builds on Travis for tagged releases. That way, if our new
system fails to work for the next release, we will still have the option
of using Travis.
2025-05-29 12:23:38 +02:00
Arya Nair
d821f7f297
cmd/geth, cmd/utils: log prefunded account/key in ephemeral development mode (#31898)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR modifies the disclaimer/banner that is printed when starting up
Geth in dev mode:
* if the client is spun up in ephemeral dev mode with a keystore
override, the address of the first (prefunded) account is printed.
* if the client is spun up in ephemeral mode without a keystore
override, the genesis allocation contains a single static prefunded EOA
account. It's address and private key are logged.
* the banner is printed at the end of client initialization to make it
more prominent. Previously, it was logged towards the beginning of
client initialization and subsequent logging from startup filled the
terminal, pushing it out of view of the user.

Other change is that we now use a static prefunded dev account instead
of generating a random one when instantiating a new dev mode chain.

This is an example of what the banner looks like:
```
WARN [05-28|23:05:16.475] You are running Geth in --dev mode. Please note the following:
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475]   1. This mode is only intended for fast, iterative development without assumptions on
WARN [05-28|23:05:16.475]      security or persistence.
WARN [05-28|23:05:16.475]   2. The database is created in memory unless specified otherwise. Therefore, shutting down
WARN [05-28|23:05:16.475]      your computer or losing power will wipe your entire block data and chain state for
WARN [05-28|23:05:16.475]      your dev environment.
WARN [05-28|23:05:16.475]   3. A random, pre-allocated developer account will be available and unlocked as
WARN [05-28|23:05:16.475]      eth.coinbase, which can be used for testing. The random dev account is temporary,
WARN [05-28|23:05:16.475]      stored on a ramdisk, and will be lost if your machine is restarted.
WARN [05-28|23:05:16.475]   4. Mining is enabled by default. However, the client will only seal blocks if transactions
WARN [05-28|23:05:16.475]      are pending in the mempool. The miner's minimum accepted gas price is 1.
WARN [05-28|23:05:16.475]   5. Networking is disabled; there is no listen-address, the maximum number of peers is set
WARN [05-28|23:05:16.475]      to 0, and discovery is disabled.
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475]  Running in ephemeral mode.  The following account has been prefunded in the genesis:
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475]        Account
WARN [05-28|23:05:16.475]        ------------------
WARN [05-28|23:05:16.475]        0x71562b71999873db5b286df957af199ec94617f7 (10^49 ETH)
WARN [05-28|23:05:16.475]  
WARN [05-28|23:05:16.475]        Private Key
WARN [05-28|23:05:16.475]        ------------------
WARN [05-28|23:05:16.475]        0xb71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291
WARN [05-28|23:05:16.475] 
```

closes #31796

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2025-05-29 12:20:39 +08:00
Felix Lange
e9e4e8b05a
.gitea: run release build on tag push (#31924)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-05-28 23:19:13 +02:00
Felix Lange
3524499d55
.gitea: fix arm64 build (#31923) 2025-05-28 23:16:51 +02:00
Felix Lange
b065aa6740
.gitea: fix archive uploads and run PPA upload on release push (#31922) 2025-05-28 22:57:58 +02:00
Felix Lange
31d898d586
.gitea: fix apt update (#31921) 2025-05-28 22:40:26 +02:00