Commit graph

1977 commits

Author SHA1 Message Date
Daniel Liu
e2edc41b50
all: mv loggers to eth/tracers #23892 (#1269) 2025-09-03 15:35:28 +08:00
Daniel Liu
aca2149f12
core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106)
* core: use TryGetAccount to read where TryUpdateAccount has been used to write

* Gary's review feedback

* implement Gary's suggestion

* fix bug + rename NewSecure into NewStateTrie

* trie: add backwards-compatibility aliases for SecureTrie

* Update database.go

* make the linter happy

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-03 15:34:11 +08:00
Daniel Liu
cab1c19cd2
core/state: mark account as dirty when resetObject occurs #27339 (#1224)
This changes the journal logic to mark the state object dirty immediately when it
is reset.

We're mostly adding this change to appease the fuzzer. Marking it dirty immediately
makes no difference in practice because accounts will always be modified by EVM
right after creation.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-08-31 16:04:51 +08:00
Daniel Liu
6c5c8c13de
core, trie: rework trie committer #25320 (#1103)
* all: rework trie and trie committer

* all: get rid of internal cache in trie

* all: fixes

* trie: polish

* core, trie: address comments

* trie: fix imports

* core/state: address comments

* core/state/snapshot: polish

* trie: remove unused code

* trie: update tests

* trie: don't set db as nil

* trie: address comments

* trie: unskip test

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-08-31 15:58:48 +08:00
Daniel Liu
031ea75eca
eth/tracers: package restructuring #23857 (#1266) 2025-08-29 05:26:36 +08:00
Daniel Liu
2dcec889e6
core/state: do not ignore null addr while iterative dump #27320 (#1223)
fixes bug which caused the zero-address to be ignored during an iterative state-dump.

---------

Co-authored-by: Park Changwan <pcw109550@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-08-29 05:25:15 +08:00
Daniel Liu
bbc4612d9f
core/state: remove notion of fake storage #24916 (#1219) 2025-08-29 05:24:28 +08:00
Daniel Liu
3fed9ebeb8
core, eth, trie: rework preimage store #25287 (#1099)
* core, trie, eth, cmd: rework preimage store

