NomicFoundation / edr

An Ethereum development runtime implementation that can be reused to build new developer tools.
MIT License
49 stars 7 forks source link

Error when running debug_traceTransaction on chain fork from Base and Base Sepolia #570

Open PiotrRumblefish opened 1 month ago

PiotrRumblefish commented 1 month ago

When trying to run anything on base / base sepolia, I'm getting "Invalid transaction: GasPriceLessThanBasefee" error from https://github.com/NomicFoundation/revm/blob/aceb0939b1712faa0e8f45c1f5621c11b81df94e/crates/primitives/src/env.rs#L333

example: 0xe565eb3bfd815efcc82bed1eef580117f9dc3d6896db42500572c8e789c5edd4 chainId: 84532

way to reproduce: https://github.com/rumblefishdev/edr-issues-570-reproduce

agostbiro commented 1 month ago

Created Rust repro: https://github.com/NomicFoundation/edr/blob/be9033933c6e1185a285310b6a799d4af72d67dd/crates/edr_provider/tests/issues/issue_570.rs

fvictorio commented 1 month ago

Hi @PiotrRumblefish. The problem here and in https://github.com/NomicFoundation/edr/issues/595 is that the debugged txs are in a block that contains unsupported transaction types. The error message should be better though (I opened https://github.com/NomicFoundation/edr/issues/597 for that).

The underlying issue is that, to use debug_traceTransaction with a transaction, you need to re-run all the previous transactions in the block. If those transactions have unsupported types (which is very common in L2s), then we can't re-run them. We could skip them, but that might result in the debugged transaction being executed in a different way, and we'd rather fail than give misleading results.

We are working on having better support for L2s, which will help with issues like this. I don't have an ETA though because it's a big ongoing effort.

kowalski commented 1 month ago

@fvictorio actually for our usecase I think it would be sufficient if an option like unsafe_skipUnsupportedTransactionTypes: true were added in chain config. I understand the argument that the transaction preceding our transaction in the block could have influenced the storage we touch, but in the wild this situation would be rare so it would be a good workaround and something you could possibly put together way quicker than full support for everything

fvictorio commented 1 month ago

That's a good point @kowalski, thanks! I opened https://github.com/NomicFoundation/edr/issues/601 for that.