-
Notifications
You must be signed in to change notification settings - Fork 263
Add message expiration doc #1605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1367722
Add message expiration doc
bradleycamacho 4b1224e
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho c24ec58
Implement review
bradleycamacho c64be26
Add missing link
bradleycamacho 7490333
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho aefdf2e
Merge branch 'main' into Message-expiration
bradleycamacho dd0209d
Fix flipflopped info
bradleycamacho 070d225
Merge branch 'Message-expiration' of https://github.com/ethereum-opti…
bradleycamacho ac54be7
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho fc712c4
Next steps and logs reference
bradleycamacho 97bd758
fix link
bradleycamacho ee8b461
Lint
bradleycamacho 51b3e80
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho 2bd4e3e
Add reviews
bradleycamacho 43b0411
Fix callout
bradleycamacho 375f96e
Fix callout
bradleycamacho 198805c
Update reading-logs.mdx
zainbacchus 65dd836
Update message-expiration.mdx
zainbacchus b1ee830
Update message-expiration.mdx
zainbacchus 825519b
Update message-expiration.mdx
zainbacchus 4e1ae12
Update message-expiration.mdx
zainbacchus cafff0f
Spelling fix
bradleycamacho fc29281
Update message-expiration.mdx
zainbacchus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.