Commit Graph

1940 Commits

Author SHA1 Message Date
Halimao 269e80b07e
eth/tracers,trie: remove unnecessary check (#30071) 2024-06-27 11:29:50 +02:00
maskpp 00675c5876
trie/trienode: avoid unnecessary copy (#30019)
* avoid unnecessary copy

* delete the never used function ProofList

* eth/protocols/snap, trie/trienode: polish the code

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-06-20 11:47:29 +08:00
jwasinger 69351e8b0f
core/state, eth/protocols, trie, triedb/pathdb: remove unused error from trie Commit (#29869)
* core/state, eth/protocols, trie, triedb/pathdb:  remove unused error return from trie Commit

* move set back to account-trie-update block scoping for easier readability

* address review

* undo tests submodule change

* trie:  panic if BatchSerialize returns an error in Verkle trie Commit

* trie: verkle comment nitpicks

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-06-12 12:23:16 +03:00
ucwong ffb29be7d4
ethconfig: regenerate config (#29970) 2024-06-11 20:34:56 +08:00
jwasinger 85587d5ef2
cmd, core: prefetch reads too from tries if requested (#29807)
* cmd/utils, consensus/beacon, core/state: when configured via stub  flag: prefetch all reads from account/storage tries, terminate prefetcher synchronously.

* cmd, core/state: fix nil panic, fix error handling, prefetch nosnap too

* core/state: expand prefetcher metrics for reads and writes separately

* cmd/utils, eth: fix noop collect witness flag

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-06-11 11:10:07 +03:00
Hteev Oli e85e21c932
core/state, eth/tracers: fix typos (#29932) 2024-06-05 11:07:37 +02:00
tianyeyouyou a6751d6fc8
core/rawdb,eth/protocols,p2p: prealloc slice size (#29893)
chore: prealloc slice size
2024-06-03 15:51:04 +03:00
Chris Ziogas c9e0b3105b
Supply delta live tracer (#29347)
Introduces the first built-in live tracer. The supply tracer tracks ETH supply changes across blocks
and writes the output to disk. This will need to be enabled through CLI using the `--vmtrace supply` flag.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-06-03 12:30:27 +02:00
yujinpark 5d7d48fc3e
eth/gasprice: add comment to constant (#29892)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-05-30 18:22:23 +02:00
Felix Lange 6bb13e8e2b
eth/catalyst: ensure TxPool is synced in Fork (#29876)
This should fix an occasional test failure in ethclient/simulated.TestForkResendTx.
Inspection of logs revealed the cause of the failure to be that the txpool was not done
reorganizing by the time Fork is called.
2024-05-29 15:56:52 +02:00
trillo 2f0e63e5ac
eth/downloader, eth/tracer: fix typos in comments (#29707) 2024-05-29 14:43:07 +02:00
PolyMa 06263b1b35
all: fix typos in comments (#29873)
fix using `a` & `the` simutaneously
2024-05-29 12:24:10 +02:00
jwasinger e517183719
eth, eth/downloader: remove references to LightChain, LightSync (#29711)
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-05-28 19:52:08 +02:00
trillo caafa93598
all: improve some error strings (#29842) 2024-05-28 13:44:40 +02:00
Sina M ea6c16007c
eth/tracers: clear error for non-reverting pre-homestead fail (#29824) 2024-05-28 13:12:46 +02:00
rjl493456442 513276864b
eth/downloader: fix flaky test (#29852)
This pull request fixes the flay test TestSkeletonSyncRetrievals. In this test, we first
trigger a sync cycle and wait for it to meet certain expectations. We then inject a new
head and potentially also a new peer, then perform another final sync. The test now
performs the newPeer addition before launching the final sync, and waits a bit for that
peer to get registered. This fixes the logic race that made the test fail sometimes.

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2024-05-27 16:26:55 +02:00
Mobin Mohanan 7224576fba
core, eth/protocols/snap, internal/ethapi: remove redundant types (#29841) 2024-05-27 14:39:39 +08:00
Sina M fa581766f5
eth/tracers: fix json logger for evm blocktest (#29795) 2024-05-23 10:55:54 +02:00
Martin HS 7fd7c1f7dd
eth/tracers: fix basefee context for traceBlock (#29811)
This fixes an issue for `debug_traceBlock*` methods where the BASEFEE opcode was returning always 0. This caused the method return invalid results.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-05-21 18:27:36 +02:00
rjl493456442 473ee8fc07
trie, eth/protocols/snap: sanitize the committed node data (#29485) 2024-05-16 17:58:35 +08:00
rjl493456442 9ec50080eb
core: use in-memory freezer for tests (#29720)
* core: simplify chain tests

* core, eth, cmd: use in-memory freezer for tests

* core: restore tests
2024-05-08 09:43:33 +03:00
nand2 d6e91e2e05
eth/gasestimator: include blobs in virtual balance computation (#29703)
Fixes #29702

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-05-07 14:27:14 +02:00
Nathan e4b8058d5a
eth/gasprice: add query limit for FeeHistory to defend DDOS attack (#29644)
* eth/gasprice: add query limit for FeeHistory to defend DDOS attack

* fix return values after cherry-pick

---------

Co-authored-by: Eric <45141191+zlacfzy@users.noreply.github.com>
2024-05-07 10:25:15 +03:00
rjl493456442 9f96e07c1c
core/rawdb, trie: improve db APIs for accessing trie nodes (#29362)
* core/rawdb, trie: improve db APIs for accessing trie nodes

* triedb/pathdb: fix
2024-04-30 16:25:35 +02:00
jwasinger 45baf21111
eth/downloader: purge pre-merge sync code (#29281)
This PR removes pre-merge sync logic from the downloader. Now-irrelevant tests are removed and others have been updated.
2024-04-30 15:46:53 +02:00
lightclient 2e8e35f2ad
all: refactor so `NewBlock`, `WithBody` take `types.Body` (#29482)
* all: refactor so NewBlock(..) and WithBody(..) take a types.Body

* core: fixup comments, remove txs != receipts panic

* core/types: add empty withdrawls to body if len == 0
2024-04-30 14:55:08 +02:00
Dragan Milic 7c7e3a77fc
eth/tracers/native: fix flatCallTracer Stop() bug (#29623)
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-04-30 14:33:22 +02:00
Undefinedor a13b92524d
eth/protocols/eth,p2p/discover: remove unnecessary checks (#29590)
fix useless condition
2024-04-25 08:40:29 +02:00
jwasinger 5f3c58f1de
eth/downloader: fix case where skeleton reorgs below the filled block (#29358)
This change adds a testcase and fixes a corner-case in the skeleton sync.

With this change, when doing the skeleton cleanup, we check if the filled header is acually within the range of what we were meant to backfill. If not, it means the backfill was a noop (possibly because we started and stopped it so quickly that it didn't have time to do any meaningful work). In that case, just don't clean up anything.

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-04-24 09:07:39 +02:00
Matthieu Vachon ade7515c81
eth, eth/tracers: process beacon root before transactions (#29402)
The beacon root when applied in `state_processor.go` is performed right before executing transaction. That means that contract reliying on this value would query the same value found in the block header.

In that spirit, it means that any tracing/operation relying on state data which touches transaction must have updated the beacon root before any transaction processing.
2024-04-24 07:58:05 +02:00
Chris Ziogas 882d1e22f6
cmd/geth, cmd/utils: rename config and flag to` VMTraceJsonConfig` (#29573)
renames the yaml config field VMTraceConfig to VMTraceJsonConfig, in order to be consistent with the renaming of the CLI flag.
2024-04-24 07:53:16 +02:00
haoran b2b0e1da8c
all: fix various typos (#29600)
* core: fix typo

* rpc: fix typo

* snap: fix typo

* trie: fix typo

* main: fix typo

* abi: fix typo

* main: fix field comment for basicOp
2024-04-23 13:09:42 +03:00
Martin HS 853e0c23f3
eth/catalyst, trie/pathdb: fix flaky tests (#29571)
This change fixes three flaky tests `TestEth2AssembleBlock`,`TestEth2NewBlock`, `TestEth2PrepareAndGetPayload` and `TestDisable`.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-04-23 10:33:36 +02:00
Ryan Schneider 1ec7af2612
eth: Add eth_blobBaseFee RPC and blob fields to eth_feeHistory (#29140)
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-04-22 12:17:06 +02:00
Felix Lange 82b0dec713
eth/filters: remove support for pending logs (#29574)
This change removes support for subscribing to pending logs. 

"Pending logs" were always an odd feature, because it can never be fully reliable. When support for it was added many years ago, the intention was for this to be used by wallet apps to show the 'potential future token balance' of accounts, i.e. as a way of notifying the user of incoming transfers before they were mined. In order to generate the pending logs, the node must pick a subset of all public mempool transactions, execute them in the EVM, and then dispatch the resulting logs to API consumers.
2024-04-22 10:31:17 +02:00
ids 81349ff6e5
eth/catalyst: fix typo (#29580) 2024-04-19 09:58:14 +02:00
ucwong 5f95145308
eth/ethconfig: regenerate autogen files (#29559)
eth/ethconfig/gen_config.go : go generate fix
2024-04-18 08:21:23 +02:00
law wang fadd9d8b81
eth/catalyst: fix log (#29549)
log:output the correct variable

Co-authored-by: steven <steven@stevendeMacBook-Pro.local>
2024-04-16 11:21:20 +02:00
rjl493456442 d3c4466edd
core, eth/protocols/snap, trie: fix cause for snap-sync corruption, implement gentrie (#29313)
This pull request defines a gentrie for snap sync purpose.

The stackTrie is used to generate the merkle tree nodes upon receiving a state batch. Several additional options have been added into stackTrie to handle incomplete states (either missing states before or after).

In this pull request, these options have been relocated from stackTrie to genTrie, which serves as a wrapper for stackTrie specifically for snap sync purposes.

Further, the logic for managing incomplete state has been enhanced in this change. Originally, there are two cases handled:

-    boundary node filtering
-    internal (covered by extension node) node clearing

This changes adds one more:
 
- Clearing leftover nodes on the boundaries.

This feature is necessary if there are leftover trie nodes in database, otherwise node inconsistency may break the state healing.
2024-04-16 09:05:36 +02:00
Martin HS ef5ac3fb7a
eth/filters: enforce topic-limit early on filter criterias (#29535)
This PR adds a limit of 1000 to the "inner" topics in a filter-criteria
2024-04-15 17:35:35 +02:00
Abirdcfly b179b7b8e7
all: remove duplicate word in comments (#29531)
This change removes some duplicate words in in comments
2024-04-15 08:34:31 +02:00
rjl493456442 9dcf8aae47
eth/protocols/snap: skip retrieval for completed storages (#29378)
* eth/protocols/snap: skip retrieval for completed storages

* eth/protocols/snap: address comments from peter

* eth/protocols/snap: add comments
2024-04-10 12:02:45 +03:00
Aaron Chen 34aac1d756
all: use big.Sign to compare with zero (#29490) 2024-04-09 12:14:30 +02:00
Bin 0bbd88bda0
all: use timer instead of time.After in loops, to avoid memleaks (#29241)
time.After is equivalent to NewTimer(d).C, and does not call Stop if the timer is no longer needed. This can cause memory leaks. This change changes many such occations to use NewTimer instead, and calling Stop once the timer is no longer needed.
2024-04-09 08:51:54 +02:00
Martin HS 7aafad2233
core/vm: better error-info for vm errors (#29354) 2024-04-06 12:22:55 +02:00
Aaron Chen ccb76c01d7
eth/tracers: use slices.Contains (#29461) 2024-04-06 12:16:25 +02:00
Aaron Chen 74995bf8a1
all: use slices.Contains (#29459)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-04-06 12:05:06 +02:00
lmittmann a851e39cbe
core/types: use new atomic types in caches (#29411)
* use generic atomic types in tx caches

* use generic atomic types in block caches

* eth/catalyst: avoid copying tx in test

---------

Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-04-04 16:50:31 +03:00
cui 7bb3fb1481
eth: simplify peer counting logic (#29420) 2024-04-03 14:08:52 +08:00
cui a83e57666d
eth/fetcher: using slices.Contains (#29383) 2024-04-02 21:17:34 +02:00