Commit graph

1919 commits

Author SHA1 Message Date
Matthieu Vachon
b5691516fb Removed dependency on github.com/streaminfast/firehose-ethereum generating the Protobuf struct in go-ethereum directly 2024-01-16 13:34:27 -05:00
Matthieu Vachon
8545daf9f9 Fixed some small stuff while merging extended-tracer in 2024-01-15 14:03:07 -05:00
Matthieu Vachon
35c5b287f0 Merge branch 'extended-tracer' into firehose-fh3.0
# Conflicts:
#	go.sum
2024-01-15 13:25:36 -05:00
Matthieu Vachon
306a1fca64 Merge branch 'extended-tracer' into firehose-fh3.0
# Conflicts:
#	go.mod
#	go.sum
2024-01-15 12:40:19 -05:00
Sina Mahmoodi
c3319301cc add test case for frontier create out of storage 2024-01-15 13:37:39 +03:30
Sina Mahmoodi
aa0db68d3a resolve merge conflict 2024-01-12 17:58:24 +03:30
Sina Mahmoodi
580f02527e has call reverted to snapshot 2024-01-12 17:53:12 +03:30
HAOYUatHZ
6e235c0833
eth: minor change of config-accessor (#28782)
eth: refactor `GetVM`
2024-01-12 08:06:22 +01:00
Matthieu Vachon
2bb31d4ac1 Ported some missing legacy fixes to keep 1:1 with Firehose legacy tracer 2024-01-11 21:26:55 -05:00
Matthieu Vachon
6573cb21a5 Fixed KecakkPreimages to fit with legacy Firehose behavior that had a bug 2024-01-11 21:20:43 -05:00
Matthieu Vachon
68bd6c6b31
Removed the OnGenesisBlock in genesis.Commit (#20)
This is not actually required as the `blockchain` does emit the `OnGenesisBlock` itself if starting a sync from scratch.
2024-01-11 14:54:52 +03:30
Matthieu Vachon
4862eeba1d Updated to really use Firehose protocol 3.0 2024-01-10 21:28:08 -05:00
Matthieu Vachon
8677894b94 Removed special delegate value logic as it's not needed, the tracer does the correct thing 2024-01-10 20:52:27 -05:00
Marius van der Wijden
2d08c99009
ethclient/simulated: implement new sim backend (#28202)
This is a rewrite of the 'simulated backend', an implementation of the ethclient interfaces
which is backed by a simulated blockchain. It was getting annoying to maintain the old
version of the simulated backend feature because there was a lot of code duplication with
the main client. 

The new version is built using parts that we already have: an in-memory geth node instance
running in developer mode provides the chain, while the Go API is provided by ethclient.
A backwards-compatibility wrapper is provided, but the simulated backend has also moved to
a more sensible import path: github.com/ethereum/go-ethereum/ethclient/simulated

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-01-10 16:45:08 +01:00
Matthieu Vachon
4c221a04d4 Fix for code storage out of gas error before homestead 2024-01-09 14:52:39 -05:00
ucwong
e7fa158086
eth/filters: fix early Unsubscribe of log events (#28769) 2024-01-08 20:18:30 +01:00
Matthieu Vachon
3e44bf5895 Added more tracing to log computation 2024-01-08 11:58:46 -05:00
ucwong
877d09443d
eth/downloader, eth/filters: use defer to call Unsubscribe (#28762) 2024-01-05 13:49:31 +01:00
alex
edc864f9ba
all: fix typos in comments (#28682)
chore(core,eth):fix a couple of typos
2023-12-18 09:35:12 +01:00
Ursulafe
b2ced97ac4
eth/fetcher, eth/gasestimator: fix typos in comments (#28675) 2023-12-13 23:32:17 +01:00
Matthieu Vachon
3181acac69 Added mistmatched transaction hash when log are not aligned 2023-12-12 21:26:52 -05:00
Ford
17c2b3c194
eth/protocols/eth: fix typos in comments (#28652) 2023-12-12 14:47:59 +01:00
Sina Mahmoodi
a52c80dec5 Fix test case 2023-12-12 11:34:41 +03:30
Sina Mahmoodi
0d254e4983 fix test 2023-12-11 16:17:49 +03:30
Sina Mahmoodi
0484068df5 fix lint issues 2023-12-11 14:17:29 +03:30
Péter Szilágyi
d98d70f670
cmd/utils, eth: disallow invalid snap sync / snapshot flag combos (#28657)
* eth: prevent startup in snap mode without snapshots

* cmd/utils: try to fix bad flag combos wrt snap sync and snapshot generation
2023-12-08 15:16:04 +02:00
Matthieu Vachon
a7f50134bd Account creations can happen before a transaction starts 2023-12-05 10:32:00 -05:00
Sina Mahmoodi
c5e407ba66 resolve merge conflicts 2023-12-05 18:13:41 +03:30
Sina Mahmoodi
f862531c25 rm chainConfig from OnGenesisBlock 2023-12-05 16:49:03 +03:30
Sina Mahmoodi
9e5c96fdff add chainConfig to block events 2023-12-05 16:31:16 +03:30
Martin Holst Swende
3dc071e036
eth/tracers/logger: make structlog/json-log stack hex again (#28628)
* common/hexutil: define hex wrappers for uint256.Int

* eth/tracers/logger: make structlog/json-log stack hex again

* common/hexutil: goimports
2023-12-05 09:37:48 +01:00
Manav Darji
70fd0b635e
eth/fetcher: fix invalid tracking of received at time for block (#28637)
eth/fetcher: fix invalid tracking of received at time
2023-12-04 14:25:17 +02:00
Delweng
5fb8ebc9ec
eth/tracers: tx-level state in debug_traceCall (#28460) 2023-12-01 16:38:52 +03:30
Matthieu Vachon
c36b44073f Ported back some fixes from Erigon extended native tracer 2023-11-30 10:53:31 -05:00
Matthieu Vachon
e51cbb0c95 Merge branch 'extended-tracer' into firehose-fh3.0
# Conflicts:
#	go.mod
#	go.sum
2023-11-29 13:50:08 -05:00
jwasinger
28e7371701
all: replace log15 with slog (#28187)
This PR replaces Geth's logger package (a fork of [log15](https://github.com/inconshreveable/log15)) with an implementation using slog, a logging library included as part of the Go standard library as of Go1.21.

Main changes are as follows:
* removes any log handlers that were unused in the Geth codebase.
* Json, logfmt, and terminal formatters are now slog handlers.
* Verbosity level constants are changed to match slog constant values.  Internal translation is done to make this opaque to the user and backwards compatible with existing `--verbosity` and `--vmodule` options.
* `--log.backtraceat` and `--log.debug` are removed.

The external-facing API is largely the same as the existing Geth logger.  Logger method signatures remain unchanged.

A small semantic difference is that a `Handler` can only be set once per `Logger` and not changed dynamically.  This just means that a new logger must be instantiated every time the handler of the root logger is changed.

----
For users of the `go-ethereum/log` module. If you were using this module for your own project, you will need to change the initialization. If you previously did 
```golang
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
```
You now instead need to do 
```golang
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true)))
```
See more about reasoning here: https://github.com/ethereum/go-ethereum/issues/28558#issuecomment-1820606613
2023-11-29 08:33:50 +01:00
Péter Szilágyi
61b844f2b2
eth/gasestimator: allow slight estimation error in favor of less iterations (#28618)
* eth/gasestimator: early exit for plain transfer and error allowance

* core, eth/gasestimator: hard guess at a possible required gas

* internal/ethapi: update estimation tests with the error ratio

* eth/gasestimator: I hate you linter

* graphql: fix gas estimation test

---------

Co-authored-by: Oren <orenyomtov@users.noreply.github.com>
2023-11-28 22:31:47 +02:00
Sina Mahmoodi
bbc5db8405
eth/tracers/js: fix type inconsistencies (#28488)
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.
2023-11-28 15:00:35 +01:00
Martin Holst Swende
63979bc9cc
cmd/evm, core/state: fix post-exec dump of state (statetests, blockchaintests) (#28504)
There were several problems related to dumping state. 

- If a preimage was missing, even if we had set the `OnlyWithAddresses` to `false`, to export them anyway, the way the mapping was constructed (using `common.Address` as key) made the entries get lost anyway. Concerns both state- and blockchain tests. 
- Blockchain test execution was not configured to store preimages.

This changes makes it so that the block test executor takes a callback, just like the state test executor already does. This callback can be used to examine the post-execution state, e.g. to aid debugging of test failures.
2023-11-28 13:54:17 +01:00
rjl493456442
71817f318e
eth/catalyst, eth/downloader: expose more sync information (#28584)
This change exposes more information from sync module internally
2023-11-28 08:38:30 +01:00
Péter Szilágyi
1e28e0bb03
eth/gasestimator, internal/ethapi: move gas estimator out of rpc (#28600) 2023-11-27 16:20:09 +02:00
Sina Mahmoodi
8610f8f68c add hooks for beacon block root processing 2023-11-24 19:08:42 +03:30
Sina Mahmoodi
5bc3f62647 move makeTest to own file 2023-11-24 18:29:27 +03:30
Sina Mahmoodi
8a1f67c7c8 forgot prestate testcase 2023-11-24 18:21:12 +03:30
Sina Mahmoodi
9c00b1290b fix merge conflict 2023-11-24 16:09:47 +03:30
Péter Szilágyi
2a2013014c
eth, internal/ethapi: drop some weird indirection (#28597) 2023-11-24 13:26:42 +02:00
Marius van der Wijden
bdf5e388ca
cmd, les, tests: remove light client code (#28586)
* cmd, les, tests: remove light client code

This commit removes the light client (LES) code.
Since the merge the light client has been broken and
it is hard to maintain it alongside the normal client.
We decided it would be best to remove it for now and
maybe rework and reintroduce it in the future.

* cmd, eth: remove some more mentions of light mode

* cmd: re-add flags and mark as deprecated

* cmd: warn the user about deprecated flags

* eth: better error message
2023-11-23 16:28:26 +02:00
jwasinger
3cfcd252db
cmd/geth: add support for --dev flag in dumpgenesis (#28463)
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2023-11-22 12:08:39 +01:00
jwasinger
104dbf7821
cmd/utils: validate pre-existing genesis in --dev mode (#28468)
geth --dev can be used with an existing data directory and genesis block. Since
dev mode only works with PoS, we need to verify that the merge has happened.

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-22 12:01:38 +01:00
ucwong
e9f59b5d5e
eth/filters: reuse error msg for invalid block range (#28479) 2023-11-21 15:28:44 +01:00