fix: Replay raw txs without tweaks in anvil_reorg by spalladino · Pull Request #10442 · foundry-rs/foundry (original) (raw)
Motivation
anvil_reorg
accepts signed tx objects (as hex) or JSON tx requests to include in the new chain. However, txs are not executed as-is, as they are treated as tx requests and passed through build_typed_tx_request
. This is confusing to users, and also hits a bug in TryFrom<TypedTransaction> for TransactionRequest
where not all fields are correctly propagated (eg blobs).
Solution
This PR modifies the behaviour of anvil_reorg
so any signed raw txs are replayed as-is instead of converted to a request and then back to a tx. The behaviour for any JSON tx requests remains as is.
PR Checklist
I haven't tweaked docs since this method is not documented, and tests still pass. I can add more tests if there's agreement in that this PR makes sense!