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
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
Martin HS
14eb8967be
all: use min/max/clear from go1.21 ( #29307 )
2024-03-21 13:50:13 +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
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
Matthieu Vachon
ecc78f5dd0
Merge branch 'extended-tracer-struct' into firehose-fh3.0
2024-03-18 15:46:07 -04: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
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
ccb7065fc8
Merge branch 'extended-tracer-struct' into firehose-fh3.0
2024-03-14 11:17:34 -04:00
Matthieu Vachon
817e261fab
Call OnBlockchainInit before OnGenesisBlock ( #22 )
2024-03-14 13:58:51 +01:00
Matthieu Vachon
665329d32b
Call OnBlockchainInit before OnGenesisBlock
2024-03-13 16:24:36 -04:00
Matthieu Vachon
7b77261b7c
Added back OnNewAccount which is Firehose concept so I left it out of the merge commit just before this one
2024-03-13 16:24:14 -04:00
Matthieu Vachon
f47d2fc315
Merge branch 'extended-tracer-struct' into firehose-fh3.0
...
# Conflicts:
# core/blockchain.go
# core/state/statedb.go
# eth/backend.go
# eth/tracers/live/printer.go
# go.mod
# go.sum
2024-03-13 16:23:13 -04:00
Sina Mahmoodi
cff9fba98f
rm extra param
2024-03-13 18:01:08 +01:00
Sina Mahmoodi
0b5975fee3
fix merge conflict
2024-03-13 12:48:34 +01:00
Sina Mahmoodi
65bdbc175f
fix lint issue
2024-03-13 12:45:22 +01:00
rjl493456442
c170fa277c
core: improve chain rewinding mechanism ( #29196 )
...
* core: improve chain rewinding mechanism
* core: address comment
* core: periodically print progress log
* core: address comments
* core: fix comment
* core: fix rewinding in path
* core: fix beyondRoot condition
* core: polish code
* core: polish code
* core: extend code comment
* core: stop rewinding if chain is gapped or genesis is reached
* core: fix broken tests
2024-03-13 13:39:30 +02:00
Martin HS
d5bacfa4de
crypto/kz4844: pass blobs by ref ( #29050 )
...
This change makes use of the following underlying changes to the kzg-libraries in order to avoid passing large things on the stack:
- c-kzg: https://github.com/ethereum/c-kzg-4844/pull/393 and
- go-kzg: https://github.com/crate-crypto/go-kzg-4844/pull/63
2024-03-13 07:51:46 +01:00
Sina Mahmoodi
73ca96b97e
resolve merge conflict
2024-03-12 17:55:17 +01:00
Bin
89cefe240f
cmd: use package filepath over path for file system operations ( #29227 )
...
Package filepath implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths.
Package path implements utility routines for manipulating slash-separated paths.
The path package should only be used for paths separated by forward slashes, such as the paths in URLs
2024-03-12 10:00:34 +01:00
Sina Mahmoodi
fa4ade8ecb
core: fix deprecation comment for GenesisAccount ( #29218 )
...
core: fix deprecation comment
2024-03-11 12:05:48 +02:00
Lee Bousfield
00c21128ef
core/txpool/blobpool: return ErrAlreadyKnown for duplicate txs ( #29210 )
...
Signed-off-by: Lee Bousfield <ljbousfield@gmail.com>
2024-03-11 12:05:17 +02:00
Péter Szilágyi
b393ad8d29
cmd, core, metrics: always report expensive metrics ( #29191 )
...
* cmd, core, metrics: always report expensive metrics
* core, metrics: report block processing metrics as resetting timer
* metrics: update reporter tests
2024-03-11 10:06:57 +02:00
hyhnet
cd490608e3
all: fix typos in comments ( #29186 )
2024-03-07 22:56:19 +01:00
Sina Mahmoodi
eeb0a46429
rm canceler
2024-03-07 13:08:27 +01:00
Sina Mahmoodi
5bdbf07837
add fn refundGas
2024-03-07 12:15:57 +01:00
Sina Mahmoodi
935ff70d6d
replace opcode with byte
2024-03-07 10:30:13 +01:00
Sina Mahmoodi
1d0101969a
rm OnKeccakPreimage
2024-03-06 17:08:00 +01:00
Sina Mahmoodi
8b3cddabb5
rename tracer methods to On pattern
2024-03-06 16:34:18 +01:00
Sina Mahmoodi
37ce159500
rm OnStart and onEnd
2024-03-06 15:49:49 +01:00
Péter Szilágyi
f4d53133f6
consensus, cmd, core, eth: remove support for non-merge mode of operation ( #29169 )
...
* eth: drop support for forward sync triggers and head block packets
* consensus, eth: enforce always merged network
* eth: fix tx looper startup and shutdown
* cmd, core: fix some tests
* core: remove notion of future blocks
* core, eth: drop unused methods and types
2024-03-05 16:13:28 +02:00
zhiqiangxu
9e129efd7b
core: remove useless assignments ( #29065 )
2024-03-05 14:48:27 +01:00
rjl493456442
7b81cf6362
core/state, trie/triedb/pathdb: remove storage incomplete flag ( #28940 )
...
As SELF-DESTRUCT opcode is disabled in the cancun fork(unless the
account is created within the same transaction, nothing to delete
in this case). The account will only be deleted in the following
cases:
- The account is created within the same transaction. In this case
the original storage was empty.
- The account is empty(zero nonce, zero balance, zero code) and
is touched within the transaction. Fortunately this kind of accounts
are not-existent on ethereum-mainnet.
All in all, after cancun, we are pretty sure there is no large contract
deletion and we don't need this mechanism for oom protection.
2024-03-05 14:31:55 +01:00
zhiqiangxu
d89d7ebdec
core: initialize gasRemaining with = instead of += ( #29149 )
...
initialize gasRemaining with = instead of +=
2024-03-05 09:47:58 +01:00
Vie
9b3ceb2137
core/types: reuse signtx ( #29152 )
...
* core/types: reuse signtx
* core/types: inline signtx
2024-03-05 09:33:52 +02:00
rjl493456442
ca473b81cb
core: use finalized block as the chain freeze indicator ( #28683 )
...
* core: use finalized block as the chain freeze indicator
* core/rawdb: use max(finality, head-90k) as chain freezing threshold
* core/rawdb: fix tests
* core/rawdb: fix lint
* core/rawdb: address comments from peter
* core/rawdb: fix typo
2024-03-04 16:25:53 +02:00
buddho
679a27a2b3
all: use EmptyUncleHash, EmptyCodeHash instead of raw value ( #29134 )
2024-03-04 10:31:18 +01:00
cui
5a1e8a6547
core: delete unused ErrMaxInitCodeSizeExceeded ( #29062 )
2024-03-04 10:30:15 +01:00
Sina Mahmoodi
923c180058
rename Capture hooks to On
2024-02-29 17:18:43 +01:00
Sina Mahmoodi
d10d4b7626
rm old logger file
2024-02-29 16:38:54 +01:00
Sina Mahmoodi
ad7b9e8cd4
a type for each hook
2024-02-29 16:22:34 +01:00
Sina Mahmoodi
021d6a4870
assign const values for gas change reasons
2024-02-29 15:33:23 +01:00
Sina Mahmoodi
f358e57490
rename scopeContext to opContext
2024-02-29 15:13:03 +01:00
Péter Szilágyi
865e1e9f57
cmd/utils, core/rawdb, triedb/pathdb: flip hash to path scheme ( #29108 )
...
* cmd/utils, core/rawdb, triedb/pathdb: flip hash to path scheme
* graphql: run tests in hash mode as the chain maker needs it
2024-02-29 12:40:59 +02:00
yzb
db4cf69166
all: replace fmt.Errorf() with errors.New() if no param required ( #29126 )
...
replace-fmt-errorf
Co-authored-by: yzb@example.cn <yzb@example.cn>
2024-02-29 11:56:46 +02:00