Commit graph

1540 commits

Author SHA1 Message Date
Daniel Liu
9d8bec712d
eth/tracers: remove revertReasonTracer, add revert reason to callTracer #25508 (#1298)
* eth/tracers: add revertReason to callTracer

* update callframe gen json

* add revertal to calltrace test

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-09 06:43:32 +08:00
Daniel Liu
d962a06975
eth/tracers: fix a bug in prestateTracer #25884 (#1297)
Co-authored-by: Delweng <delweng@gmail.com>
2025-09-09 06:41:52 +08:00
Daniel Liu
de4fa1d674
eth/tracers: use gencodec for native tracers #25637 (#1296)
The call tracer and prestate tracer store data JSON-encoded in memory. In order to support alternative encodings (specifically RLP), it's better to keep data a native format during tracing. This PR does marshalling at the end, using gencodec.

OBS!
This PR changes the call tracer result slightly:

-  Order of type and value fields are changed (should not matter).
-  Output fields are completely omitted when they're empty (no more output: "0x"). Previously, this was only _sometimes_ omitted (e.g. when call ended in a non-revert error) and otherwise 0x when the output was actually empty.

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-09 06:40:01 +08:00
Daniel Liu
b72c76eb30
eth/tracers: pad memory slice on OOB case #25213 (#1295)
* eth/tracers: pad memory slice on oob case

* eth/tracers/js: fix testfailure due to err msg capitalization

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-09-09 06:38:10 +08:00
Daniel Liu
98be4bb911
eth: rework chain tracer #25143 #25715 #29162 (#1294) 2025-09-09 00:06:07 +08:00
Daniel Liu
3b80bd0347
eth/tracers/js: improve integer types in log object #25668 (#1293)
All fields related to gas must be represented as uint64. Depth is
internally tracked as int, so it makes sense to also store it as int.

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-08 23:42:04 +08:00
Daniel Liu
a935810d4c
eth/tracers/js: fill in refund field #25661 (#1292) 2025-09-08 23:40:07 +08:00
Daniel Liu
67efb14ff3
eth/tracers: add onlyTopCall option to callTracer #25430 (#1291) 2025-09-08 23:38:19 +08:00
Daniel Liu
bfc00e775b
eth/tracers: add initial revertReasonTracer tracer #25265 (#1289)
Adds a native tracer that returns that in case of failure returns the error message or the revert reason of a transaction.

Co-authored-by: Philip Fan <fanwengang@hotmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-09-08 23:36:28 +08:00
Daniel Liu
241ad1d635
eth/tracers: optimize goja buffer conversion #25156 (#1287)
This changes the []byte <-> Uint8Array conversion to use an
ArrayBuffer, avoiding inefficient copying of the slice data in Goja.

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-08 21:24:58 +08:00
Daniel Liu
900b333241
eth/tracers: add support for block overrides in debug_traceCall #24871 (#1288) 2025-09-08 21:22:09 +08:00
Daniel Liu
1b561493fb
eth/tracers: fix typo and linter #25020 #24783 #25551 (#1286) 2025-09-08 21:15:42 +08:00
Daniel Liu
88d703180c
eth/tracers/js: drop duktape engine #24934 (#1283) 2025-09-08 21:11:27 +08:00
Daniel Liu
b27c8d23b2
eth/tracers/js: add memory.length method #24887 (#1284) 2025-09-08 21:08:16 +08:00
Daniel Liu
5226fa2cbf
eth/tracers/js: goja tracer #23773 (#1282) 2025-09-08 20:59:29 +08:00
Daniel Liu
ba2d72e8d8
eth/tracers: migrate go-bindata to embed #24744 (#1279) 2025-09-08 20:57:23 +08:00
Daniel Liu
44bd05a732
eth/tracers: refactor traceTx to separate out struct logging #24326 (#1278)
* eth/tracers: refactor traceTx to separate out struct logging

review fix

Update eth/tracers/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

Mv ExecutionResult type to logger package

review fix

impl GetResult for StructLogger

make formatLogs private

confused exit and end..

account for intrinsicGas in structlogger, fix TraceCall test

Add Stop method to logger

Simplify traceTx

Fix test

rm logger from blockchain test

account for refund in structLogger

* use tx hooks in struct logger

* minor

* avoid executionResult in struct logger

* revert blockchain test changes

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-08 20:55:06 +08:00
Daniel Liu
0bc25c35b4
core,eth: implement tx-level hooks for tracers #24510 (#1277)
* core,eth: add empty tx logger hooks

* core,eth: add initial and remaining gas to tx hooks

* store tx gasLimit in js tracer

* use gasLimit to compute intrinsic cost for js tracer

* re-use rules in transitiondb

* rm logs

* rm logs

* Mv some fields from Start to TxStart

* simplify sender lookup in prestate tracer

* mv env to TxStart

* Revert "mv env to TxStart"

This reverts commit 656939634b9aff19f55a1cd167345faf8b1ec310.

* Revert "simplify sender lookup in prestate tracer"

