go-ethereum/core/state
Marius van der Wijden 34f00a42f8
core/state: add GetStateAndCommittedState (#31585)
Improves the SSTORE gas calculation a bit. Previously we would pull up
the state object twice. This is okay for existing objects, since they
are cached, however non-existing objects are not cached, thus we needed
to go through all 128 diff layers as well as the disk layer twice, just
for the gas calculation

```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/vm
cpu: AMD Ryzen 9 5900X 12-Core Processor            
               │ /tmp/old.txt │            /tmp/new.txt             │
               │    sec/op    │   sec/op     vs base                │
Interpreter-24   1118.0n ± 2%   602.8n ± 1%  -46.09% (p=0.000 n=10)
```

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-07-03 13:19:34 +08:00
..
pruner all: clean up goerli flag and config (#30289) 2024-08-20 15:59:48 +02:00
snapshot triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
access_events.go core/state, core/vm: update stateless gas costs to follow the verkle-gen-7 testnet (#31014) 2025-05-15 20:43:52 +08:00
access_events_test.go core/state, core/vm: update stateless gas costs to follow the verkle-gen-7 testnet (#31014) 2025-05-15 20:43:52 +08:00
access_list.go core/state: remove pointless wrapper functions (#30891) 2024-12-11 11:05:59 +01:00
database.go core/state: expose the state reader stats (#31998) 2025-06-21 12:58:04 +08:00
database_history.go core, eth, triedb: serve historical states over RPC (#31161) 2025-06-25 16:50:54 +08:00
dump.go core, consensus/beacon: defer trie resolution (#31725) 2025-06-25 09:42:11 +08:00
iterator.go core, consensus/beacon: defer trie resolution (#31725) 2025-06-25 09:42:11 +08:00
iterator_test.go core/state: state reader abstraction (#29761) 2024-09-05 13:10:47 +03:00
journal.go core/state: fix copy of storageChange (#31874) 2025-05-23 13:10:10 +02:00
metrics.go core/rawdb,state: add preimage miss metric (#31295) 2025-03-07 11:23:19 +01:00
reader.go core/state: expose the state reader stats (#31998) 2025-06-21 12:58:04 +08:00
state_object.go core, consensus/beacon: defer trie resolution (#31725) 2025-06-25 09:42:11 +08:00
state_object_test.go build: use golangci-lint (#20295) 2019-11-18 10:49:17 +02:00
state_test.go core, consensus/beacon: defer trie resolution (#31725) 2025-06-25 09:42:11 +08:00
statedb.go core/state: add GetStateAndCommittedState (#31585) 2025-07-03 13:19:34 +08:00
statedb_fuzz_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
statedb_hooked.go core/state: add GetStateAndCommittedState (#31585) 2025-07-03 13:19:34 +08:00
statedb_hooked_test.go core/tracing: stringer for gas and nonce change reasons (#31234) 2025-02-28 12:53:56 +01:00
statedb_test.go core, consensus/beacon: defer trie resolution (#31725) 2025-06-25 09:42:11 +08:00
stateupdate.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
sync.go core,eth,internal: fix typo (#29024) 2024-02-20 19:42:48 +08:00
sync_test.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
transient_storage.go core/state: better randomized testing (postcheck) on journalling (#29627) 2024-04-25 09:56:25 +02:00
trie_prefetcher.go metrics, cmd/geth: change init-process of metrics (#30814) 2024-12-10 13:27:29 +01:00
trie_prefetcher_test.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00