Commit graph

13562 commits

Author SHA1 Message Date
Daniel Liu
beb6ff97d7
core: remove outdated tests #27662 (#1496) 2025-09-17 08:16:07 +08:00
wit liu
1fe81d541d
all: fix goimports (#1495)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:15:43 +08:00
wit liu
a5d03e4a8a
all: fix inconsistent receiver name (#1494)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:15:23 +08:00
Daniel Liu
c9f2b73861
cmd, eth: rename config and flag to VMTraceJsonConfig #29573 (#1490) 2025-09-13 10:52:31 +08:00
Daniel Liu
88086e820e
eth/tracers: fix golangci-lint warnings #30587 (#1489) 2025-09-13 10:51:42 +08:00
Daniel Liu
af6c09a5aa
eth/tracers/internal/tracetest: include tracerConfig in created tracing test #30364 (#1487)
Fixes the tracer test filler for when there is tracerConfig.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
2025-09-13 10:50:55 +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
1597be6879
eth/tracers/js: add coinbase addr to ctx #30231 (#1484)
Add coinbase address to javascript tracer context.

This PR adds the `coinbase` address to `jsTracer.ctx`, allowing access
to the coinbase address (fee receipient) in custom JavaScript tracers.

Example usage:

```javascript
result: function(ctx) {
  return toAddress(ctx.coinbase);
}
```

This change enables custom tracers to access coinbase address,
previously unavailable, enhancing their capabilities to match built-in
tracers.

Co-authored-by: Dylan Vassallo <dylan.vassallo@hotmail.com>
2025-09-13 10:49:17 +08:00
Daniel Liu
ea239d5b15
eth/tracers, internal/ethapi: remove unnecessary map pointer in state override #30094 (#1483) 2025-09-13 10:41:51 +08:00
Daniel Liu
a00d95bf1a
eth/tracers/native: remove unnecessary check #30071 (#1477) 2025-09-13 10:40:18 +08:00
Daniel Liu
fd040ec0d7
core/tracing: add OnClose Trace Hook #29629 (#1474) 2025-09-13 10:38:34 +08:00
Daniel Liu
5ef325b759
eth/downloader, eth/tracer: fix typos in comments #29707 (#1472)
Co-authored-by: trillo <trillo8652@gmail.com>
2025-09-13 10:30:25 +08:00
Daniel Liu
db1082355d
eth/tracers: clear error for non-reverting pre-homestead fail #29824 (#1471)
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-13 10:29:34 +08:00
Daniel Liu
a9dc0a81a3
core/tracing: add system call callback #29355 (#1469) 2025-09-13 10:28:13 +08:00
Daniel Liu
eb9af0b0af
eth/tracers: fix #29800 #29811 (#1467) 2025-09-13 10:27:18 +08:00
Daniel Liu
23e2e20da9
eth/tracers/native: fix flatCallTracer Stop() bug #29623 (#1465)
Co-authored-by: Dragan Milic <dragan@netice9.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-13 10:26:00 +08:00
Daniel Liu
47abf2eb16
core/vm: better error-info for vm errors #29354 (#1464)
Co-authored-by: Martin HS <martin@swende.se>
2025-09-13 10:20:34 +08:00
Daniel Liu
b896f4dce1
eth/tracers: use slices.Contains #29461 (#1463)
Co-authored-by: Aaron Chen <aaronchen.lisp@gmail.com>
2025-09-13 10:18:06 +08:00
Daniel Liu
bb458d0eed
eth/tracers/js: consistent name for method receivers #29375 (#1461)
Co-authored-by: Brandon Liu <lzqcn2000@126.com>
2025-09-13 10:16:43 +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
e34aea99f0
ethstats: use timer instead of time.After in loops #29241 (#1454) 2025-09-13 10:06:25 +08:00
Daniel Liu
48f93a8cc5
ethstats: prevent panic if head block is not available #29020 (#1453)
This pull request fixes a flaw in ethstats which can lead to node crash

A panic could happens when the local blockchain is reorging which causes the original head block not to be  reachable (since number->hash canonical mapping is deleted). In order to prevent the panic, the block nilness is now checked in ethstats.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-13 10:05:07 +08:00
Daniel Liu
00970f929e
ethstats: fix bug in block reporting #28398 (#1452)
Fixes a bug where the ethstats omits to report full block contents. This bug was a side-effect of https://github.com/ethereum/go-ethereum/pull/26777,  where `CurrentBlock` was changed to return a header instead of a block, leading to a failed type assertion.

Co-authored-by: kaliubuntu0206 <139627505+kaliubuntu0206@users.noreply.github.com>
2025-09-13 10:03:18 +08:00
Daniel Liu
ccaa69e8e9
ethstats: overwrite old errors #21428 (#1444)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-09-13 09:55:20 +08:00
Daniel Liu
aee1bd3083
ethstats: fix reconnection issue, implement primus pings #21347 (#1443)
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2025-09-13 09:54:17 +08:00
Daniel Liu
23acecf6d8
account/abi/bind/v2: fix TestDeploymentWithOverrides #32212 (#1426)
The root cause of the flaky test was a nonce conflict caused by async
contract deployments.

This solution defines a custom deployer with automatic nonce management.

Co-authored-by: steven <wangpeculiar@gmail.com>
2025-09-13 09:50:19 +08:00
Daniel Liu
dd198e0371
accounts/abi/abigen: remove unnecessary test files #31804 (#1421) 2025-09-13 09:44:10 +08:00
Daniel Liu
d87774c6a3
accounts/abi/abigen: safe chain view update #31590 (#1420) 2025-09-13 09:41:35 +08:00
Daniel Liu
80159e5854
core/state, trie: add DeleteAccount method #25531 (#1108) 2025-09-13 09:29:51 +08:00
wit765
e4fd044fa0
crypto: fix unknown linters (#1488)
Co-authored-by: wit <wit765765346@gmail>
2025-09-12 14:45:26 +08:00
wit765
1da1b58e7e
build: fix BAD BLOCK error for consensus v1 and Go v1.24 v1.25 (#1482)
Co-authored-by: wit <wit765765346@gmail>
2025-09-12 09:52:52 +08:00
wit765
f234dd896e
build: upgrade go to v1.25.1 (#1476)
Co-authored-by: wit <wit765765346@gmail>
2025-09-11 16:35:39 +08:00
wit765
53b85b4960
build: upgrade golangci-lint to v2.4.0 (#1473)
Co-authored-by: wit <wit765765346@gmail>
2025-09-11 12:14:34 +08:00
JukLee0ira
b114eb0e5b
docs: update jsonrpc api document (#1468)
* module admin

* module eth

* module net

* module txpool

* module XDPoS

* module miner

* module debug
2025-09-11 08:45:23 +08:00
wit765
121226be2b
build: upgrade golangci-lint to v2.0.2 #31530 (#1466)
Co-authored-by: wit <wit765765346@gmail>
2025-09-10 17:22:29 +08:00
wit765
8155a2ee7e
docs: refactor jsonrpc api document (#1462)
Co-authored-by: wit <wit765765346@gmail>
2025-09-10 11:56:28 +08:00
wit765
12eab8e785
all: rename ChainId to ChainID #16853 (#1456)
Co-authored-by: wit <wit765765346@gmail>
2025-09-09 22:54:34 +08:00
Daniel Liu
4e234f231a
core, trie: flush preimages to db on database close #25533 (#1107) 2025-09-09 17:32:22 +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
7be9ab1ed9
eth/tracers: fix concurrency issue for JS-tracing a block #29238 (#1350) 2025-09-09 16:45:35 +08:00
Daniel Liu
bb7da37fb9
eth/tracers: fix prestateTracer pre nonce on contract creation #29099 (#1349)
The prestateTracer was reporting an inaccurate nonce for the contract being created in
post EIP-158 transactions. Correct nonce is 0, due to the issue nonce was being reported as 1.

Co-authored-by: Andrei Silviu Dragnea <andreidragnea.dev@gmail.com>
2025-09-09 16:38:20 +08:00
Daniel Liu
2ba36f3f0d
eth/tracers: fix callTracer logs on onlyTopCall == true #29068 (#1348)
Co-authored-by: Andrei Silviu Dragnea <andreisilviudragnea@gmail.com>
2025-09-09 16:32:17 +08:00
Daniel Liu
a8c252f5bc
eth/tracers, internal/ethapi: use correct baseFee when BlockOverrides is provided in call/traceCall #29051 (#1347) 2025-09-09 16:25:46 +08:00
Daniel Liu
693b248d0d
eth/tracers: fix typos in comments #28881 (#1346) 2025-09-09 16:16:26 +08:00
Daniel Liu
f6eb1aacc2
eth/tracers: use proper base fee in tests #28775 (#1345) 2025-09-09 16:08:15 +08:00
Daniel Liu
26001d237b
eth/tracers: tx-level state in debug_traceCall #28460 (#1344)
Co-authored-by: Delweng <delweng@gmail.com>
2025-09-09 15:59:38 +08:00
Daniel Liu
fe337141c1
eth/tracers/js: fix type inconsistencies #28488 (#1343)
This change fixes two type-inconsistencies in the JS tracer:

- In most places we return byte arrays as a `Uint8Array` to the tracer. However it seems we missed doing the conversion for `ctx` fields which are passed to the tracer during `result`. They are passed as simple arrays. I think Uint8Arrays are more suitable and we should change this inconsistency. Note: this will be a breaking-change. But I believe the effect is small. If we look at our tracers we see that these fields (`ctx.from`, `ctx.to`, etc.) are used in 2 ways. Passed to `toHex` which takes both array or buffer. Or the length was measured which is the same for both types.
- The `slice` taking in `int, int` params versus `memory.slice` taking `int64, int64` params. I suggest changing `slice` types to `int64`. This should have no effect almost in any case.

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-09 15:52:57 +08:00
Daniel Liu
ed46409261
eth/tracers: add position field for callTracer logs #28389 (#1342)
Currently, one can use the "withLogs" parameter to include logs in the
callTracer results, which allows the user to see at which trace level
was each log emitted.
This commit adds a position field to the logs which determine
the exact ordering of a call's logs and its subcalls. This would
be useful e.g. for explorers wishing to display the flow of execution.

Co-authored-by: Alvaro Sevilla <alvarosevilla95@gmail.com>
Co-authored-by: jsvisa <delweng@gmail.com>
2025-09-09 15:46:12 +08:00