This reverts commit ab65bce48007cab99e68232e7aac2fe008338d50.

* Revert "Mv some fields from Start to TxStart"

This reverts commit aa50d3d9b2559addc80df966111ef5fb5d0c1b6b.

* fix intrinsic gas for prestate tracer

* add comments

* refactor

* fix test case

* simplify consumedGas calc in prestate tracer

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-08 17:53:21 +08:00
Daniel Liu
001bc5a4d8
eth/tracers/logger: use omitempty to reduce log bloat #24547 (#1276) 2025-09-08 17:50:58 +08:00
Daniel Liu
8712fec2b5
eth/tracers: use hex encoding for debug_traceBlock argument #24517 (#1275)
Co-authored-by: Guifel <toowik@gmail.com>
2025-09-08 17:49:26 +08:00
Daniel Liu
4f738d2191
eth/tracers: clean-up tracer collection #24320 (#1274) 2025-09-08 17:47:33 +08:00
Daniel Liu
0c293e5c34
eth/tracers: native prestate tracer #24268 (#1273) 2025-09-08 17:45:28 +08:00
Daniel Liu
060642e619
eth/tracers/js: add support for REVERT/SELFDESTRUCT in evmdis_tracer #24016 (#1271)
* eth/tracers: Add support for REVERT in evmdis_tracer

* evm/tracers: Fix evmdis_tracer to use SELFDESTRUCT instead of SUICIDE

* eth/tracers: Regenerate tracer library

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
2025-09-08 17:28:59 +08:00
Daniel Liu
5d64f3b32f
eth/tracers: avoid using blockCtx concurrently #24286 (#1272) 2025-09-08 17:28:18 +08:00
Daniel Liu
95d06d0f15
eth/tracers: capture fault states in logger #23970 (#1270) 2025-09-08 17:27:13 +08:00
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
7d433a454a
eth/tracers: make native 4byte default, remove js version #23916 (#1268)
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-08-31 16:33:25 +08:00
Daniel Liu
1d1a88db5f
eth/tracers: add golang 4byte tracer #23882 (#1267)
* native 4byte tracer

* Update eth/tracers/native/4byte.go



* Update eth/tracers/native/4byte.go



* goimports

* eth/tracers: make 4byte tracer not care about create

Co-authored-by: Ward Bradt <wardbradt5@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-08-31 16:05:54 +08:00
Daniel Liu
773b513213
eth/filters: eth_getLogs fast exit for invalid block range #28386 (#1389) 2025-08-31 15:40:48 +08:00
Daniel Liu
59568b167f
eth/filters: retrieve logs in async #27135 (#1388) 2025-08-29 05:29:38 +08:00
Daniel Liu
031ea75eca
eth/tracers: package restructuring #23857 (#1266) 2025-08-29 05:26:36 +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
e1a407d2c0
eth/filters: reuse func handleLogs for Removed logs #27438 (#1390) 2025-08-28 18:57:27 +08:00
Daniel Liu
d138eb22a3
eth/tracers: support for golang tracers + add golang callTracer #23708 (#1264) 2025-08-28 18:53:13 +08:00
Daniel Liu
9425af8b7c
eth: make traceChain avoid OOM on long-running tracing #23736 (#1263) 2025-08-28 18:52:32 +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
32ed739110
eth/tracers: avoid unsyncronized mutations on trie database #23632 (#1261) 2025-08-26 15:26:19 +08:00
Daniel Liu
98f6825514
eth/tracers: implement debug.intermediateRoots #23594 (#1260) 2025-08-26 15:25:30 +08:00
Daniel Liu
28550526ba
eth/tracers: improve test #23303 (#1258) 2025-08-26 15:24:49 +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
cf6c595dd0
eth/filters, ethclient/gethclient: add fullTx option to pending tx filter #25186 #26189 (#1372)
* eth/filters, ethclient/gethclient: add fullTx option to pending tx filter #25186

This PR adds a way to subscribe to the _full_ pending transactions, as opposed to just being notified about hashes.

In use cases where client subscribes to newPendingTransactions and gets txhashes only to then request the actual transaction, the caller can now shortcut that flow and obtain the transactions directly.

Co-authored-by: Felix Lange <fjl@twurst.com>

* ethclient: docs, fix misleading comment #26189

---------

Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-08-22 16:44:51 +08:00
Daniel Liu
ad45cb55fe
eth/tracers: expose contextual infos (block hash, tx hash, tx index) #23104 (#1256) 2025-08-22 16:40:18 +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
aaa42a9a42
eth/tracers: backend for 1559 #23038 (#1255) 2025-08-21 13:39:44 +08:00
Daniel Liu
9c6816eab6
core/vm: make time field use uint64 #26474 (#1319) 2025-08-20 15:22:06 +08:00
Daniel Liu
0ceeb24fb3
eth/tracer: extend call tracer #22245 (#1254) 2025-08-20 15:12:18 +08:00
Daniel Liu
17bfe7af44
eth: add error when accessing missing block state #18346 (#1355) 2025-08-20 14:35:07 +08:00