Commit graph

3008 commits

Author SHA1 Message Date
Jared Wasinger
f61df31e1f core/vm: refactor call gas pricing such that Geth will not perform state access if the component of the call price which is independent from the state is not sufficient to cover the provided gas. 2025-12-09 19:03:17 +00:00
Jared Wasinger
0a8f3b0177 core/vm: for selfdestruct/sstore whose gas funcs are dependent on reading state, move readOnly call context check into gas func to avoid unecessary state reads in the gas handler in case where these are called in a static context. 2025-11-25 12:13:58 -08:00
Jared Wasinger
6b6d3f2f68 small refactors 2025-11-24 09:42:00 -08:00
Jared Wasinger
e364107006 remove logging statement 2025-11-23 21:44:29 -08:00
Jared Wasinger
2b003dc9a6 fix triggered by a 'contract creation -> revert -> creation of same contract' in the same transaction 2025-11-22 21:17:40 +08:00
Jared Wasinger
159bbcd831 minor refactor. instrument the bal tracer with some debug logging 2025-11-22 16:33:01 +08:00
Jared Wasinger
2614e20cea correctly set the error in IntermediateRoot of BALStateTransition 2025-11-18 15:53:25 +08:00
Jared Wasinger
b3d8591cb0 more cleanup 2025-11-13 01:44:32 +08:00
Jared Wasinger
74ca164123 cleanup bal state transition 2025-11-12 17:51:01 +08:00
Jared Wasinger
abd8612b1d add state prefetch timer 2025-11-12 15:16:25 +08:00
Jared Wasinger
2721e8a1a2 attempt to optimize state root calculation for BALs 2025-11-12 14:51:54 +08:00
Jared Wasinger
b24306eacc fix some lint issues 2025-10-28 12:35:00 +08:00
Jared Wasinger
b44c182cbd more odds-and-ends 2025-10-28 12:09:44 +08:00
Jared Wasinger
9f9f5af6fa fix up odds-and-ends 2025-10-28 12:09:33 +08:00
Jared Wasinger
e481a1a7d1 fix json encoding of BAL for debug API: make it human-readable again 2025-10-21 19:36:50 +08:00
Jared Wasinger
2994e096c6 update TODO in the code. remove old changes from the statedb unit tests 2025-10-20 18:02:41 +08:00
Jared Wasinger
068757faea small fixups 2025-10-20 16:52:16 +08:00
Jared Wasinger
0de169fd31 apply same changes to hook invocation regarding nonce/code update for legacy selfdestruct 2025-10-17 14:47:27 +08:00
Jared Wasinger
6610c2b3cc fix errors from rebase 2025-10-17 13:39:44 +08:00
Jared Wasinger
dfd2e44701 use amsterdam blob schedule for amsterdam fork. remove unused struct 2025-10-17 13:31:48 +08:00
Jared Wasinger
06d62a54ce general cleanup. note bug which I'm waiting on test case in order to push fix for it. 2025-10-17 13:31:48 +08:00
Jared Wasinger
77a98936ed clarify case about selfdestructing initcode 2025-10-17 13:31:48 +08:00
Jared Wasinger
58eac317b1 ensure that CodeChange tracer hooks don't get called for noop cases where the cur and prev code is the same 2025-10-17 13:31:48 +08:00
Jared Wasinger
eb7f934f26 minor cleanups 2025-10-17 13:31:48 +08:00
Jared Wasinger
ca6ba13d1b ensure tracers don't call CodeChange with prevCode==curCode (was done in the case of a failed contract creation). remove unecessary error check and panic 2025-10-17 13:31:48 +08:00
Jared Wasinger
c2c132d6a0 more documentation 2025-10-17 13:31:48 +08:00
Jared Wasinger
68a4ecaf1f refactor: move access list index mutations/read construction within the ConstructionAccessList and don't expose it publicly 2025-10-17 13:31:46 +08:00
Gary Rong
7410413eec core/state, core/tracing: add state read hooks 2025-10-17 13:29:38 +08:00
Gary Rong
af34c01b90 core/tracing: reshape the comments in core/tracing 2025-10-17 13:28:51 +08:00
Jared Wasinger
b33cf06ce7 all: add block access list construction via flag --experimentalbal. When enabled, post-Cancun blocks which lack access lists will have them constructed on execution during import. When importing blocks which contain access lists, transaction execution and state root calculation is performed in parallel. 2025-10-17 13:28:04 +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
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
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
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
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
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
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
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
sashass1315
168d699fba
core/rawdb: remove duplicated type storedReceiptRLP (#32820)
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
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-10-08 11:29:51 +02:00
hero5512
fc8c8c1314
core: refactor StateProcessor to accept ChainContext interface (#32739)
This pr implements https://github.com/ethereum/go-ethereum/issues/32733
to make StateProcessor more customisable.

## Compatibility notes

This introduces a breaking change to users using geth EVM as a library.
The `NewStateProcessor` function now takes one parameter which has the
chainConfig embedded instead of 2 parameters.
2025-10-02 14:34:06 +02:00
Martin HS
057667151b
core/types, trie: reduce allocations in derivesha (#30747)
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
Alternative to #30746, potential follow-up to #30743 . This PR makes the
stacktrie always copy incoming value buffers, and reuse them internally.

Improvement in #30743:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
                          │ derivesha.1 │             derivesha.2              │
                          │   sec/op    │    sec/op     vs base                │
DeriveSha200/stack_trie-8   477.8µ ± 2%   430.0µ ± 12%  -10.00% (p=0.000 n=10)

                          │ derivesha.1  │             derivesha.2              │
                          │     B/op     │     B/op      vs base                │
DeriveSha200/stack_trie-8   45.17Ki ± 0%   25.65Ki ± 0%  -43.21% (p=0.000 n=10)

                          │ derivesha.1 │            derivesha.2             │
                          │  allocs/op  │ allocs/op   vs base                │
DeriveSha200/stack_trie-8   1259.0 ± 0%   232.0 ± 0%  -81.57% (p=0.000 n=10)

```
This PR further enhances that: 

```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
                          │ derivesha.2  │          derivesha.3           │
                          │    sec/op    │    sec/op     vs base          │
DeriveSha200/stack_trie-8   430.0µ ± 12%   423.6µ ± 13%  ~ (p=0.739 n=10)

                          │  derivesha.2  │             derivesha.3              │
                          │     B/op      │     B/op      vs base                │
DeriveSha200/stack_trie-8   25.654Ki ± 0%   4.960Ki ± 0%  -80.67% (p=0.000 n=10)

                          │ derivesha.2 │            derivesha.3             │
                          │  allocs/op  │ allocs/op   vs base                │
DeriveSha200/stack_trie-8   232.00 ± 0%   37.00 ± 0%  -84.05% (p=0.000 n=10)
```
So the total derivesha-improvement over *both PRS* is: 
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
                          │ derivesha.1 │             derivesha.3              │
                          │   sec/op    │    sec/op     vs base                │
DeriveSha200/stack_trie-8   477.8µ ± 2%   423.6µ ± 13%  -11.33% (p=0.015 n=10)

                          │  derivesha.1  │             derivesha.3              │
                          │     B/op      │     B/op      vs base                │
DeriveSha200/stack_trie-8   45.171Ki ± 0%   4.960Ki ± 0%  -89.02% (p=0.000 n=10)

                          │ derivesha.1  │            derivesha.3             │
                          │  allocs/op   │ allocs/op   vs base                │
DeriveSha200/stack_trie-8   1259.00 ± 0%   37.00 ± 0%  -97.06% (p=0.000 n=10)
```

Since this PR always copies the incoming value, it adds a little bit of
a penalty on the previous insert-benchmark, which copied nothing (always
passed the same empty slice as input) :

```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/trie
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
             │ stacktrie.7  │          stacktrie.10          │
             │    sec/op    │    sec/op     vs base          │
Insert100K-8   88.21m ± 34%   92.37m ± 31%  ~ (p=0.280 n=10)

             │ stacktrie.7  │             stacktrie.10             │
             │     B/op     │     B/op      vs base                │
Insert100K-8   3.424Ki ± 3%   4.581Ki ± 3%  +33.80% (p=0.000 n=10)

             │ stacktrie.7 │            stacktrie.10            │
             │  allocs/op  │ allocs/op   vs base                │
Insert100K-8    22.00 ± 5%   26.00 ± 4%  +18.18% (p=0.000 n=10)
```

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-10-01 10:05:49 +02:00
Galoretka
2037c53e7a
core/state: correct expected value in TestMessageCallGas (#32780)
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-30 10:11:09 +08:00
MozirDmitriy
c1e9d78f1f
core/txpool: remove unused signer field from TxPool (#32787)
The TxPool.signer field was never read and each subpool (legacy/blob)
maintains its own signer instance. This field remained after txpool
refactoring into subpools and is dead code. Removing it reduces
confusion and simplifies the constructor.
2025-09-30 10:07:54 +08:00
VolodymyrBg
1cfe624d03
core/rawdb: update comments (#32668)
- Replace outdated NewFreezer doc that referenced map[string]bool/snappy
toggle with accurate description of -map[string]freezerTableConfig
(noSnappy, prunable).
- Fix misleading field comment on freezerTable.config that spoke as if
it were a boolean (“if true”), clarifying it’s a struct and noting
compression is non-retroactive.
2025-09-29 14:45:00 +02:00
Felix Lange
0977a02ec1
params: schedule Osaka/BPO1/BPO2 for testnets (#32735)
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
Timestamps taken from:

- Holesky:
https://github.com/eth-clients/holesky/blob/main/metadata/genesis.json
- Sepolia:
https://github.com/eth-clients/sepolia/blob/main/metadata/genesis.json
- Hoodi:
https://github.com/eth-clients/hoodi/blob/main/metadata/genesis.json
2025-09-25 18:07:33 +02:00
Delweng
bacc1504ba
core/txpool: add eip2681 check for incoming transactions (#32726)
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-25 13:15:12 +02:00
Csaba Kiraly
89158aa64e
core/txpool/blobpool: convert and add one-by-one (#32718)
This is a small improvement on #32656 in case Add was called with
multiple type 3 transactions, adding transactions to the pool one-by-one
as they are converted.

Announcement to peers is still done in a batch.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-09-25 10:27:23 +02:00
lightclient
965ffff9ac
all: add bpo1 and bpo2 overrides (#32737)
This adds overrides to the cli for BPO1 and BPO2.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-09-25 10:21:41 +02:00
Felix Lange
ad55a3e07f
core/txpool/blobpool: fork boundary conversion 3 (#32716)
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 implements the conversion of existing blob transactions to the new proof 
version. Conversion is triggered at the Osaka fork boundary. The conversion is 
designed to be idempotent, and may be triggered multiple times in case of a reorg 
around the fork boundary. 

This change is the last missing piece that completes our strategy for the blobpool 
conversion. After the Osaka fork,

- new transactions will be converted on-the-fly upon entry to the pool
- reorged transactions will be converted while being reinjected
- (this change) existing transactions will be converted in the background

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-09-24 20:03:17 +02:00