L1CrossDomainMessenger Interop
Table of Contents
Overview
With interop, the L1CrossDomainMessenger gains two functions. Each sends one fixed call to one fixed L2 target, as
a deposit, with the L1CrossDomainMessenger itself as the L1 sender:
relayUndeliveredMessagepasses on word that a message was not relayed, for message expiry.syncETHLiquidityPausesends this chain's pause state toETHLiquidity, for theETHLiquiditypause.
L2 trusts the L1CrossDomainMessenger as the sender of these calls (see
iME-003).
relayMessage refuses messages that target
the messenger itself or its portal, so a relayed message cannot make the messenger the L1 sender. The rest of the
messenger is unchanged; see Messengers.
Constants
| Constant | Value |
|---|---|
EXPIRE_MESSAGE_GAS_LIMIT | 100000 |
SET_ETH_LIQUIDITY_PAUSED_GAS_LIMIT | 200000 |
Function Specification
relayUndeliveredMessage
Passes on, to this chain, word from another chain that it has not relayed a message sent from this chain.
function relayUndeliveredMessage(bytes32 _messageHash, uint256 _undeliveredAt) external;
- MUST revert with
L1CrossDomainMessenger_InteropNotEnabledunless this chain'sSystemConfighas theINTEROPfeature enabled. - MUST revert with
L1CrossDomainMessenger_Pausedwhile this chain is paused, asrelayMessagedoes. - MUST revert unless all of these hold. When the caller's getters return, the revert is
L1CrossDomainMessenger_NotInteropMessenger.- the
SystemConfigof the caller's portal names the caller as itsl1CrossDomainMessenger; - this chain's
ETHLockboxauthorizes the caller's portal; - the caller's
xDomainMessageSender()is theUndeliveredMessageExporter.
- the
- MUST send
L2ToL2CrossDomainMessenger.expireMessage(_messageHash, _undeliveredAt)to this chain as a deposit, as itself, with a minimum gas limit ofEXPIRE_MESSAGE_GAS_LIMIT.
It does not check which chain the message hash names as its destination. That binding comes from the exporter; see aME-001.
If relayUndeliveredMessage reverts, such as when it runs out of gas, the calling messenger records it as a failed
message, and it can be replayed. A caller that shares this chain's ETHLockbox pauses together with this chain, so it
cannot relay the call while this chain is paused.
syncETHLiquidityPause
Sends this chain's pause state to ETHLiquidity.
function syncETHLiquidityPause() external;
- MUST be callable by anyone.
- MUST revert with
L1CrossDomainMessenger_InteropNotEnabledunless this chain'sSystemConfighas theINTEROPfeature enabled. - MUST NOT revert while this chain is paused.
- MUST send
ETHLiquidity.setPaused(paused(), nonce)to this chain as a deposit, as itself, with a minimum gas limit ofSET_ETH_LIQUIDITY_PAUSED_GAS_LIMIT, wherenonceis the versioned nonce of that message.