Commit graph

16478 commits

Author SHA1 Message Date
cui
6608a2aafd
core/types: remove unused ErrInvalidTxType var (#32989)
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
The var `ErrInvalidTxType` is never used in the code base.
2025-10-21 09:49:43 -06:00
lightclient
407d9faf71
cmd/geth: add flag to set genesis (#32844)
This PR is an alternative to #32556.

Instead of trying to be smart and reuse `geth init`, we can introduce a
new flag `--genesis` that loads the `genesis.json` from file into the
`Genesis` object in the same path that the other network flags currently
work in.

Question: is something like `--genesis` enough to start deprecating
`geth init`?

--

```console
$ geth --datadir data --hoodi
..
INFO [10-06|22:37:11.202]  - BPO2:                        @1762955544
..
$ geth --datadir data --genesis genesis.json
..
INFO [10-06|22:37:27.988]  - BPO2:                       @1862955544
..
```

Pull the genesis [from the
specs](https://raw.githubusercontent.com/eth-clients/hoodi/refs/heads/main/metadata/genesis.json)
and modify one of the BPO timestamps to simulate a shadow fork.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-10-21 22:10:45 +08:00
rjl493456442
0a8b820725
triedb/pathdb: make batch with pre-allocated size (#32914)
In this PR, the database batch for writing the history index data is
pre-allocated.

It's observed that database batch repeatedly grows the size of the
mega-batch,
causing significant memory allocation pressure. This approach can
effectively
mitigate the overhead.
2025-10-21 13:11:36 +02:00
rjl493456442
79b6a56d3a
core/state: prevent SetCode hook if contract code is not changed (#32980)
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 PR prevents the SetCode hook from being called when the contract
code
remains unchanged.

This situation can occur in the following cases:
- The deployed runtime code has zero length
- An EIP-7702 authorization attempt tries to unset a non-delegated
account
- An EIP-7702 authorization attempt tries to delegate to the same
account
2025-10-21 16:03:56 +08:00
Kyrin
d73bfeb3d9
core/txpool: Initialize journal writer for tx tracker (#32921)
Previously, the journal writer is nil until the first time rejournal
(default 1h), which means during this period, txs submitted to this node
are not written into journal file (transactions.rlp). If this node is
shutdown before the first time rejournal, then txs in pending or queue
will get lost.

Here, this PR initializes the journal writer soon after launch to solve
this issue.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-10-21 15:41:38 +08:00
Marius van der Wijden
b81f03e8ff
params: enable osaka on dev mode (#32917)
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
enables the osaka fork on dev mode

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-10-20 17:24:07 +02:00
Guillaume Ballet
b1809d13d1
cmd/keeper: use the ziren keccak precompile (#32816)
Uses the go module's `replace` directive to delegate keccak computation
to precompiles.

This is still in draft because it needs more testing. Also, it relies on
a PR that I created, that hasn't been merged yet.

_Note that this PR doesn't implement the stateful keccak state
structure, and it reverts to the current behavior. This is a bit silly
since this is what is used in the tree root computation. The runtime
doesn't currently export the sponge. I will see if I can fix that in a
further PR, but it is going to take more time. In the meantime, this is
a useful first step_
2025-10-20 11:52:02 +02:00
jwasinger
b6a4ac9961
core/vm: don't call SetCode after contract creation if initcode didn't return anything (#32916)
The code change is a noop here, and the tracing hook shouldn't be
invoked if the account code doesn't actually change.
2025-10-20 11:51:29 +02:00
maskpp
cfb311148c
eth/filters: avoid rebuild the hash map multi times (#32965)
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-10-20 16:18:17 +08:00
cui
69df6bb8d5
core/types: prealloc map in HashDifference as in TxDifference (#32946) 2025-10-20 10:35:14 +08:00
hero5512
11c0fb98af
triedb/pathdb: fix index out of range panic in decodeSingle (#32937)
Fixes TestCorruptedKeySection flaky test failure.
https://github.com/ethereum/go-ethereum/actions/runs/18600235182/job/53037084761?pr=32920
2025-10-20 10:29:46 +08:00
Bosul Mun
88576c52e2
eth/fetcher: remove dangling peers from alternates (#32947)
This PR removes dangling peers in `alternates` map

In the current code, a dropped peer is removed from alternates for only
the specific transaction hash it was requesting. If that peer is listed
as an alternate for other transaction hashes, those entries still stick
around in alternates/announced even though that peer already got
dropped.
2025-10-20 10:26:55 +08:00
Bosul Mun
a9e66262af
eth/fetcher: add metrics for tracking slow peers (#32964)
This PR introduces two new metrics to monitor slow peers
- One tracks the number of slow peers.
- The other measures the time it takes for those peers to become
"unfrozen"

These metrics help with monitoring and evaluating the need for future
optimization of the transaction fetcher and peer management, for example i
n peer scoring and prioritization.

Additionally, this PR moves the fetcher metrics into a separate file, 
`eth/fetcher/metrics.go`.
2025-10-20 10:10:58 +08:00
CertiK
0ec63272bf
cmd/utils: use maximum uint64 value for receipt chain insertion (#32934)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
2025-10-18 19:54:56 +08:00
rjl493456442
342285b139
eth, internal: add blob conversion for SendRawTransactionSync (#32930)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
2025-10-17 13:34:35 +08:00
ucwong
0a2c21acd5
eth/ethconfig : fix eth generate config (#32929) 2025-10-17 10:35:44 +08:00
Youssef Azzaoui
b373d797d8
core/state: state copy bugfixes with Verkle Trees (#31696)
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 change addresses critical issues in the state object duplication
process specific to Verkle trie implementations. Without these
modifications, updates to state objects fail to propagate correctly
through the trie structure after a statedb copy operation, leading to
inaccuracies in the computation of the state root hash.

---------

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2025-10-16 19:19:44 +02:00
aodhgan
ff54ca02de
internal/ethapi: add eth_SendRawTransactionSync (#32830)
New RPC method eth_sendRawTransactionSync(rawTx, timeoutMs?) that
submits a signed tx and blocks until a receipt is available or a timeout
elapses.

Two CLI flags to tune server-side limits:

--rpc.txsync.defaulttimeout (default wait window)

--rpc.txsync.maxtimeout (upper bound; requests are clamped)

closes https://github.com/ethereum/go-ethereum/issues/32094

---------

Co-authored-by: aodhgan <gawnieg@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-10-16 17:34:47 +02:00
hero5512
c37bd67019
ethclient: add support for eth_simulateV1 (#32856)
Adds ethclient support for the eth_simulateV1 RPC method, which allows
simulating transactions on top of a base state without making changes to
the blockchain.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-10-16 17:32:55 +02:00
Galoretka
5c535074ac
cmd/geth: log current key in expandVerkle instead of keylist[0] (#32689)
Some checks are pending
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
Fix logging in the verkle dump path to report the actual key being
processed.
Previously, the loop always logged keylist[0], which misled users when
expanding multiple keys and made debugging harder. This change aligns
the
log with the key passed to root.Get, improving traceability and
diagnostics.
2025-10-16 13:49:41 +02:00
Felix Lange
367b5fbe42 version: begin v1.16.6 release cycle 2025-10-16 09:59:52 +02:00
Felix Lange
32ccb548d3 version: release go-ethereum v1.16.5 stable 2025-10-16 09:58:47 +02:00
Felix Lange
7c107c2691
p2p/discover: remove hot-spin in table refresh trigger (#32912)
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 a regression introduced in #32518. In that PR, we removed the
slowdown logic that would throttle lookups when the table runs empty.
Said logic was originally added in #20389.

Usually it's fine, but there exist pathological cases, such as hive
tests, where the node can only discover one other node, so it can only
ever query that node and won't get any results. In cases like these, we
need to throttle the creation of lookups to avoid crazy CPU usage.
2025-10-15 11:51:33 +02:00
Delweng
40505a9bc0
eth/protocols/eth: reject message containing duplicated txs and drop peer (#32728)
Drop peer if sending the same transaction multiple times in a single message.

Fixes https://github.com/ethereum/go-ethereum/issues/32724


---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-10-15 10:24:48 +02:00
mishraa-G
3cfc33477b
rpc: fix flaky test TestServerWebsocketReadLimit (#32889) 2025-10-15 15:39:00 +08:00
Felix Lange
f6064f32c4
internal/ethapi: convert legacy blobtx proofs in sendRawTransaction (#32849)
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 adds a temporary conversion path for blob transactions with legacy
proof sidecar. This feature will activate after Fusaka. We will phase
this out when the fork has sufficiently settled and client side
libraries have been upgraded to send the new proofs.
2025-10-14 14:40:54 +02:00
cui
55a53208b7
accounts/abi: check presence of payable fallback or receive before proceeding with transfer (#32374)
remove todo
2025-10-14 17:07:48 +08:00
rjl493456442
e03d97a420
core/txpool/legacypool: fix pricedList updates (#32906)
This pr addresses a few issues brought by the #32270 

- Add updates to pricedList after dropping transactions.
- Remove redundant deletions in queue.evictList, since
pool.removeTx(hash, true, true) already performs the removal.
- Prevent duplicate addresses during promotion when Reset is not nil.
2025-10-14 08:40:04 +02:00
Csaba Kiraly
fb8d2298b6
eth: do not warn on switching from snap sync to full sync (#32900)
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 happens normally after a restart, so it is better to use Info level
here.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-10-14 11:03:31 +08:00
Csaba Kiraly
00f6f2b32f
eth/catalyst: remove useless log on enabling Engine API (#32901) 2025-10-14 11:01:43 +08:00
Guillaume Ballet
52c484de86
triedb/pathdb: catch int conversion overflow in 32-bit (#32899)
The limit check for `MaxUint32` is done after the cast to `int`. On 64
bits machines, that will work without a problem. On 32 bits machines,
that will always fail. The compiler catches it and refuses to build.

Note that this only fixes the compiler build. ~~If the limit is above
`MaxInt32` but strictly below `MaxUint32` then this will fail at runtime
and we have another issue.~~ I checked and this should not happen during
regular execution, although it might happen in tests.
2025-10-14 09:23:05 +08:00
Delweng
6337577434
p2p/discover: wait for bootstrap to be done (#32881)
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 ensures the node is ready to accept other nodes into the
table before it is used in a test.

Closes #32863
2025-10-13 19:58:50 +02:00
Felföldi Zsolt
b28241ba85
cmd/workload: filter fuzzer test (#31613)
This PR adds a `filterfuzz` subcommand to the workload tester that
generates requests similarly to `filtergen` (though with a much smaller
block length limit) and also verifies the results by retrieving all
block receipts in the range and locally filtering out relevant results.
Unlike `filtergen` that operates on the finalized chain range only,
`filterfuzz` does check the head region, actually it seeds a new query
at every new chain head.
2025-10-13 19:21:01 +02:00
Marius van der Wijden
7b693ea17c
core/txpool/legacypool: move queue out of main txpool (#32270)
This PR move the queue out of the main transaction pool.
For now there should be no functional changes.
I see this as a first step to refactor the legacypool and make the queue
a fully separate concept from the main pending pool.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-10-13 19:07:36 +02:00
cui
b87581f297
p2p/enode: optimize DistCmp (#32888)
This speeds up DistCmp by 75% through using 64-bit operations instead of
byte-wise XOR.
2025-10-13 16:16:07 +02:00
cui
5c6ba6b400
p2p/enode: optimize LogDist (#32887)
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 speeds up LogDist by 75% using 64-bit operations instead
of byte-wise XOR.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-10-13 14:00:43 +02:00
Delweng
a7359ceb69
triedb, core/rawdb: implement the partial read in freezer (#32132)
This PR implements the partial read functionalities in the freezer, optimizing
the state history reader by resolving less data from freezer.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-10-13 19:40:03 +08:00
Lewis
bc0a21a1d5
eth/filters: uninstall subscription in filter apis on error (#32894)
Fix https://github.com/ethereum/go-ethereum/issues/32893.

In the previous https://github.com/ethereum/go-ethereum/pull/32794, it
only handles the pending tx filter, while there are also head and log
filters. This PR applies the patch to all filter APIs and uses `defer`
to maintain code consistency.
2025-10-13 13:10:44 +02:00
Delweng
85e9977fae
p2p: rm unused var seedMinTableTime (#32876) 2025-10-13 16:40:08 +08:00
cui
2010781c29
core/types: optimize MergeBloom by using bitutil (#32882)
```
goos: darwin
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: VirtualApple @ 2.50GHz
                                 │   old.txt    │               new.txt               │
                                 │    sec/op    │   sec/op     vs base                │
CreateBloom/small-createbloom-10    1.676µ ± 4%   1.646µ ± 1%   -1.76% (p=0.000 n=10)
CreateBloom/large-createbloom-10    164.8µ ± 3%   164.3µ ± 0%        ~ (p=0.247 n=10)
CreateBloom/small-mergebloom-10    231.60n ± 0%   68.00n ± 0%  -70.64% (p=0.000 n=10)
CreateBloom/large-mergebloom-10    21.803µ ± 3%   5.107µ ± 1%  -76.58% (p=0.000 n=10)
geomean                             6.111µ        3.113µ       -49.06%

                                 │    old.txt     │                new.txt                │
                                 │      B/op      │     B/op      vs base                 │
CreateBloom/small-createbloom-10     112.0 ± 0%       112.0 ± 0%       ~ (p=1.000 n=10) ¹
CreateBloom/large-createbloom-10   10.94Ki ± 0%     10.94Ki ± 0%       ~ (p=0.474 n=10)
CreateBloom/small-mergebloom-10      0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
CreateBloom/large-mergebloom-10      0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                         ²                 +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                 │   old.txt    │               new.txt               │
                                 │  allocs/op   │ allocs/op   vs base                 │
CreateBloom/small-createbloom-10   6.000 ± 0%     6.000 ± 0%       ~ (p=1.000 n=10) ¹
CreateBloom/large-createbloom-10   600.0 ± 0%     600.0 ± 0%       ~ (p=1.000 n=10) ¹
CreateBloom/small-mergebloom-10    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
CreateBloom/large-mergebloom-10    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                       ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```
2025-10-13 16:39:10 +08:00
Luke Ma
a3aae29845
node: fix error condition in gzipResponseWriter.init() (#32896) 2025-10-13 15:26:35 +08:00
10gic
659342a523
ethclient: add SubscribeTransactionReceipts (#32869)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
Add `SubscribeTransactionReceipts` for ethclient. This is a complement
to https://github.com/ethereum/go-ethereum/pull/32697.
2025-10-10 11:47:33 +02:00
rjl493456442
de24450dbf
core/rawdb, triedb/pathdb: introduce trienode history (#32596)
It's a pull request based on the #32523 , implementing the structure of
trienode history.
2025-10-10 14:51:27 +08:00
cui
ed264a1f19
eth/protocols/snap: optimize incHash (#32748) 2025-10-10 13:48:25 +08:00
Csaba Kiraly
4d6d5a3abf
core/txpool/legacypool: fix validTxMeter to count transactions (#32845)
invalidTxMeter was counting txs, while validTxMeter was counting
accounts. Better make the two comparable.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-10-10 13:40:10 +08:00
10gic
11208553dd
eth/filters: add transactionReceipts subscription (#32697)
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
- Introduce a new subscription kind `transactionReceipts` to allow clients to
  receive transaction receipts over WebSocket as soon as they are available.
- Accept optional `transactionHashes` filter to subscribe to receipts for specific
  transactions; an empty or omitted filter subscribes to all receipts.
- Preserve the same receipt format as returned by `eth_getTransactionReceipt`.
- Avoid additional HTTP polling, reducing RPC load and latency.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-10-09 14:14:53 +02:00
CertiK
a1b8e4880d
eth/filters: terminate pending tx subscription on error (#32794)
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 issue #32793. When the pending tx subscription ends, the filter
is removed from `api.filters`, but it is not terminated. There is no other 
way to terminate it, so the subscription will leak, and potentially block
the producer side.
2025-10-09 11:34:30 +02:00
phrwlk
695c1445ab
core/rawdb: correct misleading comments for state history accessors (#32783)
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-10-09 08:59:06 +08:00
Alexey Osipov
e42af536c5
cmd/devp2p/internal/ethtest: accept responses in any order (#32834)
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
In both `TestSimultaneousRequests` and `TestSameRequestID`, we send two
concurrent requests. The client under test is free to respond in either
order, so we need to handle responses both ways.

Also fixes an issue where some generated blob transactions didn't have
any blobs.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-10-08 19:23:44 +02:00
Nicolas Gotchac
064ab701ea
eth/protocols/eth: use BlockChain interface in Handshake (#32847) 2025-10-08 12:50:03 +02:00