Commit graph

13536 commits

Author SHA1 Message Date
wanwiset25
ae696dc547 func CopyConstants choose local chain if unknown chainID 2025-09-14 15:21:26 +04:00
wanwiset25
a1e5a98377 update validator initial configs 2025-09-14 15:19:19 +04:00
wanwiset25
069cd8ebce fix wrong storage in genesis due to rlp changed behavior (EIP-2718) 2025-09-14 15:19:19 +04:00
wanwiset25
8e07f0678f fix local start script 2025-09-14 15:19:19 +04:00
wanwiset25
4df9699821 genesis wizard accept file input 2025-09-14 15:19:19 +04: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
Daniel Liu
242ea9e0e9
eth/tracers/js: use t.toBig on ctx.GasPrice for js tracing #27903 (#1341)
This change fixes a bug in js tracer, where `ctx.GasPrice.toString(16)` returns a number string in base `10`.

Co-authored-by: Joe Netti <joe@netti.dev>
2025-09-09 15:40:17 +08:00
Daniel Liu
e4d4fb7d9c
eth/tracers/native: replace instances of suicide with selfdestruct #27716 (#1340) 2025-09-09 15:33:16 +08:00
Daniel Liu
b0e3d4118c
eth/tracers/native: panic on memory read in prestateTracer #27691 (#1339)
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 15:26:12 +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
31dcbc7645
eth/tracers: use slices package for sorting #27490 (#1337) 2025-09-09 15:12:22 +08:00
Daniel Liu
525a84eae4
eth/tracers: refactor exporting js buffer #27472 (#1336) 2025-09-09 15:05:47 +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
548adb56e6
eth/tracers: fix flatCallTracer crasher #27304 (#1334)
FlatCallTracer had a crasher when it was passed `onlyTopCall: true` as config.
This PR ignores config fields inherited from the normal call tracer.

Co-authored-by: minh-bq <97180373+minh-bq@users.noreply.github.com>
2025-09-09 14:51:46 +08:00
Daniel Liu
c5f747a7d3
eth/tracers: add txHash field on txTraceResult #27183 (#1333)
This PR modifies the interface for the results of `debug_traceBlock` and `debug_traceCall` by adding the `txHash`, allowing users to identify which transaction's trace result corresponds to.

---------

Co-authored-by: sjlee1125 <47561537+sjlee1125@users.noreply.github.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-09-09 14:45:46 +08:00
Daniel Liu
cb80dbe4f6
internal/ethapi: add block overrides to eth_call #26414 (#1332) 2025-09-09 14:39:59 +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
9fd13e5e4a
eth/tracers: report correct gasLimit in call tracers #27029 (#1325)
This includes a semantic change to the `callTracer` as well as `flatCallTracer`.
The value of field `gas` in the **first** call frame will change as follows:

- It previously contained gas available after initial deductions (i.e. tx costs)
- It will now contain the full tx gasLimit value

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2025-09-09 11:56:50 +08:00
Daniel Liu
98e9dc6c95
eth/tracers/native: prevent panic for LOG edge-cases #26848 (#1324)
This PR fixes OOM panic in the callTracer as well as panicing on
opcode validation errors (e.g. stack underflow) in callTracer and
prestateTracer.

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-09-09 11:40:55 +08:00
Daniel Liu
be61f66cb2
core/types: remove message #25977 (#1322) 2025-09-09 11:23:47 +08:00
Daniel Liu
19f5417121
eth/tracers/native: set created address to nil in case of failure #26779 (#1321)
Fixes #26073

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-09 11:17:01 +08:00
Chris Ziogas
1361040a37 eth/tracers: add native flatCallTracer (aka parity style tracer) #26377 (#1320)
Adds support for a native call tracer with the Parity format, which outputs call frames
in a flat array. This tracer accepts the following options:

- `convertParityErrors: true` will convert error messages to match those of Parity
- `includePrecompiles: true` will report all calls to precompiles. The default
  matches Parity's behavior where CALL and STATICCALLs to precompiles are excluded

Incompatibilities with Parity include:

- Parity removes the result object in case of failure. This behavior is maintained
  with the exception of reverts. Revert output usually contains useful information,
  i.e. Solidity revert reason.
- The `gasUsed` field accounts for intrinsic gas (e.g. 21000 for simple transfers)
  and refunds unlike Parity
- Block rewards are not reported

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 11:03:38 +08:00
Daniel Liu
96a7ed54c6
core/vm: set tracer-observable value of a delegatecall to match parent value #26632 (#1317)
This is a breaking change in the tracing hooks API as well as semantics of the callTracer:

- CaptureEnter hook provided a nil value argument in case of DELEGATECALL. However to stay consistent with how delegate calls behave in EVM this hook is changed to pass in the value of the parent call.
- callTracer will return parent call's value for DELEGATECALL frames.

---------

Co-authored-by: Chris Ziogas <ziogaschr@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 10:41:48 +08:00
Daniel Liu
e1baea4d8b
eth/tracer: rename to revertReason #26574 (#1316)
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-09 10:34:50 +08:00
Daniel Liu
0061de6b0a
eth/tracers: use non-threaded tracechain #24283 (#1315)
This makes non-JS tracers execute all block txs on a single goroutine.
In the previous implementation, we used to prepare every tx pre-state
on one goroutine, and then run the transactions again with tracing enabled.
Native tracers are usually faster, so it is faster overall to use their output as
the pre-state for tracing the next transaction.

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 10:25:37 +08:00
Daniel Liu
afc20286fb
eth: add request cancellation checks #26320 (#1314)
This ensures that RPC method handlers will react to a timeout or
cancelled request soon after the event occurs.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 10:18:10 +08:00
Daniel Liu
dee4c985b1
eth/tracers/native: fix possible crash in prestate tracer #26351 (#1313) 2025-09-09 09:52:13 +08:00
Daniel Liu
2834be6131
eth/tracers: return proper error from debug_TraceTransaction when tx not found #26211 (#1312)
Currently calling `debug_TraceTransaction` with a transaction hash that doesn't exist returns a confusing error: `genesis is not traceable`. This PR changes the behaviour to instead return an error message saying `transaction not found`

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 09:36:14 +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
dd9fac6d41
eth/tracers: small refactor for native tracers #26196 (#1310)
Use noopTracer as a base for other native tracers to avoid extra boilerplate for unimplemented hooks.

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-09 09:17:54 +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
bbb2d8f8de
eth/tracers: prestateTracer - exclude unchanged storage slots in diffMode #25944 (#1308)
Fixes #25943

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2025-09-09 08:18:33 +08:00