hyperlane-xyz / fuel-contracts

5 stars 2 forks source link

Understand how to get a list of contracts a transaction touches #38

Closed tkporter closed 1 year ago

tkporter commented 1 year ago

My message from Slack, no response yet:

Is there any way to perform a dry run or simulation of a transaction without specifying the contract IDs of the inputs, and to get back a list of the contracts that the tx touches? Similar to what eth_createAccessList does for EIP 2930 access lists Atm we're using .set_contracts in the rust SDK to manually set the contract IDs as a workaround, but ultimately this falls short with many of our use cases. For context, when a Hyperlane message is "delivered," it's done by calling a function on the intended recipient with the message payload, but that recipient can do whatever they'd like when processing that message, including making arbitrary calls to external contracts. We operate a relayer that delivers these messages on behalf of our users, so we'd need to simulate which external contract's they'd touch prior to us sending the delivery transaction

Considering this blocked until I get a response

At the least, I think we can do something like a brute force where we get the panic context each time we simulate a tx, get the contract that was being called, then try again: https://github.com/FuelLabs/fuel-vm/blob/master/fuel-vm/src/interpreter/flow.rs#L176

tkporter commented 1 year ago

seems like buy-in from some team members for this, need to follow up here with them

tkporter commented 1 year ago

https://rust.fuel.network/master/calling-contracts/tx-dependency-estimation.html