Commit graph

14623 commits

Author SHA1 Message Date
Guillaume Ballet
1183299ce5 core, cmd/geth: add --override.* flags to geth init (#28407)
* core, cmd/geth: add --override.* flags to geth init

* also apply overrides before genesis commit with new block

* review feedback
2023-11-10 11:09:46 -06:00
Delweng
503c8d4347 graphql: fix an issue of nil pointer panic (#28416)
Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
6a1deaea39 cmd/geth: test for logging-output (#28373)
This PR is a bit in preparation for the slog work in #28187 .

Our current test re logging mostly test the internals, but we have no real end-to-end test of the logging output. This PR introduces a simple reexec-based log tester. This also relies upon a special mode in geth, which can be made to eject a set of predefined log messages (only available if the build-tag `integrationtests` is used

e.g. go run --tags=integrationtests ./cmd/geth --log.format terminal logtest

While working on this, I also noticed a quirk in the setup: when geth was configured to use a file output, then two separate handlers were used (one handler for the file, one handler for the console). Using two separate handlers means that two formatters are used, thus the formatting of any/all records happened twice. This PR changes the mechanism to use two separate io.Writers instead, which is both more optimal and fixes a bug which occurs due to a global statefulness in the formatter.
2023-11-10 11:09:46 -06:00
Adrian Sutton
b7be93f9e3 rpc: use correct stringer-method for serializing BlockNumberOrHash (#28358)
The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
2023-11-10 11:09:46 -06:00
Delweng
528758f2a9 graphql: logs return error if from block > to (#28412)
As per discussion in ethereum/execution-apis#475

Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
5cbd9502ca trie: use explicit errors in stacktrie (instead of panic) (#28361)
This PR removes panics from stacktrie (mostly), and makes the Update return errors instead. While adding tests for this, I also found that one case of possible corruption was not caught, which is now fixed.
2023-11-10 11:09:46 -06:00
Martin Holst Swende
b5c13fa95c cmd/evm: make t8ntool handle transaction decoding errors better (#28397)
This change closes https://github.com/ethereum/go-ethereum/issues/27730 . By using an iterator instead of a slice of transactions, we can better handle the case when an individual transaction (within an otherwise well-formed RLP-list) cannot be decoded.
2023-11-10 11:09:46 -06:00
moomin
6b24a378dc txpool/legacypool: remove already known error in legacypool (#28400) 2023-11-10 11:09:46 -06:00
rjl493456442
6fe5774fb2 core, eth, trie: filter out boundary nodes and remove dangling nodes in stacktrie (#28327)
* core, eth, trie: filter out boundary nodes in stacktrie

* eth/protocol/snap: add comments

* Update trie/stacktrie.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth, trie: remove onBoundary callback

* eth/protocols/snap: keep complete boundary nodes

* eth/protocols/snap: skip healing if the storage trie is already complete

* eth, trie: add more metrics

* eth, trie: address comment

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Delweng
c637c84fc4 graphql: return error if block from>to (#28393)
As per discussion in ethereum/execution-apis#475
2023-11-10 11:09:46 -06:00
rjl493456442
e90266a302 trie/triedb/pathdb, core/rawdb: enhance error message in freezer (#28198)
This PR adds more error message for debugging purpose.
2023-11-10 11:09:46 -06:00
hyunchel
7ae1f808cc core/blockchain: fix typos and grammar (#28295) 2023-11-10 11:09:46 -06:00
kaliubuntu0206
a4ebc4d38b ethstats: fix bug in block reporting (#28398)
Fixes a bug where the ethstats omits to report full block contents. This bug was a side-effect of https://github.com/ethereum/go-ethereum/pull/26777,  where `CurrentBlock` was changed to return a header instead of a block, leading to a failed type assertion.
2023-11-10 11:09:46 -06:00
aaronbuchwald
225b77fe49 core/state/pruner: track number of skipped items during state pruning (#28368) 2023-11-10 11:09:46 -06:00
Inphi
3a1adc8a6e event: fix Resubscribe deadlock when unsubscribing after inner sub ends (#28359)
A goroutine is used to manage the lifetime of subscriptions managed by
resubscriptions. When the subscription ends with no error, the resub
goroutine ends as well. However, the resub goroutine needs to live
long enough to read from the unsub channel. Otheriwse, an Unsubscribe
call deadlocks when writing to the unsub channel.

This is fixed by adding a buffer to the unsub channel.
2023-11-10 11:09:46 -06:00
kevaundray
2318fea6fd crypto/kzg4844: use the new trusted setup file and format (#28383)
Changes the trusted_setup to the one created during the kzg-ceremony. The trusted setup file can be found in the consensus specs: https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/trusted_setups/trusted_setup_4096.json
---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
470d1cb31d core/state, tests: fix memory leak via fastcache (#28387)
This change fixes a memory leak, when running either state-tests or blockchain-tests, we allocate a `1MB` fastcache during snapshot generation. `fastcache` is a bit special, and requires a `Reset()` (it has it's own memory allocator). 

The `1MB` was hidden [here](https://github.com/ethereum/go-ethereum/blob/master/tests/state_test_util.go#L333) and [here](https://github.com/ethereum/go-ethereum/blob/master/tests/block_test_util.go#L146) respectively.
2023-11-10 11:09:46 -06:00
Marius van der Wijden
5e9d8bdd73 crypto/blake2b: put architecture-dependent features behind build-tag (#28381)
This change to fixes a compilation-flaw on master, by putting architecture-specific functions behind corresponding build tags.
2023-11-10 11:09:46 -06:00
Sina Mahmoodi
492977c671 eth/filters: fix flaky test TestPendingTxFilterDeadlock (#28376) 2023-11-10 11:09:46 -06:00
Brandon Liu
ba43767ca5 rpc: increase timeout in TestClientWebsocketPing (#28371) 2023-11-10 11:09:46 -06:00
Marius van der Wijden
e88c671f8e tests/fuzzers: update fuzzers to be based on go-native fuzzing (#28352)
This change modifies the fuzzers to use the native golang fuzzing framework instead of go-fuzz
2023-11-10 11:09:46 -06:00
lightclient
f993744a05 eth/fetcher: downgrade stale txs log from warn to debug (#28364) 2023-11-10 11:09:46 -06:00
Marius van der Wijden
0bceb02de7 tests/fuzzers/les: fix crash in fuzzer (#28362) 2023-11-10 11:09:46 -06:00
lightclient
c547c0b0b1 core/chain_makers: add SetParentBeaconRoot(..) to chain makers (#28252) 2023-11-10 11:09:46 -06:00
Adrian Sutton
9f7f4a7bb8 api/bind: add CallOpts.BlockHash to allow calling contracts at a specific block hash (#28084)
* api/bind: Add CallOpts.BlockHash to allow calling contracts at a specific block hash.

* ethclient: Add BalanceAtHash, NonceAtHash and StorageAtHash functions
2023-11-10 11:09:46 -06:00
Brandon Liu
9377b87b2f internal/ethapi, accounts/abi/bind: use errors.Is for error comparison (#28348)
Co-authored-by: lightclient <lightclient@protonmail.com>
2023-11-10 11:09:46 -06:00
Kero
789c18df1f ethclient: ensure the close of canceled context (#28349) 2023-11-10 11:09:46 -06:00
rjl493456442
eed2347f95 core, trie, eth: refactor stacktrie constructor (#28350)
This change enhances the stacktrie constructor by introducing an option struct. It also simplifies the `Hash` and `Commit` operations, getting rid of the special handling round root node.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
41b59b4339 params: begin v1.13.5 release cycle 2023-11-10 11:09:46 -06:00
Péter Szilágyi
10cceb43ae params: release Geth v1.13.4 2023-11-10 11:09:46 -06:00
Marius van der Wijden
ddd8a08930 eth/fetcher: fix fetcher timeout (#28220)
This changes fixes a bug in the fetcher, where the timeout for how long to remember underpriced transaction was erroneously compared, and the timeout never hit.
---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
xiaolou86
e95e022a8a cmd: fix typos (#28323) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
037c76c9ad internal/ethapi: fix codehash lookup in eth_getProof (#28357)
This change fixes #28355, where eth_getProof failed to return the correct codehash under certain conditions. This PR changes the logic to unconditionally look up the codehash, and also adds some more tests.
2023-11-10 11:09:46 -06:00
phenix3443
7bb6f6237e fix: broken url link (#28342) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
eb783fb381 eth/fetcher: only make noise big mismatches (#28356) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
077f13f68a tests: update execution-spec-tests to 1.0.5 (#28337)
Updates execution-spec-tests to 1.0.5: https://github.com/ethereum/execution-spec-tests/releases/tag/v1.0.5, switching to develop which contains Cancun tests (which are also enabled in this change).
2023-11-10 11:09:46 -06:00
Péter Szilágyi
4d2914cf13 cmd, core, ethdb: enable Pebble on 32 bits and OpenBSD too (#28335)
* cmd, core, ethdb: enable Pebble on 32 bits and OpenBSD too

* ethdb/pebble: use Pebble's internal constant calculation
2023-11-10 11:09:46 -06:00
Péter Szilágyi
c2a35a6961 go.mod: pull in the latest cloudflare API libs (#28336) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
51d0547794 trie: make rhs-proof align with last key in range proofs (#28311)
During snap-sync, we request ranges of values: either a range of accounts or a range of storage values. For any large trie, e.g. the main account trie or a large storage trie, we cannot fetch everything at once.

Short version; we split it up and request in multiple stages. To do so, we use an origin field, to say "Give me all storage key/values where key > 0x20000000000000000". When the server fulfils this, the server provides the first key after origin, let's say 0x2e030000000000000 -- never providing the exact origin. However, the client-side needs to be able to verify that the 0x2e03.. indeed is the first one after 0x2000.., and therefore the attached proof concerns the origin, not the first key.

So, short-short version: the left-hand side of the proof relates to the origin, and is free-standing from the first leaf.

On the other hand, (pun intended), the right-hand side, there's no such 'gap' between "along what path does the proof walk" and the last provided leaf. The proof must prove the last element (unless there are no elements).

Therefore, we can simplify the semantics for trie.VerifyRangeProof by removing an argument. This doesn't make much difference in practice, but makes it so that we can remove some tests. The reason I am raising this is that the upcoming stacktrie-based verifier does not support such fancy features as standalone right-hand borders.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
8b781a1fca go.mod: update AWS APIs to latest heads (#28332) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
d73fda4267 build: move version-info into checksum file (#28324)
* build: upgrade to golang 1.21.2

* build: verify checksums via tool

* deps: upgrade go to 1.21.3

* build: move more build metadata into checksum file

* build: move gobootsrc to checksums
2023-11-10 11:09:46 -06:00
Péter Szilágyi
ac068a3415 go.mod: update fastcache to latest (#28334) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
e01a852131 go.mod: update gnark lib to fix a malleability issue (#28333) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
5af1183376 go.mod, internal/build: update Azure dependencies (#28329) 2023-11-10 11:09:46 -06:00
rjl493456442
631db5c5ae eth/protocols/snap: fix snap sync failure on empty storage range (#28306)
This change addresses an issue in snap sync, specifically when the entire sync process can be halted due to an encountered empty storage range.

Currently, on the snap sync client side, the response to an empty (partial) storage range is discarded as a non-delivery. However, this response can be a valid response, when the particular range requested does not contain any slots.

For instance, consider a large contract where the entire key space is divided into 16 chunks, and there are no available slots in the last chunk [0xf] -> [end]. When the node receives a request for this particular range, the response includes:

    The proof with origin [0xf]
    A nil storage slot set

If we simply discard this response, the finalization of the last range will be skipped, halting the entire sync process indefinitely. The test case TestSyncWithUnevenStorage can reproduce the scenario described above.

In addition, this change also defines the common variables MaxAddress and MaxHash.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
780adca145 params: begin v1.13.4 release cycle 2023-11-10 11:09:46 -06:00
Péter Szilágyi
cd69ec6e76 params: release Geth v.1.13.3 2023-11-10 11:09:46 -06:00
Martin Holst Swende
7f451ef421 cmd/geth: fix failing test (#28322) 2023-11-10 11:09:46 -06:00
vuittont60
a067689e26 accounts, cmd: fix typos (#28300) 2023-11-10 11:09:46 -06:00
rjl493456442
9a372b6518 cmd, core: resolve scheme from a read-write database (#28313)
* cmd, core: resolve scheme from a read-write database

* cmd, core, eth: move the scheme check in the ethereum constructor

* cmd/geth: dump should in ro mode

* cmd: reverts
2023-11-10 11:09:46 -06:00