Commit Graph

15633 Commits

Author SHA1 Message Date
Zsolt Felfoldi 78b5918fdd core/filtermaps: removed unused function 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 08a345e602 core/filtermaps: fixed tests and rebase issues 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 38194a0fbe core/filtermaps: use DeleteRange, checkpoint init of log value pointer 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 7db1987af3 core/filtermaps: use new ChainEvent format 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 077ab869f3 core/filtermaps: always use correct absolute log index 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi f431db1e27 core/filtermaps: improved head indexing 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi d60c38a675 core/filtermaps: improved log messages 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 262b82d3ce core/filtermaps, eth/filters: fixed linter issues 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 05f8d20185 core/filtermaps: ensure 8 byte alignment of struct fields 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 4ecb311798 core/filtermaps: fixed comment 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 1c9e0d800c core/filtermaps: simplified locking scheme 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 95cbcdf81b core/filtermaps: nice log info during indexing/unindexing 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 1017be0fe0 core/filtermaps: improved unindexer 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi edb6f77b11 core/filtermaps: trigger undindexing after 1000 blocks 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 1901c7d3d9 core/filtermaps: added more tests 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 142448639d core/filtermaps: added license text 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi d1f492e511 eth/filters: fixed tests, added more 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi d34c1b69c5 core/filtermaps: use unindexed search as a fallback 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi ce7cf98094 core/filtermaps: fixed map pruning 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 9a5332ba1f core/filtermaps: fixed tail pointer bug, added more failing checks 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 0d676dcaae core/filtermaps: add indexer test 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 950ca52de8 core/filtermaps: moved math stuff to separate file, added Params 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 39ab872d17 core/filtermaps: added history.logs parameter 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 189705f3af core/filtermaps: remove bloombits database 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 66ab6aab4a core/bloombits, eth/filters: removed bloombits 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 197c77792f core/filtermaps: revert to legacy filter in case of "match all" search 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 932769e06c core/filtermaps: safe concurrent index update and search 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 8b5c87e30f core/filtermaps: add filtermaps tests 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi f85658fbe5 core/filtermaps: use rawdb.ReadRawReceipts 2024-12-14 00:52:53 +01:00
Zsolt Felfoldi 4ebce687b9 core/filtermaps: two dimensional log filter 2024-12-14 00:52:53 +01:00
Lucas 804d45cc2e
p2p: DNS resolution for static nodes (#30822)
Closes #23210 

# Context 
When deploying Geth in Kubernetes with ReplicaSets, we encountered two
DNS-related issues affecting node connectivity. First, during startup,
Geth tries to resolve DNS names for static nodes too early in the config
unmarshaling phase. If peer nodes aren't ready yet (which is common in
Kubernetes rolling deployments), this causes an immediate failure:


```
INFO [11-26|10:03:42.816] Starting Geth on Ethereum mainnet...
INFO [11-26|10:03:42.817] Bumping default cache on mainnet         provided=1024 updated=4096
Fatal: config.toml, line 81: (p2p.Config.StaticNodes) lookup idontexist.geth.node: no such host
``` 

The second issue comes up when pods get rescheduled to different nodes -
their IPs change but peers keep using the initially resolved IP, never
updating the DNS mapping.

