-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: geth tracer returns hallucinated slot read data #6429
Comments
can you give some other examples for transactions that have incorrect prestate? |
are you sure about this @sslivkoff :
|
it's what happens when I do
|
heres a bunch of examples in this format
I believe the only valid slots for this contract are the 0x000000...000X. all of the hashy slots are in error afaict
|
Checked the first tx, it looks like the balance check in the transactions for WETH are attributed to the wrong address. If you see here: https://evm.storage/eth/0xbbf35f2a055cec9238d3740343249a0d7d9593580edd940d37a52e400273730f The first call to |
this might be fixed by paradigmxyz/revm-inspectors#15 which will land with alpha17 |
mentioned in that issue:
my understanding is that the prestate tracer should include all read slots, not just changed slots |
that contradicts what is written here https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers
|
That's true, although the code suggests that only state that is strictly modified is included, and I haven't seen anything suggest otherwise. I guess the only way to find out is to run a call :/ |
I'm not sure what's going on with the geth code but it seems like the documented description is quite important functionality being able to create state witnesses and measure reads more generally will be important for understanding state growth and studying the verkle transition |
I think this is the issue the prestate tracer has two modes, prestate mode and diff mode. When |
I'll revisit this once alpha17 is rolled out on reth-public tonight |
Good catch |
@sslivkoff thanks for the reference, I previously overlooked that should be fixed with the evm-inspector pr |
prestate tracer should include all slots and don't do any cleanup because cleanup skipped if not diffmode: https://github.com/ethereum/go-ethereum/blob/fc380f52ef9778e988266f776b9593ce719cf79d/eth/tracers/native/prestate.go#L187-L189 ref paradigmxyz/reth#6429
Closed by paradigmxyz/revm-inspectors#18 (will take some dep bumps to resolve) |
Describe the bug
Performing a
debug_traceBlockByNumber
trace with theprestateTracer
tracer, reth hallucinates some storage reads in the returned RPC response.For example, let's say we trace the transaction
0xc44ae9dc6047d56f0027f9e92e2a8d4e515e14e016bdfb7ff04f299cdfc29509
. Erigon says there are 11 storage slot reads. Reth says there are 13 storage slot reads. The two extra slot reads from reth are in contract0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad
. This is the uniswap universal router contract, and it basically has only two storage slots that have been there since deployment. But reth claims that this contracts slot0xe03178286da22a27dd0b1f68fb538cd07bc9080172ee9a5a2238416fe86db02a
was read. This slot does not exist so far as I can tell.Scanning many other blocks and contracts, there are lots of false reads attributed to non-existent slots of this contract in particular.
Steps to reproduce
I used the command
cryo storage_reads -b 18.8M:+1 -r RPC_URL
to extract data files for both reth and erigon. The transaction listed above0xc44ae9dc6047d56f0027f9e92e2a8d4e515e14e016bdfb7ff04f299cdfc29509
is the first transaction in block 18,800,000.Under the hood this uses geth traces
debug_traceBlockByNumber
with theprestateTracer
tracerNode logs
No response
Platform(s)
Linux (x86)
What version/commit are you on?
This is the reth public node: reth Version: 0.1.0-alpha.10 Commit SHA: 2e73e21 Build Timestamp: 2023-11-03T20:23:02.271051235Z Build Features: default,jemalloc Build Profile: release
What database version are you on?
Current database version: 1
Local database is uninitialized
What type of node are you running?
Archive (default)
What prune config do you use, if any?
No response
If you've built Reth from source, provide the full command you used
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: