diff --git a/pages/interop/_meta.json b/pages/interop/_meta.json index 6eeac3008..8506dbcd9 100644 --- a/pages/interop/_meta.json +++ b/pages/interop/_meta.json @@ -12,6 +12,7 @@ "explainer": "Superchain interop explainer", "predeploy": "Superchain interop predeploys", "message-passing": "Superchain interop message passing", + "message-expiration": "Message expiration", "reading-logs": "Reading logs", "op-supervisor": "OP Supervisor", "superchain-eth-bridge": "Superchain ETH bridge", diff --git a/pages/interop/message-expiration.mdx b/pages/interop/message-expiration.mdx new file mode 100644 index 000000000..ed5cc1ac5 --- /dev/null +++ b/pages/interop/message-expiration.mdx @@ -0,0 +1,53 @@ +--- +title: Message expiration +description: What message expiration is, why it exists, and how to reemit a previously sent message if it has expired and was never relayed. +lang: en-US +content_type: guide +topic: message-expiration +personas: + - protocol-developer + - chain-operator + - app-developer +categories: + - protocol + - interoperability + - cross-chain-messaging + - security + - block-safety + - message-passing + - reorgs + - superchain +is_imported_content: 'false' +--- + +# Message expiration + +[Messages](/interop/message-passing) 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`](/interop/message-passing), 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 + +The expiry window is an offchain constant, defined by [OP-Supervisor](/interop/op-supervisor), that defines how long a cross-chain message or event emitted remains valid. For any chain in the [Superchain interop cluster](/interop/explainer#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. + +## Reemitting an expired message + +The `resendMessage` function on the [`L2ToL2CrossDomainMessenger`](/interop/message-passing) 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: + +1. Call [`resendMessage`](https://github.com/ethereum-optimism/optimism/blob/a979a9444dbb482843f2a42f437ced54a8ac1053/packages/contracts-bedrock/interfaces/L2/IL2ToL2CrossDomainMessenger.sol#L110-L128) on the origin chain to reemit the message event. The contract verifies the message hash was originally sent. The call requires [every parameter](https://github.com/ethereum-optimism/optimism/blob/a979a9444dbb482843f2a42f437ced54a8ac1053/packages/contracts-bedrock/interfaces/L2/IL2ToL2CrossDomainMessenger.sol#L110-L128) to rebuild the original message. + +2. [Relay the new message](/interop/message-passing#executing-message) as normal. + +Note: Re-emitting an already relayed message will have no effect on the destination chain since the re-emitted event won't be logged by OP-Supervisor. + +## Next steps + +* [Build a revolutionary app](/app-developers/get-started) that uses multiple blockchains within the Superchain +* Learn how to [pass messages between blockchains](/interop/tutorials/message-passing) +* Deploy a [SuperchainERC20](/interop/tutorials/deploy-superchain-erc20) to the Superchain diff --git a/pages/interop/message-passing.mdx b/pages/interop/message-passing.mdx index b40938537..7b51dbedf 100644 --- a/pages/interop/message-passing.mdx +++ b/pages/interop/message-passing.mdx @@ -101,7 +101,7 @@ sequenceDiagram dstXdom->>dstContract: 5. Call with provided calldata ``` -1. Before the executing message is processed, the log event of the initiating message has to get to `op-supervisor` on the destination chain. +1. Before the executing message is processed, the log event of the initiating message has to get to `op-supervisor` on the destination chain before the [expiry window](/interop/message-expiration) of 7 days. 2. The autorelayer, the application, or a contract calling on the application's behalf calls [`L2ToL2CrossDomainMessenger.relayMessage`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L150-L203). This call includes the message that was sent (`_sentMessage`), as well as the [fields required to find that message (`_id`)](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/interfaces/L2/ICrossL2Inbox.sol#L4-L10). @@ -110,12 +110,12 @@ sequenceDiagram 4. `L2ToL2CrossDomainMessenger` on the destination chain verifies the message is legitimate: - * The origin (of the log entry) is `L2ToL2CrossDomainMessenger` on the other side. - * The destination chain ID is correct. - * The target is neither `CrossL2Inbox` nor `L2ToL2CrossDomainMessenger`. - * This message has not been relayed before. - - This is the reason we need the nonce value, to enable us to send multiple messages that would be otherwise identical. + * `_destination`: Chain ID of the destination chain. + * `_nonce`: Nonce of the message sent + * `_sender`: Address that sent the message + * `_target`: Target contract or wallet address. + * `message`: Message payload to call target with. + 5. If everything checks out, `L2ToL2CrossDomainMessenger` calls the destination contract with the calldata provided in the message. diff --git a/pages/interop/reading-logs.mdx b/pages/interop/reading-logs.mdx index 2a2bfcd5c..9221fc197 100644 --- a/pages/interop/reading-logs.mdx +++ b/pages/interop/reading-logs.mdx @@ -27,6 +27,10 @@ This enables developers to: * Build cross-chain applications that react to events happening across the Superchain. * Create novel applications that leverage data from multiple chains. + +When reading logs, you must reference logs created within the [expiry window of 7 days](/interop/message-expiration). + + ## Why use `CrossL2Inbox`? * **Reference existing logs**: Allows contracts to verify and use logs that were already emitted, without requiring those logs to have been sent as cross-chain messages. diff --git a/words.txt b/words.txt index ead225f77..b2d3f4106 100644 --- a/words.txt +++ b/words.txt @@ -1,7 +1,7 @@ -accountqueue ACCOUNTQUEUE -accountslots +accountqueue ACCOUNTSLOTS +accountslots ACDC ADDI ADDIU @@ -9,58 +9,58 @@ ADDU airgap Allnodes allocs -alphanet Alphanet -alphanets +alphanet Alphanets +alphanets altda ANDI Ankr Apeworx Arweave authrpc -autorelay Autorelay +autorelay autorelayer basefee bcde -betanet Betanet -betanets +betanet Betanets +betanets BGEZ BGTZ Biconomy BLEZ -blobpool BLOBPOOL +blobpool blobspace Blockdaemon blockhash blocklists -blocklogs BLOCKLOGS -blockprofilerate +blocklogs BLOCKPROFILERATE +blockprofilerate Blockscout -blockspace Blockspace +blockspace blocktime -blocktimes Blocktimes -bloomfilter +blocktimes BLOOMFILTER +bloomfilter BLTZ Bootcamp bootnode -bootnodes -Bootnodes BOOTNODES +Bootnodes +bootnodes bottlenecked -brotli Brotli -callouts +brotli Callouts +callouts CCIP cdef Celestia @@ -72,65 +72,66 @@ chaosnet Chugsplash Clabby codebases -collateralized Collateralized +collateralized compr Comprensive -computependingblock COMPUTEPENDINGBLOCK +computependingblock confs Consen corsdomain counterfactually -crosschain Crosschain +crosschain Crossmint Dapphub daserver -datacap DATACAP -datadir +datacap DATADIR +datadir devdocs -devnet Devnet -devnets +devnet Devnets +devnets direnv -disabletxpoolgossip DISABLETXPOOLGOSSIP -discv +disabletxpoolgossip Discv +discv DIVU Drand dripcheck Drippie Eigen EIPs -enabledeprecatedpersonal +emmitted ENABLEDEPRECATEDPERSONAL +enabledeprecatedpersonal enginekind -erigon Erigon -etherbase +erigon ETHERBASE +etherbase Ethernity Ethernow -ethstats ETHSTATS -evmtimeout +ethstats EVMTIMEOUT +evmtimeout excercise executability exfiltrate -exitwhensynced EXITWHENSYNCED -extradata +exitwhensynced EXTRADATA +extradata Farcaster Faultproof -fdlimit FDLIMIT +fdlimit Flashblocks Flashbots forkable @@ -141,52 +142,52 @@ Fraxtal funcationality Funct gameplay -gascap GASCAP +gascap gaslessly -gcmode GCMODE +gcmode Gelato gifs -globalqueue GLOBALQUEUE -globalslots +globalqueue GLOBALSLOTS +globalslots gokzg growthepie hardfork hardforks -healthcheck HEALTHCHECK +healthcheck healthchecks -historicalrpc HISTORICALRPC -historicalrpctimeout +historicalrpc HISTORICALRPCTIMEOUT -holesky -Holesky +historicalrpctimeout HOLESKY +Holesky +holesky IERC -ignoreprice IGNOREPRICE +ignoreprice Immunefi -inator Inator -influxdbv +inator INFLUXDBV +influxdbv initcode -ipcdisable IPCDISABLE +ipcdisable ipcfile -ipcpath IPCPATH +ipcpath IPFS Isthumus JALR -journalremotes JOURNALREMOTES -jspath +journalremotes JSPATH +jspath jwtsecret Keccak leveldb @@ -195,34 +196,34 @@ Lisk logfile logfmt Mainnets -maxage MAXAGE -maxbackups +maxage MAXBACKUPS -maxpeers +maxbackups MAXPEERS -maxpendpeers +maxpeers MAXPENDPEERS -maxprice +maxpendpeers MAXPRICE -memprofilerate +maxprice MEMPROFILERATE -merkle +memprofilerate Merkle +merkle MFHI MFLO Mgas Minato -minfreedisk MINFREEDISK -minsuggestedpriorityfee +minfreedisk MINSUGGESTEDPRIORITYFEE +minsuggestedpriorityfee Mintable Mintplex MIPSEVM Mitigations -monitorism Monitorism +monitorism Moralis Mordor mountpoint @@ -232,44 +233,44 @@ MTHI MTLO MULT multiaddr -multichain Multichain +multichain multiclient multisigs MULTU nethermind -netrestrict NETRESTRICT -networkid +netrestrict NETWORKID -newpayload +networkid NEWPAYLOAD +newpayload nextra -nocompaction NOCOMPACTION -nodekey +nocompaction NODEKEY -nodekeyhex +nodekey NODEKEYHEX +nodekeyhex nodename Nodies -nodiscover NODISCOVER -nolocals +nodiscover NOLOCALS -noprefetch +nolocals NOPREFETCH -nopruning +noprefetch NOPRUNING -nosyncserve +nopruning NOSYNCSERVE +nosyncserve Numba -offchain Offchain +offchain opchaina opchainb -opcm OPCM +opcm Openfort oplabs opnode's @@ -277,96 +278,98 @@ opstack outfile Pausability pcscdpath -pectra Pectra +pectra Pectra's -peerstore Peerstore +peerstore peerstores -permissioned Permissioned -permissionless +permissioned Permissionless +permissionless permissionlessly Perps Peta Pimlico POAP POAPs -pprof PPROF -precommitments +pprof Precommitments +precommitments preconfigured predeploy -predeployed Predeployed -predeploys +predeployed Predeploys +predeploys prefunded -preimage Preimage -preimages +preimage PREIMAGES +preimages preinstall -preinstalls Preinstalls -prestate +preinstalls Prestate +prestate prestates PREVRANDAO -pricebump PRICEBUMP -pricelimit +pricebump PRICELIMIT +pricelimit productionize productionized Protip Proxied -proxyd Proxyd +proxyd Pyth Pyth's QRNG -quicknode Quicknode +quicknode quickstarts rebalancing -regenesis +reemit +Reemitting Regenesis +regenesis Reimagine -rejournal REJOURNAL -remotedb +rejournal REMOTEDB +remotedb Reown Reown's replayability replayor reposts reproven -requiredblocks REQUIREDBLOCKS +requiredblocks rollouts -rollups Rollups +rollups Routescan rpckind -rpcprefix RPCPREFIX +rpcprefix rpcs RPGF -runbooks Runbooks +runbooks RWAs safedb Schnorr -sepolia -Sepolia SEPOLIA +Sepolia +sepolia seqnr -sequencerhttp SEQUENCERHTTP +sequencerhttp serv signup SLLV @@ -375,16 +378,16 @@ SLTIU SLTU smartcard snapshotlog -snapsync Snapsync +snapsync Solana Soneium soyboy Spearbit SRAV SRLV -stablecoins Stablecoins +stablecoins statefulset structs subcomponents @@ -393,21 +396,21 @@ subheaders subsecond SUBU Sunnyside -superchain -Superchain SUPERCHAIN +Superchain +superchain Superchain's superchainerc Superlend Superloans Superscan Superseed -supersim Supersim -syncmode +supersim SYNCMODE -synctarget +syncmode SYNCTARGET +synctarget syscalls SYSCON thirdweb @@ -420,8 +423,8 @@ Twei txfeecap txmgr txns -txpool TXPOOL +txpool txproxy txproxyd uncensorable @@ -432,21 +435,21 @@ Unprotect unsubmitted UPNP upstreaming -verkle VERKLE -vhosts +verkle VHOSTS -viem +vhosts Viem -viem's +viem Viem's -vmdebug +viem's VMDEBUG -vmodule +vmdebug VMODULE +vmodule xlarge XORI ZKPs ZKVM -zora Zora +zora