Commit graph

236 commits

Author SHA1 Message Date
Chris Ziogas
3ed1bd816b
omitempty fields from supply tracer output 2024-05-31 15:00:17 +03:00
Chris Ziogas
b12c669a09
Merge branch 'master' into supply-delta-live-tracer 2024-05-30 14:49:47 +03:00
Chris Ziogas
e4a2c82af2
output hex values instead of numbers 2024-05-30 14:42:38 +03:00
Chris Ziogas
b07ef33e95
change output JSON schema
The new output becomes:

```
{
  "issuance": {
    "reward": 0,
    "withdrawals": 0
  },
  "burn": {
    "1559": 0,
    "blob": 0,
    "misc": 0
  },
  "blockNumber": 1,
  "hash": "0x",
  "parentHash": "0x"
}
```
2024-05-30 14:33:28 +03:00
Chris Ziogas
dec5d3b6d1
supply test compares output as JSON 2024-05-30 14:29:05 +03:00
trillo
2f0e63e5ac
eth/downloader, eth/tracer: fix typos in comments (#29707) 2024-05-29 14:43:07 +02:00
Sina M
ea6c16007c
eth/tracers: clear error for non-reverting pre-homestead fail (#29824) 2024-05-28 13:12:46 +02:00
Sina M
fa581766f5
eth/tracers: fix json logger for evm blocktest (#29795) 2024-05-23 10:55:54 +02:00
Martin HS
7fd7c1f7dd
eth/tracers: fix basefee context for traceBlock (#29811)
This fixes an issue for `debug_traceBlock*` methods where the BASEFEE opcode was returning always 0. This caused the method return invalid results.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-05-21 18:27:36 +02:00
Dragan Milic
7c7e3a77fc
eth/tracers/native: fix flatCallTracer Stop() bug (#29623)
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-04-30 14:33:22 +02:00
Chris Ziogas
a2639b2fde
s/OnBlockchainTerminate/OnClose 2024-04-25 09:39:08 +03:00
Chris Ziogas
a6541d2e57
Merge branch 'master' into supply-delta-live-tracer
# Conflicts:
#	core/tracing/hooks.go
2024-04-25 09:34:59 +03:00
Matthieu Vachon
ade7515c81
eth, eth/tracers: process beacon root before transactions (#29402)
The beacon root when applied in `state_processor.go` is performed right before executing transaction. That means that contract reliying on this value would query the same value found in the block header.

In that spirit, it means that any tracing/operation relying on state data which touches transaction must have updated the beacon root before any transaction processing.
2024-04-24 07:58:05 +02:00
Martin HS
7aafad2233
core/vm: better error-info for vm errors (#29354) 2024-04-06 12:22:55 +02:00
Aaron Chen
ccb76c01d7
eth/tracers: use slices.Contains (#29461) 2024-04-06 12:16:25 +02:00
Chris Ziogas
5ba5254cfb
rename Hook “OnTerminate” to “OnBlockchainTerminate” 2024-04-03 14:09:28 +03:00
Sina Mahmoodi
e67c3bfd62 refactor logging 2024-04-01 15:20:21 +02:00
Delweng
8c5576b1ac
eth/tracers: fix base fee and set blob fee in tests (#29376)
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-04-01 14:53:56 +02:00
Chris Ziogas
f65a19af15
log any error during log file close 2024-03-31 17:00:29 +03:00
Chris Ziogas
de1c41d0e9
remove comment 2024-03-30 20:25:16 +02:00
Chris Ziogas
00ef42b541
add OnTerminate in Hooks which triggered on blockchain Stop 2024-03-30 19:18:05 +02:00
Chris Ziogas
4708a19319
fix test by closing logger file
Was expecting lumberjack.Rotate() to close the file
2024-03-29 22:03:34 +02:00
Chris Ziogas
cba97ef430
try a fix for test to pass on Windows 2024-03-29 16:19:06 +02:00
Chris Ziogas
4320189830
try a fix for test to pass on Windows
We try to solve the following error:

```
--- FAIL: TestSupplySelfdestruct (1.56s)
    testing.go:1231: TempDir RemoveAll cleanup: remove C:\Users\appveyor\AppData\Local\Temp\1\TestSupplySelfdestruct3803137642\001\supply.jsonl: The process cannot access the file because it is being used by another process.
```
2024-03-29 13:01:41 +02:00
Chris Ziogas
91260a7c29
try a fix for “TempDir RemoveAll cleanup” 2024-03-28 20:09:00 +02:00
Chris Ziogas
6e7f5bcd05
typo interalTxsHandler->internalTxsHandler 2024-03-28 20:04:07 +02:00
Chris Ziogas
fb0160ba9f
make SupplyInfo private 2024-03-28 20:03:33 +02:00
Chris Ziogas
df69332109
make supply type private 2024-03-28 20:02:59 +02:00
Brandon Liu
a3829178af
eth/tracers/js: consistent name for method receivers (#29375) 2024-03-28 17:35:40 +01:00
cui
0183c7ad82
eth/tracers/logger: using maps.Equal (#29384)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-03-28 14:09:21 +01:00
Chris Ziogas
a6cabe11b0
fix failing test 2024-03-28 14:01:58 +02:00
Sina Mahmoodi
53f61525f2 try alternative tempdir 2024-03-27 16:26:02 +01:00
Sina Mahmoodi
3a6cf0a4a0 Revert "allow test to use different file for tracer output"
This reverts commit bc983e2afd.
2024-03-27 16:22:32 +01:00
Sina M
767b00b0b5
t8ntool: add optional call frames to json logger (#29353)
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: Mario Vega <marioevz@gmail.com>
2024-03-27 16:12:57 +01:00
Chris Ziogas
bc983e2afd
allow test to use different file for tracer output 2024-03-27 14:00:20 +02:00
Chris Ziogas
5db20834f0
fix temp path on Windows by converting backslashes to slashes 2024-03-27 10:50:42 +02:00
Aaron Chen
723b1e36ad
all: fix mismatched names in comments (#29348)
* all: fix mismatched names in comments

* metrics: fix mismatched name in UpdateIfGt
2024-03-26 21:01:28 +01:00
Chris Ziogas
55a9f40b4e
change []byte to json.RawMessage in test 2024-03-26 20:00:35 +02:00
Chris Ziogas
a4117a8337
add supply delta live tracer 2024-03-26 11:30:50 +02:00
Martin HS
14cc967d19
all: remove dependency on golang.org/exp (#29314)
This change includes a leftovers from https://github.com/ethereum/go-ethereum/pull/29307
- using the [new `slices` package](https://go.dev/doc/go1.21#slices) and
- using the [new `cmp.Ordered`](https://go.dev/doc/go1.21#cmp) instead of exp `constraints.Ordered`
2024-03-25 07:50:18 +01:00
Sina M
064f37d6f6
eth/tracers: live chain tracing with hooks (#29189)
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: Matthieu Vachon <matthieu.o.vachon@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Martin HS <martin@swende.se>
2024-03-22 18:53:53 +01:00
Sina M
eff424cc30
eth/tracers: fix concurrency issue for JS-tracing a block (#29238)
This change fixes a concurrency-issue where JS-tracers were accessing the block-ctx GetHash function in a in parallel, which is not safe.
2024-03-13 07:40:02 +01:00
Delweng
6e379b6fc7
eth/tracers: prestate tracer add blob fee (#29168)
* eth/tracers: prestate balance add blob fee

Signed-off-by: jsvisa <delweng@gmail.com>

* eth/tracers: prestate test support blob tx

Signed-off-by: jsvisa <delweng@gmail.com>

* eth/tracers: add prestate blob tx test

Signed-off-by: jsvisa <delweng@gmail.com>

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2024-03-06 14:36:12 +02:00
Undefinedor
a6d6e8ac41
rpc: remove deprecated method "Notifier.Closed" (#29162) 2024-03-05 14:44:23 +01:00
Andrei Silviu Dragnea
19607d1a10
eth/tracers: Fix prestateTracer pre nonce on contract creation (#29099)
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.
2024-03-04 20:21:43 +01:00
Andrei Silviu Dragnea
5a0f468f8c
eth/tracers: Fix callTracer logs on onlyTopCall == true (#29068) 2024-02-27 10:29:12 +01:00
ArtificialPB
e47a7c22c4
internal/ethapi: use overriden baseFee for gasPrice (#29051)
eth_call and debug_traceCall allow users to override various block fields, among them base fee. However the overriden base fee was not considered for computing the effective gas price of that message, and instead base fee of the base block was used. This has been fixed in this commit.
2024-02-22 14:39:22 +01:00
Sina Mahmoodi
95741b1844
core: move genesis alloc types to core/types (#29003)
We want to use these types in public user-facing APIs, so they shouldn't be in core.

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-02-16 19:05:33 +01:00
Martin HS
8321fe2fda
tests: fix goroutine leak related to state snapshot generation (#28974)
---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-02-14 17:02:56 +01:00
Dimitris Apostolou
8fd43c8013
all: fix typos in comments (#28881) 2024-02-05 22:16:32 +01:00