What message expiration is, why it exists, and how to reemit a previously sent message if it has expired and was never relayed.
Messages referenced between OP Stack chains have a limited validity period called the expiry window. Once this window elapses, the referenced message becomes invalid and can no longer be referenced.For messages using L2ToL2CrossDomainMessenger, if a message expires before being referenced, developers can reemit the message on the source chain. This triggers a fresh SentMessage event, enabling the message to be relayed.
The expiry window is an offchain constant, defined by OP-Supervisor, that defines how long a cross-chain message or event emitted remains valid. For any chain in the Superchain interop cluster, messages must be referenced within 7 days (604,800 seconds) of the log being created.After this period, a message can no longer be referenced unless the event is remitted.
The resendMessage function on the L2ToL2CrossDomainMessenger contract allows developers to reemit a message that was sent but not yet relayed.This emits a new SentMessage log with the same content as the original message, enabling offchain relayers to pick it up again.The process to reemit an expired message:
Call resendMessage on the origin chain to reemit the message event. The contract verifies the message hash was originally sent. The call requires every parameter to rebuild the original message.