* trie: address comment

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-08-29 05:22:44 +08:00
Daniel Liu
0be5580b98
all: use big.Sign to compare with zero #29490 (#1387) 2025-08-28 18:56:39 +08:00
Daniel Liu
3926b08074
core/state: maintain destruction flag by default #26371 (#1218) 2025-08-28 18:51:36 +08:00
Daniel Liu
152e3d9923
core/state: return error when storage trie can't be opened #26350 (#1216)
This changes the StorageTrie method to return an error when the trie
is not available. It used to return an 'empty trie' in this case, but that's
not possible anymore under PBSS.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-08-26 15:31:00 +08:00
Daniel Liu
4a4de2319f
core/state: fix typos and comments (#1206)
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2025-08-26 15:22:37 +08:00
Daniel Liu
18d2dbad89
core, trie: port snap sync changes #24898 (#1096)
core, eth, les, trie: rework snap sync

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-08-26 15:20:39 +08:00
Daniel Liu
6f36533962
all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
Daniel Liu
144fbbf35a
core: reset txpool on sethead #26392 (#1373) 2025-08-22 16:45:41 +08:00
Daniel Liu
516883d14c
all: snapshot dump + unify with trie dump #22795 (#1205) 2025-08-22 16:39:28 +08:00
Daniel Liu
d52bfaa5ca
all: introduce trie owner notion #24750 (#1090)
* cmd, core/state, light, trie, eth: add trie owner notion

* all: refactor

* tests: fix goimports

* core/state/snapshot: fix ineffasigns

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-08-22 16:37:39 +08:00
Daniel Liu
ee81b721fc
core, trie: implement trie tracer #24403 (#1088)
Trie tracer is an auxiliary tool to capture all deleted nodes
which can't be captured by trie.Committer. The deleted nodes
can be removed from the disk later.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-08-21 13:38:56 +08:00
Daniel Liu
0c57a6c64c
core/state: remove toAddr helper in tests #22772 (#1203)
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
2025-08-21 13:38:23 +08:00
Daniel Liu
da624be994
core/state: fix panic in state dumping #22225 (#1202)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-08-21 13:37:51 +08:00
Daniel Liu
06d94520ba
core/state: fix some comments #21450 (#1201) 2025-08-21 13:36:45 +08:00
Daniel Liu
eaa1452a53
core/state: add state transition tool for testing #20958 (#1200) 2025-08-20 16:30:34 +08:00
Daniel Liu
9c6816eab6
core/vm: make time field use uint64 #26474 (#1319) 2025-08-20 15:22:06 +08:00
Daniel Liu
9cad0a0cc0
all: create global hasher pool #31769 (#1233)
This PR creates a global hasher pool that can be used by all packages.
It also removes a bunch of the package local pools.

It also updates a few locations to use available hashers or the global
hashing pool to reduce allocations all over the codebase.
This change should reduce global allocation count by ~1%

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-08-20 15:11:09 +08:00
Daniel Liu
628e1e52bb
core/state: make GetCodeSize mirror GetCode implementation wise #21056 (#1198)
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2025-08-20 15:08:05 +08:00
Daniel Liu
9013bfbf6f
core/state: include zero-address in state dump if present #21038 (#1195)
* Include 0x0000 address into the dump if it is present

* core/state: go fmt

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
2025-08-20 15:06:37 +08:00
Daniel Liu
a2cf4e3111
core: fix deprecation comment for GenesisAccount #29218 (#1323) 2025-08-08 10:35:58 +08:00
Daniel Liu
34020969ff
all: simplify timestamps to uint64 #19372 (#1318) 2025-08-08 10:33:37 +08:00
Daniel Liu
36374be05f
eth/tracers: move tracing APIs into eth/tracers #22161 #22473 (#1252) 2025-08-08 10:25:43 +08:00
Daniel Liu
cdd6a9eb94
eth: add debug_accountRange API #19645 (#1194)
This new API allows reading accounts and their content by address range.

Co-authored-by: Wenbiao Zheng <delweng@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-08-08 09:55:17 +08:00
Daniel Liu
8750881da2
trie: remove the sync bloom, used by fast sync #24047 (#1077) 2025-08-08 09:31:26 +08:00
Daniel Liu
3da4549e07
core/state: move state account to core/types + abstracted write account to trie #23567 (#1072) 2025-08-08 09:13:34 +08:00
Daniel Liu
cd407af1aa
core/rawdb: add HasCode, HasTrieNode and use them where possible #24454 (#1211) 2025-08-04 14:42:13 +08:00
Daniel Liu
3620d9930d
core/vm: use clear from go v1.21 #29307 (#1246) 2025-08-04 11:54:49 +08:00
Daniel Liu
f9025ecc91
core/state: unexport NodeIterator #27239 (#1222)
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2025-08-04 11:53:31 +08:00
Daniel Liu
1d9fd6bdd2
core: show db error-info in case of mismatched hash root #26870 (#1220)
When a database failure occurs, bubble it up a into statedb, and report it in suitable places, such as during a 'bad block' report.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-08-04 11:51:47 +08:00
Daniel Liu
cb888541c5
core, trie: add state metrics #23433 (#1071) 2025-08-04 11:19:42 +08:00
Daniel Liu
52f5766059
core: pre-allocate in Copy() #25279 (#1213) 2025-07-28 16:57:51 +08:00
Daniel Liu
2eac17980c
core/state: avoid statedb.dbErr due to emptyCode #21051 (#1197) 2025-07-28 16:55:29 +08:00
Daniel Liu
cdd48dd4de
core/state: fix staticcheck warnings #20357 (#1193) 2025-07-28 16:53:27 +08:00
Daniel Liu
77522e51ec
core, trie: decode the value for storage dump #19943 (#1189)
* core, trie: decode the value for storage dump

* core/state: address comment

Co-authored-by: gary rong <garyrong0905@gmail.com>
2025-07-28 16:52:06 +08:00
benjamin202410
db9c3de1dc
add syncinfo pool (#1236)
* add syncinfo message into pool for process later

* add missing file back

---------

Co-authored-by: liam.lai <liam.lai@us>
2025-07-28 01:43:41 -07:00
Daniel Liu
85f08c7732
eth: skip VerifyHeader in traceBlock to fix #1185 (#1265) 2025-07-26 18:18:50 +08:00
Daniel Liu
7bb2c7793b
core/vm: delete unused error #29062 (#1245) 2025-07-26 17:45:31 +08:00
Daniel Liu
6f6e08f83b
core/vm: prevent overflow #29023 (#1244) 2025-07-26 17:44:45 +08:00
Daniel Liu
42d3549e2c
core: using math.MaxUint64 instead of 0xffffffffffffffff #29022 #29024 (#1243) 2025-07-26 17:43:36 +08:00
Daniel Liu
5561c27308
core: fix typos (#1237)
fixes various typos in core

Co-authored-by: 0xbstn <bastien-bouge@hotmail.fr>
2025-07-26 17:42:50 +08:00
Daniel Liu
32b929e781
core/vm/runtime: add Random field to config #28001 (#1234) 2025-07-26 17:41:56 +08:00
Daniel Liu
8f76709a10
core/vm, go.mod: update uint256 to v1.3.2 and use faster method #30868 (#1241) 2025-07-17 17:56:53 +08:00
Daniel Liu
4b4980d949
core/vm: set basefee to 0 internally on eth_call #28470 (#1238) 2025-07-17 17:54:23 +08:00