Commit graph

15262 commits

Author SHA1 Message Date
Matthieu Vachon
262c3117f6 Merge remote-tracking branch 'origin/master' into firehose-fh3.0
# Conflicts:
#	cmd/evm/internal/t8ntool/execution.go
#	cmd/evm/internal/t8ntool/transition.go
#	cmd/utils/flags.go
#	consensus/beacon/consensus.go
#	core/blockchain.go
#	core/state_processor.go
#	core/tracing/hooks.go
#	core/vm/runtime/runtime.go
#	eth/backend.go
#	eth/tracers/api.go
#	eth/tracers/dir.go
#	eth/tracers/directory/tracers.go
#	eth/tracers/internal/tracetest/calltrace_test.go
#	eth/tracers/internal/tracetest/flat_calltrace_test.go
#	eth/tracers/js/goja.go
#	eth/tracers/js/tracer_test.go
#	eth/tracers/live/noop.go
#	eth/tracers/logger/logger.go
#	eth/tracers/native/4byte.go
#	eth/tracers/native/call.go
#	eth/tracers/native/call_flat.go
#	eth/tracers/native/mux.go
#	eth/tracers/native/noop.go
#	eth/tracers/native/prestate.go
#	eth/tracers/tracers.go
#	go.mod
2024-03-25 14:45:08 -04:00
Matthieu Vachon
496908bcf6 Merge branch 'master' into firehose-fh3.0 2024-03-25 14:13:34 -04:00
Roberto Bayardo
5cea7a6230
ethclient/simulated: clean up Node resources when simulated backend is closed (#29316) 2024-03-25 18:03:44 +01: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
deterclosed
ae47004487
eth: fix typo (#29320) 2024-03-25 10:16:44 +08:00
Nathan
6f1fb0c29f
metrics/influxdb: skip float64-precision-dependent tests on arm64 (#29047)
metrics/influxdb: fix failed cases caused by float64 precision on arm64
2024-03-24 13:51:34 +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
George Ma
38eb8b3e20
all: fix docstrings (#29311) 2024-03-22 20:29:12 +08:00
Martin HS
d9bde37ac3
log: use native log/slog instead of golang/exp (#29302) 2024-03-22 13:17:59 +01:00
rjl493456442
6490d9897a
cmd, triedb: implement history inspection (#29267)
This pull request introduces a database tool for inspecting the state history. 
It can be used for either account history or storage slot history, within a 
specific block range.

The state output format can be chosen either with

- the "rlp-encoded" values (those inserted into the merkle trie)
- the "rlp-decoded" value (the raw state value)

The latter one needs --raw flag.
2024-03-22 20:12:10 +08:00
Darioush Jalali
f46fe62c5d
triedb/hashdb: Avoid setting db.cleans on Close (#29309) 2024-03-22 19:38:24 +08:00
Martin HS
14eb8967be
all: use min/max/clear from go1.21 (#29307) 2024-03-21 13:50:13 +01:00
Felix Lange
bca6c40709
beacon/blsync: support for deneb fork (#29180)
This adds support for the Deneb beacon chain fork, and fork handling
in general, to the beacon chain light client implementation.

Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2024-03-20 19:22:44 +01:00
Martin HS
04bf1c802f
eth/protocols/snap, internal/testlog: fix dataraces (#29301) 2024-03-20 15:22:52 +01:00
Marius van der Wijden
8f7fbdfedc
core: refactor consensus interface (#29283)
This PR modifies the consensus interface to wrap the body fields.
2024-03-20 14:58:47 +01:00
Aaron Chen
0444388c74
core/txpool/blobpool: calculate log1.125 faster (#29300) 2024-03-20 14:51:05 +01:00
rjl493456442
78c102dec5
core: skip the check the statefulness of head block in repair (#29245) 2024-03-20 13:11:30 +01:00
imalasong
22ac46cbdb
Makefile: update PHONY directive (#29296) 2024-03-20 13:09:46 +01:00
Martin HS
9a7e6ce6f5
cmd/evm: fix flag-mismatch from #29290 (#29298) 2024-03-20 10:38:30 +01:00
Martin HS
de08f3d625
cmd/evm: make staterunner always output stateroot to stderr (#29290)
This changes makes it so that when `evm statetest` executes, regardless of whether `--json` is specified or not, the stateroot is printed on `stderr` as a `jsonl` line. This enables speedier execution of testcases in goevmlab, in cases where full execution op-by-op is not required.
2024-03-20 09:12:58 +01:00
georgehao
0ceac8d00e
metrics: fix docstrings (#29279) 2024-03-20 08:51:45 +01:00
miles
45b88abbde
all: fix typos (#29288) 2024-03-20 08:49:38 +01:00
zgfzgf
6f929a0762
core/asm: minor code-clarification (#29293) 2024-03-20 08:46:50 +01:00
buddho
4c1b57856f
miner: modify header before checking time-based fields (#29242)
The Prepare-method of consensus engine might modify the time-field in a header, so it should be called prior to checks that rely on it
2024-03-19 15:23:55 +01:00
Tien Nguyen
eda9c7e36f
accounts/abi/bind: check invalid chainID first (#29275) 2024-03-19 14:05:31 +01:00
bitcoin-lightning
6b3d4d068a
beacon/light/sync: fix typo in comment (#29256) 2024-03-19 14:05:06 +01:00
Aaron Chen
ac6060a4c6
log: replace tmp with bytes.Buffer.AvailableBuffer (#29287) 2024-03-19 11:25:30 +01:00
rjl493456442
15eb9773f9
triedb/pathdb: improve tests (#29278) 2024-03-19 10:50:08 +08:00
Matthieu Vachon
ecc78f5dd0 Merge branch 'extended-tracer-struct' into firehose-fh3.0 2024-03-18 15:46:07 -04:00
Martin HS
ab49f228ad
all: update to go version 1.22.1 (#28946)
Since Go 1.22 has deprecated certain elliptic curve operations, this PR removes 
references to the affected functions and replaces them with a custom implementation
in package crypto. This causes backwards-incompatible changes in some places.

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-03-18 17:36:50 +01:00
Martin Holst Swende
4f87f174b3 eth/tracers, cmd/evm: unexport JSONlogger 2024-03-18 17:33:55 +01:00
Martin Holst Swende
e320d1e1e1
core/vm: documentation + minor refactoring 2024-03-18 13:11:21 +01:00
Martin Holst Swende
25051c9ae1
cmd/evm: add testcase for js-tracer 2024-03-18 11:58:51 +01:00
Martin Holst Swende
4636dd369e
cmd/evm: fix tracing
This commit fixes several missing interface-checks, where the code did not properly
verify a Hook before calling it.
It also fixes an error where the tracer was not set in the vmconfig during t8n initialization.

It also adds a testcase which verifies the tracing-output during t8n executio. The
testcase currently only checks the jsonlogger, but can be extended.

This change also removes a spurious 'null' output in the tracing, when
tracing result is null.
2024-03-18 10:36:12 +01:00
Martin HS
c611924727
go.mod: update protobuf (#29270) 2024-03-18 08:13:55 +01:00
Matthieu Vachon
b1d1d36dc4 Merge branch 'firehose-fh3.0-backport-1.13.5' into firehose-fh3.0
# Conflicts:
#	accounts/abi/bind/backends/simulated.go
#	cmd/evm/internal/t8ntool/execution.go
#	cmd/evm/internal/t8ntool/flags.go
#	cmd/evm/internal/t8ntool/transition.go
#	cmd/geth/snapshot.go
#	consensus/beacon/consensus.go
#	consensus/ethash/consensus.go
#	consensus/misc/dao.go
#	core/blockchain.go
#	core/chain_makers.go
#	core/evm.go
#	core/genesis.go
#	core/genesis_test.go
#	core/state/dump.go
#	core/state/state_object.go
#	core/state/state_test.go
#	core/state/statedb.go
#	core/state/statedb_fuzz_test.go
#	core/state/statedb_test.go
#	core/state/sync_test.go
#	core/state/trie_prefetcher_test.go
#	core/state_transition.go
#	core/tracing/hooks.go
#	core/txpool/blobpool/blobpool_test.go
#	core/txpool/legacypool/legacypool2_test.go
#	core/txpool/legacypool/legacypool_test.go
#	core/types/account.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/instructions.go
#	core/vm/interface.go
#	core/vm/interpreter.go
#	eth/api_debug_test.go
#	eth/tracers/api.go
#	eth/tracers/directory/util_test.go
#	eth/tracers/firehose.go
#	eth/tracers/internal/tracetest/calltrace_test.go
#	eth/tracers/internal/tracetest/flat_calltrace_test.go
#	eth/tracers/internal/tracetest/prestate_test.go
#	eth/tracers/js/goja.go
#	eth/tracers/js/tracer_test.go
#	eth/tracers/logger/logger.go
#	eth/tracers/logger/logger_test.go
#	eth/tracers/native/call_flat.go
#	eth/tracers/native/prestate.go
#	eth/tracers/tracers_test.go
#	go.mod
#	internal/ethapi/api.go
#	light/odr_test.go
#	miner/worker.go
#	params/version.go
#	tests/block_test_util.go
#	tests/state_test_util.go
2024-03-15 12:48:29 -04:00
Matthieu Vachon
89c5b57484 Merge branch 'extended-tracer-backport-1.13.5' into firehose-fh3.0-backport-1.13.5 2024-03-15 11:01:01 -04:00
Matthieu Vachon
17fcdfaadf Fixed incorrect captureBeging/captureEnd in EVM 2024-03-15 10:58:50 -04:00
Matthieu Vachon
5cf6340406 Fixed new keccak256 implementation that wasn't working properly 2024-03-15 10:57:39 -04:00
Matthieu Vachon
d673f1927c Added Firehose 3.0 backport tracer 2024-03-15 10:56:57 -04:00
SanYe
ba2dd9385c
accounts/abi/bind: remove unused err set and check (#29269)
accounts/abi: remove unused err set and check
2024-03-15 10:46:22 +01:00
Martin HS
40cac1d0e2
eth/catalyst: prettier output on bad new payloads (#29259)
When we receive a bad NewPayload, we currently emit a lot of data to the logging facilities. This PR makes it so we print less data.
2024-03-15 10:44:41 +01:00
shivhg
95715fdb03
eth/downloader, graphql: fix typos (#29243) 2024-03-15 10:07:47 +01:00
Haotian
cffb7c8604
params: use the same variable name as EIP-4788 (#29195)
In https://eips.ethereum.org/EIPS/eip-4788 the name `BEACON_ROOTS_ADDRESS` is used. This change makes geth use the same variable name to avoid confusion.
2024-03-15 09:14:31 +01:00
Matthieu Vachon
3834f135a9 Series of changes to get backport to 1.13.5 working 2024-03-14 16:53:22 -04:00
Sina Mahmoodi
28a80d617f fix empty tracer config 2024-03-14 16:25:47 -04:00
Matthieu Vachon
177074432d Call OnBlockchainInit before OnGenesisBlock (#22)
# Conflicts:
#	core/blockchain.go
2024-03-14 16:25:45 -04:00
Sina Mahmoodi
77a701cca4 rm extra param
# Conflicts:
#	core/vm/evm.go
2024-03-14 16:24:51 -04:00
Sina Mahmoodi
77486e91fb fix lint issue 2024-03-14 16:23:56 -04:00
Sina Mahmoodi
d0a86c45b5 rm canceler 2024-03-14 16:23:56 -04:00