Support cast run quorum private txn
This PR is raised to support debugging Quorum private transactions with cast run. Context: https://github.com/foundry-rs/foundry/issues/9057
Motivation
Quorum private transactions are not generating the right traces with cast tooling due to the way that the client masks the actual transaction input data.
Solution
Quorum private transactions have a specified format that is unique to the blockchain. The transaction input is a 64 bytes Tessera hash, and the recovery id of a private transaction can only be 37/38. Based on the criteria, we can get the CLI to make an additional RPC call to fetch the actual private transaction input data to replace the tessera hash.
Personally not a fan as it is highly vendor specific and therefore I would be hesitant to add this; not because of the proposed functionality of implementation but whenever we implement a feature in Foundry we try to be as neutral as possible, avoid having vendor-specific logic and avoid enshrining winners.
A good example of how a vendor specific request for Kontrol cheatcodes was turned into generalized functionality available to all and non-specific can be seen here: https://github.com/foundry-rs/foundry/issues/4072
Personally not a fan as it is highly vendor specific and therefore I would be hesitant to add this; not because of the proposed functionality of implementation but whenever we implement a feature in Foundry we try to be as neutral as possible, avoid having vendor-specific logic and avoid enshrining winners.
A good example of how a vendor specific request for Kontrol cheatcodes was turned into generalized functionality available to all and non-specific can be seen here: #4072
Got it. @zerosnacks What do you think of a generic functionality like below?
Problem:
Currently, there's no way to override or modify input data when simulating a transaction execution by hash. Doing so is useful for exploring what-ifs at the specified txn height and save time manually crafting an exact EVM state which may be extremely tedious.
This is also no available or equivalent on cast call because cast call does not provide a way to simulate state at a transaction height within a block.
Proposed Feature:
- Add a flag
--input-override=0x39481934/--input-override=MODE:RAW:0x39481934to thecast run <txHash>call. Doing so will allow us to simulate the txn call at the txn height with a different payload. - Add support for a Quorum mode, e.g.
--input-override=MODE:QUORUM. This will letcastfetch the input override from an external source.
I think the functionality you describe could be useful, so I would recommend you open an issue to discuss it further. In the meantime, closing this PR for reasons above.