Commit graph

15406 commits

Author SHA1 Message Date
Matthieu Vachon
421cc2a76d Fixed missing OnNewAccount hook
Firehose: In previous versions of the EVM, there was no `evm.StateDB.Exist` above and the `CreateAccount` was always called. This was leading to always get a `OnNewAccount` event in the tracer as we were not checking previous existence of the account.

With the introduction of the `Exist` method, there is now cases where `CreateAccount` is not called if it was previously existing.

To keep the same tracing behavior as before, we call the `OnNewAccount` manually here if the account was previously existing.
2025-02-10 11:04:43 -05:00
Matthieu Vachon
2cfff4e562 Added two new test cases and fixed double suicide withdraw
The StateDB SelftDestruct6780 must not record a balance change since the `opSelfdestruct6780` instruction implementation already calls `StateDB.SubBalance` to deduce the suicide refund.

The second test case show case a new account creations in 2.3 but that doesn't appear when running in backward compatibility mode using 3.0 version of the tracer.
2025-02-08 12:29:54 -05:00
Matthieu Vachon
5f3d5f3f19 Removed a bit of useless tracing in Firehose tracer 2025-02-07 16:56:09 -05:00
Matthieu Vachon
69012519aa Updated generate-prestate with removal of totalDifficulty 2025-02-07 16:55:45 -05:00
Matthieu Vachon
943de0bf94 Fixed bug in OnCodeChange missing in some cases while it was before 2025-02-06 13:42:40 -05:00
Matthieu Vachon
33e06f6765 Updated protobuf to latest version 2025-01-27 14:23:29 -05:00
Matthieu Vachon
eac7dd4d56 Ensure tests are still working properly 2025-01-27 14:23:16 -05:00
Matthieu Vachon
0435f76787 Allow simulated_beacon to work when some forks are inactive 2025-01-10 13:02:14 -05:00
Matthieu Vachon
a8d379c482 Fix Firehose 2.3 compatibility mode regarding ordering of suicide balance change 2025-01-08 17:12:04 -05:00
Matthieu Vachon
8baf43f2a3 Fixed extraneous CodeChange now recorded since Geth 1.14.12 merge
Geth 1.14.12 introduced new `OnCodeChange` emitting which breaks Firehose tracing which is not recording those.

Changed a big how we record call suicide and ignore `CodeChange` that makes the contract empty when a call is suicided.
2025-01-08 17:09:46 -05:00
Matthieu Vachon
12f070888f Added support for FIREHOSE_ETHEREUM_TRACER_LOG_LEVEL=trace_full
Now `trace` alone will not print the opcodes which makes it much harder to track log lines and usually is not that useful.

The `trace_full` is same as `trace` but logs `OpCode`.
2025-01-08 17:07:31 -05:00
Matthieu Vachon
069b0b36ba Moved blockIsPrecompiledAddr state variable inside the // Block section 2025-01-08 10:42:48 -05:00
Matthieu Vachon
f6edb601fa Disabled geth --dev precompiles genesis balances 2024-12-21 15:32:20 -05:00
Matthieu Vachon
3cbe387cd6 Added a backward compatibility fix for aligning with Firehose 2.3 2024-12-20 16:20:00 -05:00
Matthieu Vachon
2ff5f62b6f Added a an extra logging for storage change in trace mode 2024-12-20 16:19:23 -05:00
Matthieu Vachon
f972a30c63 Added some form of support for using go build/ci.go tooling with Firehose branch 2024-12-20 16:18:59 -05:00
Matthieu Vachon
d1f03614a4 Merge tag 'v1.14.12' into firehose-fh3.0
# Conflicts:
#	cmd/geth/misccmd.go
#	core/state/statedb.go
#	core/state_processor.go
#	go.mod
2024-12-17 16:01:41 -05:00
Matthieu Vachon
9bf4d2482f Added code to generate prestate test from RPC nodes
Alchemy and QuickNode offers `debug_traceTransaction` that we need, use one of them with a paid plan to generate prestate tests.
2024-05-01 19:31:22 -04:00
Matthieu Vachon
b567b08329 Added unit test to check different keccak256 on transaction 2024-05-01 19:26:40 -04:00
Matthieu Vachon
bc4162e99f Refactored tests and added new based on "prestate" testing 2024-05-01 13:41:36 -04:00
Matthieu Vachon
dccb2f36cd Fixed the rare case where a tx receipt is nil
I think this cannot happen in the wild while syncing block, otherwise it would mean the transaction would have no receipt which is impossible.

