Commit graph

16512 commits

Author SHA1 Message Date
cui
d41dc92da9
core/state: using testing.B.Loop (#32658)
before:
go test -run=^$ -bench=. ./core/state/... 120.85s user 7.96s system 129%
cpu 1:39.13 tota

after:
go test -run=^$ -bench=. ./core/state/... 21.32s user 2.12s system 97%
cpu 24.006 total
2025-09-19 16:57:43 -06:00
cui
64c6de7747
p2p: using testing.B.Loop (#32664) 2025-09-19 16:38:36 -06:00
Csaba Kiraly
1601f398d4
core/txpool/blobpool: remove conversion in GetBlobs (#32578)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This disables blob proof conversion in `GetBlobs` by default, making it
conditional.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-19 16:21:15 +02:00
Marius van der Wijden
103b8b2ec5
crypto/bn256: switch to gnark again (#32659)
We recently update our default implementation to gnark in
https://github.com/ethereum/go-ethereum/pull/32024
Then we found a consensus issue and reverted it in
65d77c5129
We fixed the consensus issue and have been fuzzing it more since then in
https://github.com/ethereum/go-ethereum/pull/32055/files
https://github.com/ethereum/go-ethereum/pull/32065
https://github.com/ethereum/go-ethereum/pull/32055/files

So I think now is the time to update it back to gnark
2025-09-19 15:18:42 +02:00
Galoretka
9b730e1997
core/state: add missing address key in state_object log (#32676) 2025-09-19 21:13:32 +08:00
Felföldi Zsolt
b08b629818
beacon/blsync: test validated finality (#32633)
This PR improves `TestBlockSync` so that it also tests the finality
update validation.

Note: to this date four long and complex (at least partly AI generated)
PRs arrived that did something related to testing finality but honestly
we do not need a bloated "comprehensive" test to test a trivial feature
because maintaining these tests can also be a pain over the long term.
This PR adds some sufficient sanity checks to detect if finality ever
gets broken by a future change.
2025-09-19 14:07:10 +02:00
Felix Lange
2b3d617e04
internal/ethapi: skip tx gas limit check for calls (#32641)
This disables the tx gaslimit cap for eth_call and related RPC operations.

I don't like how this fix works. Ideally we'd be checking the tx
gaslimit somewhere else, like in the block validator, or any other place
that considers block transactions. Doing the check in StateTransition
means it affects all possible ways of executing a message.

The challenge is finding a place for this check that also triggers
correctly in tests where it is wanted. So for now, we are just combining
this with the EOA sender check for transactions. Both are disabled for
call-type messages.
2025-09-19 13:29:17 +02:00
Klimov Sergei
b9e2eb5944
beacon/config: fix LoadForks with non-string values (#32609)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Fixes a crash when loading the beacon chain config if new fields like
`BLOB_SCHEDULE: []` are present.
Previously, the config loader assumed all values were strings, causing
errors such as:

```
Fatal: Could not load beacon chain config '/network-configs/config.yaml': failed to parse beacon chain config file: yaml: unmarshal errors:
line 242: cannot unmarshal !!seq into string
```

This PR updates the parsing logic to handle non-string values correctly
and adds explicit validation for fork fields.
2025-09-19 01:30:00 +02:00
Long Vu
dce511c1e5
eth/filters, cmd: add config of eth_getLogs address limit (#32327)
Add cli configurable limit for the number of addresses allowed in
eth_getLogs filter criteria:
https://github.com/ethereum/go-ethereum/issues/32264
 
 Key changes:
- Added --rpc.getlogmaxaddrs CLI flag (default: 1000) to configure the
maximum number of addresses
- Updated ethconfig.Config with FilterMaxAddresses field for
configuration management
- Modified filter system to use the configurable limit instead of the
hardcoded maxAddresses constant
- Enhanced test coverage with new test cases for address limit
validation
- Removed hardcoded validation from JSON unmarshaling, moving it to
runtime validation

Please notice that I remove the check at FilterCriteria UnmarshalJSON
because the runtime config can not pass into this validation.

Please help review this change!

---------

Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-19 00:53:40 +02:00
rjl493456442
2a82964727
eth/catalyst, beacon/engine: enable BPO and Osaka on stateless APIs (#32636)
Addresses https://github.com/ethereum/go-ethereum/issues/32630

This pull request enables the stateless engine APIs for Osaka and the
following BPOs. Apart from that, a few more descriptions have been added
in the engine APIs, making it easier to follow the spec change.
2025-09-19 00:16:01 +02:00
Felix Lange
ab95477a65
build: update to execution-spec-tests v5.0.0 (#32592)
https://github.com/ethereum/execution-spec-tests/releases/tag/v5.0.0

As of this release, execution-spec-tests also contains all state tests
that were previously in ethereum/tests. We can probably remove the tests
submodule now. However, this would mean we are missing the pre-cancun
tests. Still need to figure out how to resolve this.

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
2025-09-18 22:58:40 +02:00
GarmashAlex
8a171dce1f
core/rawdb: report truncateErr in concurrent truncate failure (#32651)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-09-18 14:46:51 +08:00
lightclient
339cae81d8
core: fix fork readiness log (#32623)
When I implemented in #31340 I didn't expect multiple forks to be
configured at once, but this is exactly how BPOs are defined. This
updates the method to determine the next scheduled fork rather than the
last fork.
2025-09-18 06:28:03 +02:00
Guillaume Ballet
6492751355
cmd/keeper: disable GC for zkvm execution (#32638)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
ZKVMs are constrained environments that liberally allocate memory and
never release it. In this context, using the GC is only going to cause
issues down the road, and slow things down in any case.
2025-09-17 16:12:16 +02:00
Samuel Arogbonlo
fda09c7b1b
trie: add sub-trie iterator support (#32520)
- Adds `NodeIteratorWithPrefix()` method to support iterating only nodes
within a specific key prefix
- Adds `NodeIteratorWithRange()` method to support iterating only nodes
within a specific key range

Current `NodeIterator` always traverses the entire remaining trie from a
start position. For non-ethereum applications using the trie implementation, 
there's no way to limit iteration to just a subtree with a specific prefix.

  **Usage:**

  ```go
  // Only iterate nodes with prefix "key1"
  iter, err := trie.NodeIteratorWithPrefix([]byte("key1"))
  ```

Testing: Comprehensive test suite covering edge cases and boundary conditions.

Closes #32484

---------

Co-authored-by: gballet <guillaume.ballet@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-09-17 22:07:02 +08:00
rjl493456442
21769f3474
triedb/pathdb: generalize the history indexer (#32523)
This pull request is based on #32306 , is the second part for shipping
trienode history.

Specifically, this pull request generalize the existing index mechanism,
making is usable
by both state history and trienode history in the near future.
2025-09-17 15:57:16 +02:00
Guillaume Ballet
2d3704c4d8
core/stateless: add vmwitnessstats cli flag to report leaf stats + log to console (#32619)
The format that is currently reported by the chain isn't very useful, as
it gives an average for ALL the nodes, and not only the leaves, which
skews the results.

Also, until now there was no way to activate the reporting of errors.

We also decided that metrics weren't the right tool to report this data,
so we decided to dump it to the console if the flag is enabled. A better
system should be built, but for now, printing to the logs does the job.
2025-09-17 15:06:39 +02:00
Marius van der Wijden
f6ba50bf48
go.mod: update go-eth-kzg (#32640)
Updates go-eth-kzg:
https://github.com/crate-crypto/go-eth-kzg/releases/tag/v1.4.0
2025-09-17 12:33:44 +02:00
Marius van der Wijden
5ae61f9627
go.mod: update c-kzg (#32639)
Updates c-kzg to the latest release:
https://github.com/ethereum/c-kzg-4844/releases/tag/v2.1.3
2025-09-17 11:41:14 +02:00
Csaba Kiraly
a4c9b34730
p2p/discover: add waitForNodes
This improves the latency of lookups in small networks and test setups. When the local node table runs empty, the lookupIterator will trigger refresh to try and fill the table again.

The behaviour of lookup in case of an empty table is changed:
- Previously, lookup waited fixed 1 second before trying to continue the lookup
- Now, lookup on an empty table returns immediately, and a better wait implementation is part of the LookupIterator. It reinitialises the table, and continues the interator as soon as a node becomes available.
2025-09-17 10:27:35 +02:00
Csaba Kiraly
de9fb9722b
revert to using table parameter
using it.lookup.tab inside is unsafe

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-09-17 09:04:41 +02:00
Felix Lange
6a7f64e760
core/vm: use go-bigmodexpfix for modexp (#32576)
Some checks are pending
/ Windows Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
This changes the modexp precompile to use a fork of math/big with some
patches by @GottfriedHerold to improve worst-case performance.
2025-09-16 17:08:04 +02:00
Guillaume Ballet
03b77d1a49
core/stateless: API methods to get execution witness of block
This PR adds a new RPC call, which re-executes a block with stateless
mode activated, so that the witness data are collected and returned.

They are `debug_executionWitnessByHash` which takes in a block hash
and `debug_executionWitness` which takes in a block number.

---------

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2025-09-16 14:46:28 +02:00
VolodymyrBg
110b4e13c5
core/rawdb: fix typo in TestWriteAncientHeaderChain (#32587) 2025-09-16 20:27:20 +08:00
Csaba Kiraly
3589c0d59b
p2p/discover: expose timeout in lookupFailed
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	p2p/discover/lookup.go
2025-09-16 14:03:11 +02:00
VolodymyrBg
b340103e9d
core/tracing: remove unnecessary 'copy' field skip in TestAllHooksCalled (#32622)
This test iterated over Hooks fields and skipped a field named copy. The
Hooks struct has no such field, making the condition dead code.
2025-09-16 19:58:37 +08:00
Felix Lange
e48242bb69
cmd/evm/internal/t8ntool: use ApplyTransaction instead of ApplyMessage (#32618)
ApplyTransaction calls the hooks and builds the receipt, so some
duplicated code can be removed from t8ntool. Test cases have been
changed to add the `blockNumber` and `blockHash` in receipts, since
they were previously not filled in.
2025-09-16 10:09:06 +02:00
Guillaume Ballet
b05fe4aa64
cmd/keeper: add the keeper zkvm guest program (#32543)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Keeper is a zmvm guest program that runs the block transition.
It relies on the zkvm maker implementing `getInput`. For now, we only
provide a single implementation for the 'ziren' VM.

Why keeper?

In the _Mass Effect_ lore, the keepers are animals (?) who maintain the
citadel. Nothing is known from them, and attempts at tampering with them
have failed, as they self-destruct upon inquiry. They have a secret,
nefarious purpose that is only revealed later in the game series, don't
want any spoilers so I didn't dig deeper. All in all, a good metaphor
for zkvms.

---------

Co-authored-by: weilzkm <140377101+weilzkm@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-15 19:47:41 +02:00
Mark
89f364f7ed
go.mod: add tool section in module file (#32598)
This removes the tools.go workaround in favor of the official
tool management infrastructure, which was added in Go 1.24.
2025-09-15 18:46:18 +02:00
Felix Lange
6924eeaee0
eth/catalyst: allow fcuV3 for BPO forks (#32615)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This fixes an issue with the engine API after BPO forks have passed.
2025-09-15 16:26:09 +02:00
radik878
791e9fb23a
rlp: remove duplicate optionalAndTailField test case (#32614) 2025-09-15 16:16:06 +02:00
Marius van der Wijden
df0bd8960c
core/txpool/blobpool: migrate billy to new slot size (#31966)
Implements a migration path for the blobpool slotter

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-09-15 21:34:57 +08:00
Csaba Kiraly
4824942b97
core/txpool/blobpool: filter blob txs with sidecar version (#32577)
As a consequence of moving blob sidecar version migration code around,
we ended up building blocks with a mix of v0 and v1 blob transactions 
(different proof encoding in the sidecar).

This PR makes sure we are not building illegal blocks after Osaka. Blob 
migration is left for another PR.

Related issues and PRs:
- https://github.com/ethereum/go-ethereum/pull/31791
- https://github.com/ethereum/go-ethereum/pull/32347
- https://github.com/ethereum/go-ethereum/pull/31966
- https://github.com/ethereum/go-ethereum/issues/32235

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-09-15 20:48:59 +08:00
Galoretka
ec99444804
core/overlay: copy BaseRoot in TransitionState.Copy (#32613)
This change ensures TransitionState.Copy preserves BaseRoot. During a
Verkle transition, ts.BaseRoot is required to construct the overlay MPT
when ts.InTransition() is true. Previously, copies dropped BaseRoot,
risking an invalid zero-hash base trie and inconsistent behavior.
2025-09-15 15:26:16 +08:00
radik878
c2fcc27132
core/rawdb: fix misleading comment in HasTrieNode (#32599)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-09-15 10:45:50 +08:00
hero5512
a3062390f7
core/filtermaps: use slices.Sort to remove duplicated elements (#32602) 2025-09-15 10:42:14 +08:00
Antonio Viggiano
41f580f209
core/vm: fix typo in CLZ doc (#32604)
Some checks failed
/ Windows Build (push) Has been cancelled
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Docker Image (push) Has been cancelled
Fixes typo in CLZ doc.
2025-09-12 11:06:57 -06:00
Felix Lange
0643427965 p2p/discover: continue 2025-09-12 12:50:07 +02:00
Mobin Mohanan
5d09aa316f
accounts/abi/bind/v2: add Address method to BoundContract (#32559)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-09-12 12:14:47 +02:00
Felix Lange
68c18ede06
Update lookup.go 2025-09-12 11:34:44 +02:00
Csaba Kiraly
97afa2815b
Revert "p2p/discover: add test for lookup returning immediately"
This reverts commit 3eab4616a6.
2025-09-12 11:29:43 +02:00
Guillaume Ballet
25d6596cd5
.github: remove redundant regexp check for heading dot (#32597) 2025-09-12 11:08:47 +02:00
Csaba Kiraly
3eab4616a6
p2p/discover: add test for lookup returning immediately
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-09-12 10:59:29 +02:00
Csaba Kiraly
72d3e881b3
p2p/discover: clarify lookup behavior on empty table
We have changed this behavior, better clarify in comment.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-09-12 10:52:53 +02:00
lightclient
8a19582c8d
eth/catalyst: enable newpayloadV4 on BPOs (#32589)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Fixes an issue I accidentally introduced in #32579. Essentially, because
we gate the engine methods based on particular forks and I did not add
the BPOs as allowed forks to the method.
2025-09-11 22:09:56 +02:00
Felix Lange
8deb682a35
build: upgrade to go 1.25.1 (#32593) 2025-09-11 20:57:18 +02:00
Felix Lange
1c3703c888
.github: run tests with ci.go (#32590)
`ci.go` is the place to add custom build flags, build tags, etc. for the
test run. So we should use it for CI.
2025-09-11 20:15:51 +02:00
Felix Lange
cbf0b5bc92
go.mod, build: require go 1.24 and upgrade linter (#32584)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-09-11 13:07:04 +02:00
GarmashAlex
92fbbe63c8
ethdb/pebble: set metric namespace correctly (#32563)
Ensure Database.namespace is initialized in pebble.New(...). Without
this, the write-stall metrics registered in onWriteStallBegin/End are
emitted without the intended namespace prefix, while other Pebble
metrics use the provided constructor parameter. This aligns stall
metrics with the rest of the Pebble metric set and fixes inconsistent
metric naming.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-11 16:05:17 +08:00
lightclient
046e2cd7a4
params: add bpo forks to eth_config (#32579)
BPO forks should also be included in eth_config response.
2025-09-11 14:18:11 +08:00