Commit graph

13599 commits

Author SHA1 Message Date
Daniel Liu
85d71e71dd
eth/filters: add address limit to filters #31876 (#1504) 2025-09-21 18:53:52 +08:00
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
ff779bae72
eth/tracers: fill the creationMethod in flatCall #30539 (#1501)
`flatCallTracer` will now specify the type of a create in the action
via the `creationMethod` field.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-21 18:52:27 +08:00
Daniel Liu
0b13b19b55
trie: fix some typos #25551 #25648 (#1111) 2025-09-21 18:51:15 +08:00
Wanwiset Peerapatanapokin
1f6bd2bae5
Merge pull request #1280 from XinFinOrg/XDPoSv2-privatenet-improve-genesis
Improve genesis for easy privatechain deployment
2025-09-20 19:03:52 +04:00
Wanwiset Peerapatanapokin
fd22d58cc1
Merge pull request #1257 from XinFinOrg/improve-consensus-logs
Improve consensus logs
2025-09-20 19:03:34 +04:00
wanwiset25
b4f79c0b14 improve logs 2025-09-20 18:12:11 +04:00
wanwiset25
30e1a9a7fd fix 2025-09-20 17:56:20 +04:00
wgr523
968fb0124b
style: change limitPenaltyEpoch in config to real meaning, avoid +1 (#1538) 2025-09-19 13:43:31 -07:00
wgr523
5a6d25ec08
engine_v2: fix negative underflow in getBlockInfoByEpochNum (#1481) 2025-09-17 22:52:28 +08:00
wgr523
b8e5baa978
all: fix minted token recorded value is zero (#1480) 2025-09-17 22:50:52 +08:00
Daniel Liu
af69d382ff
eth/tracers: various fixes #30540 (#1491)
Breaking changes:

- The ChainConfig was exposed to tracers via VMContext passed in
`OnTxStart`. This is unnecessary specially looking through the lens of
live tracers as chain config remains the same throughout the lifetime of
the program. It was there so that native API-invoked tracers could
access it. So instead we moved it to the constructor of API tracers.

Non-breaking:

- Change the default config of the tracers to be `{}` instead of nil.
This way an extra nil check can be avoided.

Refactoring:

- Rename `supply` struct to `supplyTracer`.
- Un-export some hook definitions.

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-17 09:04:38 +08:00
wit liu
e9da4ca95b
all: fix ineffassign (#1516)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:49:28 +08:00
Daniel Liu
adfbabc847
rlp: remove duplicate optionalAndTailField test case #32614 (#1515)
Co-authored-by: radik878 <radikpadik76@gmail.com>
2025-09-17 08:48:19 +08:00
Daniel Liu
0ac2caf2c6
rlp: fix typo in decode test message #32554 (#1514)
Co-authored-by: Forostovec <ilonaforostovec22@gmail.com>
2025-09-17 08:47:42 +08:00
Daniel Liu
33b4940d56
core/tracing, eth/tracers/live: supply delta live tracer #29347 (#1475)
Introduces the first built-in live tracer. The supply tracer tracks ETH supply changes across blocks
and writes the output to disk. This will need to be enabled through CLI using the `--vmtrace supply` flag.

Co-authored-by: Chris Ziogas <ziogaschr@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-17 08:46:12 +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
637e732aff
trie: improve node rlp-decoding #25357 (#1109) 2025-09-17 08:42:42 +08:00
Daniel Liu
458f6582e7
build/tools, go.mod: remove go-bindata #24744 (#1512) 2025-09-17 08:41:41 +08:00
Daniel Liu
915c71f2c4
log: fix SetDefault for custom loggers #31368 (#1511)
Currently, even though it takes in a `Logger` interface,
`log.SetDefualt` enforces that the concrete type of the provided logger
is `*logger` because:
1. in `init` `root.Store` is called with a `*logger`
2. `atomic.Value` panics if the concrete type provided in `Store` is not
consistent across calls.
([ref](https://pkg.go.dev/sync/atomic#Value.Store))

> All calls to Store for a given Value must use values of the same
concrete type.

This PR changes to use `sync.RWMutex` and adds a test that panics on
`master`.

Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
2025-09-17 08:28:13 +08:00
wit liu
99e2885b03
all: fix misspell (#1510)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:27:52 +08:00
Daniel Liu
ba9fa91375
log: remove unused parameter #30432 (#1509)
Co-authored-by: asamuj <105436033+asamuj@users.noreply.github.com>
2025-09-17 08:26:34 +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
wit liu
6b20f9ad88
XDCx, core/state: fix unnecessary conversion (unconvert) (#1507)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:25:07 +08:00
Daniel Liu
b3ae8beb91
accounts/abi: generate TryPack* methods for abigen v2 bindings #31692 (#1424)
1. Fix the error return format.
**todo**: ~~`bindtype` needs more complex logic to fix it.~~
`
if err != nil {
  return nil, err
}
if err == nil {
  return obj, nil
}
`
2. ~~Return pointer type object to avoid copying the whole struct
content.~~
3. Give the panic decision to the user.
4. Fix empty line at the end of function.

**TODO**: ~~fix some related test cases.~~

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
2025-09-17 08:24:03 +08:00
wit liu
4a6fccaf69
all: fix whitespace (#1506)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:23:06 +08:00
Daniel Liu
20e3de2c4b
eth/tracers: add disableCode/Storage options for prestateTracer #30648 (#1498)
When using the prestateTracer, in some cases users are only concerned
with balances or nonce information, and are not interested in the lengthy
contract code or storage data.

Therefore, this PR introduces two new configuration options in the
`prestateTracerConfig` structure:
- `disableCode`
- `disableStorage`

These options allow users to control whether the tracer returns contract
code and storage data during execution tracing. By setting these
options, users can more flexibly customize their needs and focus on
obtaining information that is more critical and relevant to their
specific use cases.

These options work with the default mode as well as `diffMode: true`.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-17 08:22:13 +08:00
wit liu
1b88f2588e
eth/fetcher: fix copyloopvar for Go 1.22+ (#1505)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:21:23 +08:00
Daniel Liu
7b92ec7d5a
eth/filters: exit early if topics-filter has more than 4 topics #28494 (#1503) 2025-09-17 08:20:18 +08:00
Daniel Liu
35e5143fe7
eth/tracers: fix issues with benchmarks #30667 (#1500) 2025-09-17 08:18:51 +08:00
Daniel Liu
ea187b53bd
eth/tracers: flatCallTracer error compatible with parity #30497 (#1499)
Compatible error message in the flat call tracer with parity-style endpoints.

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2025-09-17 08:18:09 +08:00
Daniel Liu
2b906f22f1
eth/tracers/js: avoid compiling js bigint when not needed #30640 (#1497)
While looking at some mem profiles from `evm` runs, I noticed that
`goja` compilation of the bigint library was present. The bigint library
compilation happens in a package `init`, whenever the package
`eth/tracers/js` is loaded. This PR changes it to load lazily when
needed.

It becomes slightly faster with this change, and slightly less alloc:y.

Non-scientific benchmark with 100 executions:
```
time for i in {1..100}; do ./evm --code 6040 run; done;
 ```

current `master`:

```
real    0m6.634s
user    0m5.213s
sys     0m2.277s
```
Without compiling bigint
```
real    0m5.802s
user    0m4.191s
sys     0m1.965s
```

Co-authored-by: Martin HS <martin@swende.se>
2025-09-17 08:17:18 +08:00
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
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
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