This PR adds proper DNS support for enode:// URLs by deferring resolution
to connection time. It also handles DNS failures gracefully instead of failing
fatally during startup, making it work better in container environments where
IPs are dynamic and peers come and go during rollouts.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-13 12:46:12 +01:00
Antony Denyer 88cbfab332
internal/ethapi: add block override to estimateGas (#30695)
Add block overrides to `eth_estimateGas` to align consistency with
`eth_call`.


https://github.com/ethereum/go-ethereum/issues/27800#issuecomment-1658186166

Fixes https://github.com/ethereum/go-ethereum/issues/28175

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-12-12 12:39:03 +01:00
lorenzo c1c2507148
p2p: fix DiscReason encoding/decoding (#30855)
This fixes an issue where the disconnect message was not wrapped in a list.
The specification requires it to be a list like any other message.

In order to remain compatible with legacy geth versions, we now accept both
encodings when parsing a disconnect message.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-12 12:33:42 +01:00
gitglorythegreat c7e740f40c
core/state: remove pointless wrapper functions (#30891) 2024-12-11 11:05:59 +01:00
Darren Kelly 330190e476
accounts/abi: support unpacking solidity errors (#30738)
This PR adds the error fragments to `func (abi ABI) getArguments` which
allows typed decoding of errors.
2024-12-10 14:30:24 +01:00
Hteev Oli 4ed36ea1f8
build: update to Go 1.23.4 (#30872) 2024-12-10 14:22:43 +01:00
Martin HS 9045b79bc2
metrics, cmd/geth: change init-process of metrics (#30814)
This PR modifies how the metrics library handles `Enabled`: previously,
the package `init` decided whether to serve real metrics or just
dummy-types.

This has several drawbacks: 
- During pkg init, we need to determine whether metrics are enabled or
not. So we first hacked in a check if certain geth-specific
commandline-flags were enabled. Then we added a similar check for
geth-env-vars. Then we almost added a very elaborate check for
toml-config-file, plus toml parsing.

- Using "real" types and dummy types interchangeably means that
everything is hidden behind interfaces. This has a performance penalty,
and also it just adds a lot of code.

This PR removes the interface stuff, uses concrete types, and allows for
the setting of Enabled to happen later. It is still assumed that
`metrics.Enable()` is invoked early on.

The somewhat 'heavy' operations, such as ticking meters and exp-decay,
now checks the enable-flag to prevent resource leak.

The change may be large, but it's mostly pretty trivial, and from the
last time I gutted the metrics, I ensured that we have fairly good test
coverage.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-10 13:27:29 +01:00
Zheyuan He 4ecf08584c
core/vm: remove unnecessary comment (#30887) 2024-12-10 13:10:17 +01:00
Martin HS 75f847390f
cmd/evm: consolidate evm output switches (#30849)
This PR attempts to clean up some ambiguities and quirks from recent
changes to evm flag handling.

This PR mainly focuses on `evm run` subcommand, to use the same flags
for configuring tracing/output options as `statetest/blocktest` does.

Additionally, it adds quite a lot of tests for expected outputs of the
various subcommands, to avoid accidental changes.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-10 09:43:24 +01:00
rjl493456442 a91dcf3ee5
core/state: enable partial-functional reader (snapshot integration pt 3) (#30650)
It's a pull request based on https://github.com/ethereum/go-ethereum/pull/30643

In this pull request, the partial functional state reader is enabled if **legacy snapshot
is not enabled**. The tracked flat states in pathdb will be used to serve the state
retrievals, as the second implementation to fasten the state access.

This pull request should be a noop change in normal cases.
2024-12-10 10:10:49 +08:00
steven a722adb774
core/txpool: remove unused parameter `local` (#30871) 2024-12-09 19:29:19 +01:00
Guillaume Ballet 08e6bdb550
trie/utils: ensure master can generate a correct genesis for kaustinen7 (#30856)
This imports the following fixes:

 - update gnark to 1.1.0
 - update go-verkle to 0.2.2
 - fix: main storage offset bug (gballet/go-ethereum#329)
 - fix: tree key generation (gballet/go-ethereum#401)

---------

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-12-06 12:14:05 +01:00
Nebojsa Urosevic 67a3b08795
core/tracing: extends tracing.Hooks with OnSystemCallStartV2 (#30786)
This PR extends the Hooks interface with a new method,
`OnSystemCallStartV2`, which takes `VMContext` as its parameter.

Motivation

By including `VMContext` as a parameter, the `OnSystemCallStartV2` hook
achieves parity with the `OnTxStart` hook in terms of provided insights.
This alignment simplifies the inner tracer logic, enabling consistent
handling of state changes and internal calls within the same framework.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-12-04 09:40:37 +01:00
Martin HS f0e7382f38
cmd/evm, eth/tracers: refactor structlogger and make it streaming (#30806)
This PR refactors the structlog a bit, making it so that it can be used
in a streaming mode.

-------------

OBS: this PR makes a change in the input `config` config, the third
input-parem field to `debug.traceCall`. Previously, seteting it to e.g.
` {"enableMemory": true, "limit": 1024}` would mean that the response
was limited to `1024` items. Since an 'item' may include both memory and
storage, the actual size of the response was undertermined.
After this change, the response will be limited to `1024` __`bytes`__
(or thereabouts).



-----------


The commandline usage of structlog now uses the streaming mode, leaving
the non-streaming mode of operation for the eth_Call.

There are two benefits of streaming mode 
1. Not have to maintain a long list of operations, 
2. Not have to duplicate / n-plicate data, e.g. memory / stack /
returndata so that each entry has their own private slice.


---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-12-04 08:52:59 +01:00
Felix Lange 84cabb587b
CODEOWNERS: add some more entries for auto assignment (#30851) 2024-12-03 16:11:26 +01:00
Felix Lange 4afab7ef76
eth/downloader: move SyncMode to package eth/ethconfig (#30847)
Lots of packages depend on eth/downloader just for the SyncMode type.
Since we have a dedicated package for eth protocol configuration, it
makes more sense to define SyncMode there, turning eth/downloader into
more of a leaf package.
2024-12-03 09:30:26 +01:00
Felix Lange ae5a16f870
internal/debug: rename --trace to --go-execution-trace (#30846)
This flag is very rarely needed, so it's OK for it to have a verbose
name. The name --trace also conflicts with the concept of EVM tracing,
which is much more heavily used.
2024-12-02 18:17:43 +01:00
Martin HS 9848e9b046
fuzzing: fix oss-fuzz fuzzer (#30845)
The fuzzer added recenly to fuzz the eth handler doesn't
build on oss-fuzz, because it also has dependencies in the peer_test.go.

This change fixes it, I hope, by adding that file also for preprocessing.
2024-12-02 15:43:17 +01:00
lightclient 5347280319
cmd/evm: improve block/state test runner (#30633)
* unify `staterunner` and `blockrunner` CLI flags, especially around
tracing
* added support for struct logger or json logging (although having issue
#30658)
* new --cross-check flag to validate the stateless witness collection
  / execution matches stateful
* adds support for tracing the stateless execution when a tracer is set
  (to more easily debug differences)
* --human for more readable test summary
* directory or file input, so if you pass tests/spec-tests/fixtures/blockchain_tests it will execute all
blockchain tests
2024-12-02 15:18:02 +01:00
Sina M ce8cec007c
eth/tracers: fix state hooks in API (#30830)
When a tx/block was being traced through the API the state hooks weren't
being called as they should. This is due to #30745 moving the hooked
statedb one level up in the state processor. This PR fixes that.

---------

Co-authored-by: Martin HS <martin@swende.se>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-11-29 18:42:28 +01:00