However in testing conditions or when doing "speculative exeuction", it's possible to get that condition.

This is just to better deal with a potential `nil pointer exception`.
2024-05-01 13:41:36 -04:00
Matthieu Vachon
f0dcb13f6b Fixed opcode representation when debugging via firehose(Info|Debug|Trace) call 2024-05-01 13:41:36 -04:00
Matthieu Vachon
f8c889f892 Fixed Kecakke256 computation panics in some transaction state
The EVM does memory expansion **after** notifying us about OnOpcode which we use to compute Keccak256 pre-images now. This creates problem when we want to retrieve the preimage data because the memory is not expanded yet but in the EVM is going to work because the memory is going to be expanded before the operation is actually executed so the memory will be of the correct size.

In this situation, we must pad with zeroes when the memory is not big enough.
2024-05-01 13:41:31 -04:00
Matthieu Vachon
c327b4d7fc Added first pass on integration tests 2024-04-29 17:10:51 -04:00
Matthieu Vachon
e3a43bf49c Removed callerView
This can work only if resolve at call site directly, which we don't want to do.
2024-04-29 17:10:37 -04:00
Matthieu Vachon
27ace57951 Renamed callerViewer to _callViewer to align with other "view" structs 2024-04-29 11:50:19 -04:00
Matthieu Vachon
8d802608f5 Adding standard Geth logging on NewFirehose and on OnBlockchainInit 2024-04-29 11:34:59 -04:00
Matthieu Vachon
bb041978a7 Added back OnSystemCallStart/End that were lost in update to latest Geth version 2024-04-29 10:37:32 -04:00
Matthieu Vachon
a4e3ab8818 Merge tag 'v1.14.0' into firehose-fh3.0 2024-04-24 09:02:12 -04:00
Péter Szilágyi
87246f3cba params: release Geth v1.14.0 2024-04-24 11:02:49 +03: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
fb08fd334a
core/tracing: Add OnClose Trace Hook (#29629)
The OnClose trace hook is being triggered on blockchain Stop, so as tracers can release any resources.
2024-04-24 07:54:59 +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
Matthieu Vachon
a64a69dbfc Merge remote-tracking branch 'origin/master' into firehose-fh3.0
# Conflicts:
#	go.mod
2024-04-23 15:40:14 -04:00
Mario Vega
94579932b1
core/vm: fix Prague contracts (#29612)
core/vm: fix prague contracts
2024-04-23 15:10:24 +02:00
Felföldi Zsolt
256d4b099c
beacon/light: request finality update explicitly when necessary (#29567)
This PR adds an extra mechanism to sync.HeadSync that tries to retrieve the latest finality update from every server each time it sends an optimistic update in a new epoch (unless we already have a validated finality update attested in the same epoch). 

Note that this is not necessary and does not happen if the new finality update is delivered before the optimistic update. The spec only mandates light_client_finality_update events when a new epoch is finalized. If the chain does not finalize for a while then we might need an explicit request that returns a finality proof that proves the same finality epoch from the latest attested epoch.
2024-04-23 13:31:32 +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
Aaron Chen
709e0b3997
metrics: remove librato (#29624) 2024-04-23 13:08:02 +03:00
HAOYUatHZ
0e380ddaf7
miner: fix typos (#29625) 2024-04-23 13:06:25 +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
Matthieu Vachon
7ae7701b37 Added further tracing on config and apply backward compatibility value 2024-04-22 14:22:14 -04:00
Matthieu Vachon
2108b9d42a Fixed a few linting errors 2024-04-22 14:22:03 -04:00
rjl493456442
acd1eaae2c
core: remove bad block checks (#29609) 2024-04-22 20:00:42 +03:00
Felföldi Zsolt
e6689fe090
beacon/light/sync: print error log if checkpoint retrieval fails (#29532)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-04-22 13:19:42 +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
Péter Szilágyi
c2dfe7a0c7
go.mod: update golang/x repos (#29604) 2024-04-22 12:56:54 +03: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
xiaodong
ad3d8cb12a
cmd/geth: remove unused parameter (#29602) 2024-04-22 16:13:03 +08:00
Aaron Chen
28ccb2bbf8
build: fix string compare for SortFunc (#29595) 2024-04-21 11:14:13 +02:00