How it works
Outgoing messages from L2 cannot provide in-protocol automatic L1 execution
because Ethereum doesn’t offer scheduled execution affordances through the L1
node.
ArbL2ToL1Hook
sends the encoded function call with the messageId
to the ArbSys
precompile on the L2. After waiting for the withdrawal period, you can use the getOutboxProof()
on the L2 to get a merkle proof of the message. From here, you have two options:
- Option A. You can call the
ArbL2ToL1Ism
’s verify function via themailbox.process()
call with the proof and the other encoded data which in turn calls theoutbox.executeTransaction()
checking for the message sender and message data validity. - Option B. You can directly call the
outbox.executeTransaction()
with the proof and the other encoded data. However, you’ll need to make a second call to theArbL2ToL1Ism
’s verify function to deliver the message. This option also you delivery of message values to the recipient contract.
Option A
Option B
Note: here, the relayer is responsible for encoding the message proof fromarbSys.getOutboxProof()
and calling the outbox.executeTransaction()
function.