Commit graph

24 commits

Author SHA1 Message Date
Daniel Liu
cfca45a7eb
refactor(all): rework EVM constructor #30745 (#2065) 2026-02-17 14:35:18 +05:30
Daniel Liu
d7a42cb038
refactor(core): clean up EVM environmental structure #31061 (#1985) 2026-02-10 16:40:54 +05:30
Daniel Liu
d74c23cca1
perf(core): use uint256 in state #28598 (#1977) 2026-02-05 13:59:23 +05:30
Daniel Liu
ebbbdf2bff
core/state: move state log mechanism to a separate layer #30569 #30732 (#1775) 2025-12-16 07:33:19 +04:00
Daniel Liu
4c098ddf1f
core/vm: fold EVMInterpreter into EVM #32352 (#1838) 2025-12-04 10:31:40 +05:30
Daniel Liu
81e3bd0f90
eth/tracers/logger: fix json-logger output missing #30804 (#1502)
Fixes a flaw introduced in
https://github.com/ethereum/go-ethereum/pull/29795 , discovered while
reviewing https://github.com/ethereum/go-ethereum/pull/30633 .

Co-authored-by: Martin HS <martin@swende.se>
2025-09-21 18:53:13 +08:00
Daniel Liu
ff68a46709
eth/tracers: fix json logger for evm blocktest #29795 (#1470) 2025-09-17 08:45:25 +08:00
Daniel Liu
993c60f16c
eth/tracers/logger: improve markdown logger #30805 (#1508)
This PR improves the output of the markdown logger a bit.

- Remove `RStack` field,
- Move `Stack` last, since it may have very large vertical expansion
- Make the pre- and post-exec  metadata structured into a bullet-list

Co-authored-by: Martin HS <martin@swende.se>
2025-09-17 08:25:49 +08:00
Daniel Liu
88086e820e
eth/tracers: fix golangci-lint warnings #30587 (#1489) 2025-09-13 10:51:42 +08:00
Daniel Liu
f5e76ea6df
eth/tracers: avoid panic in state test runner #30332 (#1485)
Make tracers more robust by handling `nil` receipt as input.
Also pass in a receipt with gas used in the state test runner.
Closes https://github.com/ethereum/go-ethereum/issues/30117.

---------

Co-authored-by: Martin HS <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-13 10:50:10 +08:00
Daniel Liu
bcf007335a
eth/tracers/logger: using maps.Equal #29384 (#1460)
Co-authored-by: cui <523516579@qq.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-13 10:10:24 +08:00
Daniel Liu
604ba0ea14
eth/tracers/logger: add optional call frames to json logger #29353 (#1459)
Adds a flag `--trace.callframes` to t8n which will log info when entering or exiting a call frame in addition to the execution steps.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Mario Vega <marioevz@gmail.com>
2025-09-13 10:09:36 +08:00
Daniel Liu
6bd8df6b8f
eth/tracers: fix mismatched names in comments #29348 (#1458) 2025-09-13 10:07:28 +08:00
Daniel Liu
ad9003c41e
eth/tracers: live chain tracing with hooks #29189 (#1352)
Here we add a Go API for running tracing plugins within the main block import process.

As an advanced user of geth, you can now create a Go file in eth/tracers/live/, and within
that file register your custom tracer implementation. Then recompile geth and select your tracer
on the command line. Hooks defined in the tracer will run whenever a block is processed.

The hook system is defined in package core/tracing. It uses a struct with callbacks, instead of
requiring an interface, for several reasons:

- We plan to keep this API stable long-term. The core/tracing hook API does not depend on
  on deep geth internals.
- There are a lot of hooks, and tracers will only need some of them. Using a struct allows you
   to implement only the hooks you want to actually use.

All existing tracers in eth/tracers/native have been rewritten to use the new hook system.

This change breaks compatibility with the vm.EVMLogger interface that we used to have.
If you are a user of vm.EVMLogger, please migrate to core/tracing, and sorry for breaking
your stuff. But we just couldn't have both the old and new tracing APIs coexist in the EVM.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Matthieu Vachon <matthieu.o.vachon@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Martin HS <martin@swende.se>
2025-09-09 17:30:56 +08:00
Daniel Liu
ef3be2cdac
eth/tracers: add ReturnData in the tracer's response #27704 (#1338)
The struct logger (or opcode tracer) was missing the return data field even
if this was explicitly enabled by user via `"enableReturnData": true` in the config.
This PR fixes this issue.

Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 15:19:36 +08:00
Daniel Liu
a5eab7eddb
eth/tracers: replace noarg fmt.Errorf with errors.New #27330 (#1335) 2025-09-09 14:59:01 +08:00
Daniel Liu
712ca01d65
eth/tracers: use atomic type #27031 (#1326)
Use the new atomic types in package eth/tracers

---------

Co-authored-by: s7v7nislands <s7v7nislands@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 12:26:48 +08:00
Daniel Liu
7d4d81f586
eth/tracers, core/vm: remove time from trace output and tracing interface #26291 (#1311)
This removes the 'time' field from logs, as well as from the tracer interface. This change makes the trace output deterministic.  If a tracer needs the time they can measure it themselves. No need for evm to do this.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 09:26:10 +08:00
Daniel Liu
5edb41bfd8
eth/tracers: add multiplexing tracer #26086 (#1309)
* eth/tracers: add native multiplexing tracer

* minor improv callTracer

* mv evm cancellation to api

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-09 08:24:41 +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
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