Commit graph

1823 commits

Author SHA1 Message Date
devopsbo3
d847f283d9 Revert "eth, params: fix typos (#28286)"
This reverts commit 7aa36bb86b.
2023-11-10 12:27:53 -06:00
devopsbo3
057d5137bd Revert "all: move light.NodeSet to trienode.ProofSet (#28287)"
This reverts commit 6ffa8094b3.
2023-11-10 12:27:53 -06:00
devopsbo3
fda9f7de26 Revert "eth: enforce announcement metadatas and drop peers violating the protocol (#28261)"
This reverts commit 41820a9bd6.
2023-11-10 12:27:53 -06:00
devopsbo3
9eb510dfba Revert "trie: remove owner and binary marshaling from stacktrie (#28291)"
This reverts commit bc238e6ddb.
2023-11-10 12:27:53 -06:00
devopsbo3
ba42dbf359 Revert "eth/fetcher: throttle tx fetches to 128KB responses (#28304)"
This reverts commit 32f701ec23.
2023-11-10 12:27:53 -06:00
devopsbo3
7f8e001d1f Revert "eth/fetcher: fix typo"
This reverts commit 73acfd1293.
2023-11-10 12:27:53 -06:00
devopsbo3
eaadb8f260 Revert "cmd, core: resolve scheme from a read-write database (#28313)"
This reverts commit 9a372b6518.
2023-11-10 12:27:53 -06:00
devopsbo3
a91c62e79a Revert "eth/protocols/snap: fix snap sync failure on empty storage range (#28306)"
This reverts commit 631db5c5ae.
2023-11-10 12:27:53 -06:00
devopsbo3
d60605e9bb Revert "trie: make rhs-proof align with last key in range proofs (#28311)"
This reverts commit 51d0547794.
2023-11-10 12:27:53 -06:00
devopsbo3
ef407a9ff0 Revert "eth/fetcher: only make noise big mismatches (#28356)"
This reverts commit eb783fb381.
2023-11-10 12:27:53 -06:00
devopsbo3
ed7df9fe57 Revert "eth/fetcher: fix fetcher timeout (#28220)"
This reverts commit ddd8a08930.
2023-11-10 12:27:53 -06:00
devopsbo3
b1a0cd4d6f Revert "core, trie, eth: refactor stacktrie constructor (#28350)"
This reverts commit eed2347f95.
2023-11-10 12:27:53 -06:00
devopsbo3
5bf64a8efd Revert "eth/fetcher: downgrade stale txs log from warn to debug (#28364)"
This reverts commit f993744a05.
2023-11-10 12:27:53 -06:00
devopsbo3
75890f77df Revert "eth/filters: fix flaky test TestPendingTxFilterDeadlock (#28376)"
This reverts commit 492977c671.
2023-11-10 12:27:53 -06:00
devopsbo3
26cd4e60f8 Revert "core, eth, trie: filter out boundary nodes and remove dangling nodes in stacktrie (#28327)"
This reverts commit 6fe5774fb2.
2023-11-10 12:27:53 -06:00
devopsbo3
a674f74e80 Revert "core: add basic chain history support in GenerateChain (#28428)"
This reverts commit 3b8819470f.
2023-11-10 12:27:53 -06:00
devopsbo3
b2b7ffdb0d Revert "eth/tracers: add position field for callTracer logs (#28389)"
This reverts commit 15dad0e73c.
2023-11-10 12:27:53 -06:00
devopsbo3
0af3866d07 Revert "eth/filters: eth_getLogs fast exit for invalid block range (#28386)"
This reverts commit df4c9307d3.
2023-11-10 12:27:53 -06:00
devopsbo3
e05566028c Revert "eth: set networkID to chainID by default (#28250)"
This reverts commit 617e305218.
2023-11-10 12:27:53 -06:00
devopsbo3
854aeb14a9 Revert "eth/filters: exit early if topics-filter has more than 4 topics (#28494)"
This reverts commit 1992836381.
2023-11-10 12:27:53 -06:00
Delweng
1992836381 eth/filters: exit early if topics-filter has more than 4 topics (#28494)
Currently, geth's will return `[]` for any `len(topics) > 4` log filter. The EVM only supports up to four logs, via LOG4 opcode, so larger criterias fail. This change makes the filter query exit early in those cases.
2023-11-10 11:09:46 -06:00
Marius van der Wijden
617e305218 eth: set networkID to chainID by default (#28250)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Delweng
df4c9307d3 eth/filters: eth_getLogs fast exit for invalid block range (#28386) 2023-11-10 11:09:46 -06:00
Alvaro Sevilla
15dad0e73c eth/tracers: add position field for callTracer logs (#28389)
Currently, one can use the "withLogs" parameter to include logs in the
callTracer results, which allows the user to see at which trace level
was each log emitted.
This commit adds a position field to the logs which determine
the exact ordering of a call's logs and its subcalls. This would
be useful e.g. for explorers wishing to display the flow of execution.

Co-authored-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
Felix Lange
3b8819470f core: add basic chain history support in GenerateChain (#28428)
This change improves GenerateChain to support internal chain history access (ChainReader)
for the consensus engine and EVM.

GenerateChain takes a `parent` block and the number of blocks to create. With my changes,
the consensus engine and EVM can now access blocks from `parent` up to the block currently
being generated. This is required to make the BLOCKHASH instruction work, and also needed
to create real clique chains.  Clique uses chain history to figure out if the current signer is in-turn,
for example.

I've also added some more accessors to BlockGen. These are helpful when creating transactions:

- g.Signer returns a signer instance for the current block
- g.Difficulty returns the current block difficulty
- g.Gas returns the remaining gas amount

Another fix in this commit concerns the receipts returned by GenerateChain. The receipts now
have properly derived fields (BlockHash, etc.) and should generally match what would be
returned by the RPC API.
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
Sina Mahmoodi
492977c671 eth/filters: fix flaky test TestPendingTxFilterDeadlock (#28376) 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
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
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
Péter Szilágyi
eb783fb381 eth/fetcher: only make noise big mismatches (#28356) 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
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
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
Péter Szilágyi
73acfd1293 eth/fetcher: fix typo 2023-11-10 11:09:46 -06:00
Péter Szilágyi
32f701ec23 eth/fetcher: throttle tx fetches to 128KB responses (#28304)
* eth/fetcher: throttle tx fetches to 128KB responses

* eth/fetcher: unindent a clause per review request
2023-11-10 11:09:46 -06:00
Martin Holst Swende
bc238e6ddb trie: remove owner and binary marshaling from stacktrie (#28291)
This change
  - Removes the owner-notion from a stacktrie; the owner is only ever needed for comitting to the database, but the commit-function, the `writeFn` is provided by the caller, so the caller can just set the owner into the `writeFn` instead of having it passed through the stacktrie.
  - Removes the `encoding.BinaryMarshaler`/`encoding.BinaryUnmarshaler` interface from stacktrie. We're not using it, and it is doubtful whether anyone downstream is either.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
41820a9bd6 eth: enforce announcement metadatas and drop peers violating the protocol (#28261)
* eth: enforce announcement metadatas and drop peers violating the protocol

* eth/fetcher: relax eth/68 validation a bit for flakey clients

* tests/fuzzers/txfetcher: pull in suggestion from Marius

* eth/fetcher: add tests for peer dropping

* eth/fetcher: linter linter linter linter linter
2023-11-10 11:09:46 -06:00
Martin Holst Swende
6ffa8094b3 all: move light.NodeSet to trienode.ProofSet (#28287)
This is a minor refactor in preparation of changes to range verifier. This PR contains no intentional functional changes but moves (and renames) the light.NodeSet
2023-11-10 11:09:46 -06:00
hyunchel
7aa36bb86b eth, params: fix typos (#28286)
* eth/ethconfig: fix typo on comment

* params/config: fix typo on comment

* eth/ethconfig: fix typo on comment
2023-11-10 11:09:46 -06:00
Péter Szilágyi
42fdae7d11 eth: when snap is complaining for missing eth, be verbose about the details (#28249)
* eth: when snap is complaining for missing eth, be verbost about the details

* eth: lower snapshot registration error verbosity
2023-11-10 11:09:46 -06:00
Péter Szilágyi
723fd06e12 core, eth, miner: start propagating and consuming blob txs (#28243)
* core, eth, miner: start propagating and consuming blob txs

* eth/protocols/eth: disable eth/67 if Cancun is enabled

* core/txpool, eth, miner: pass gas limit infos in lazy tx for mienr filtering

* core/txpool, miner: add lazy resolver for pending txs too

* core, eth: fix review noticed bugs

* eth, miner: minor polishes in the mining and announcing logs

* core/expool: unsubscribe the event scope
2023-11-10 11:09:46 -06:00
Péter Szilágyi
293fc408d9 cmd/devp2p, eth: drop eth/66 (#28239)
* cmd/devp2p, eth: drop eth/66

* eth/protocols/eth: yes sir, linter
2023-11-10 11:09:46 -06:00
Péter Szilágyi
f7547536c8 cmd, eth: switch the dev synctarget to hash from block (#28209)
* cmd, eth: switch the dev synctarget to hash from block

* cmd/utils, eth/catalyst: terminate node wyen synctarget reached
2023-11-10 11:09:46 -06:00
lightclient
aeff118aa9 eth/catalyst: add validation error in new paylaod hash mismatch (#28226)
* eth/catalyst: add validation error in new paylaod hash mismatch

* eth/catalyst/api: refactor api.invalid(..) to return nil latest valid hash if none provided
2023-11-10 11:09:46 -06:00
phenix3443
afa7d2ef82 core, eth: typos and some code formatting (#28201)
* fix: typo

* feat: revert symbol name
2023-11-10 11:09:46 -06:00
rjl493456442
bcc2e34f7e core, accounts, eth, trie: handle genesis state missing (#28171)
* core, accounts, eth, trie: handle genesis state missing

* core, eth, trie: polish

* core: manage txpool subscription in mainpool

* eth/backend: fix test

* cmd, eth: fix test

* core/rawdb, trie/triedb/pathdb: address comments

* eth, trie: address comments

* eth: inline the function

* eth: use synced flag

* core/txpool: revert changes in txpool

* core, eth, trie: rename functions
2023-11-10 11:09:46 -06:00
rjl493456442
832f048414 eth/downloader: remove header rollback mechanism (#28147)
* eth/downloader: remove rollback mechanism in downloader

* eth/downloader: remove the tests
2023-11-10 11:09:46 -06:00
Marius van der Wijden
5b22449bca eth/fetcher: allow underpriced transactions in after timeout (#28097)
This PR will allow a previously underpriced transaction back in after a timeout
of 5 minutes. This will block most transaction spam but allow for transactions to
be re-broadcasted on networks with less transaction flow.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
phenix3443
e49367e6ba eth/downloader: typo in comment (#28196) 2023-11-10 11:09:46 -06:00