base-org / op-viem

Viem extensions for the Op Stack
https://opviem.sh
MIT License
332 stars 233 forks source link

writeReplayMesssage #55

Open wilsoncusack opened 1 year ago

wilsoncusack commented 1 year ago

This would be an L2 action. I think that this should take a transaction hash and a gas limit, we would

  1. (optionally) verify that the transaction had a FailedRelayedMessage event emitted
  2. fetch the calldata of the transaction
  3. call relayMessage on the L2 cross domain messenger with the calldata from the first, (maybe new min gas limit?

See notes on this and gas limit here https://community.optimism.io/docs/protocol/deposit-flow/#replays-in-action

wilsoncusack commented 1 year ago

actually I think this is relevant to both L1 and L2

wilsoncusack commented 1 year ago

OK so actually there's probably a subtask here that is estimateRelayMessageGas which would proxy to estimate gas from viem but set the caller to 0x0000000000000000000000000000000000000001, which is an address that will cause the function to revert if it is not relayed correctly.

roninjin10 commented 12 months ago

I don't believe this is relavent to l1. It was relavent prebedrock but now replaying is done via the same methods the happy path uses