Skip to content

Commit a134b93

Browse files
authored
Merge pull request #1410 from qbzzt/250224-autorelayer-callout
Updates related to the fact we'll have an autorelayer on mainnet
2 parents 433c98c + 930f2c2 commit a134b93

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

components/AutorelayCallout.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* The AutorelayCallout function renders a callout component with a message about autorelays
3+
*
4+
* @param {Props} props - Expected to be empty, ignored.
5+
* @returns {ReactElement} The AutorelayCallout component, a callout that explains about autorelays.
6+
*/
7+
import type { ReactElement } from 'react';
8+
import { useState } from 'react';
9+
10+
interface Props {
11+
context?: string;
12+
}
13+
export function AutorelayCallout({ context }: Props): ReactElement {
14+
return (
15+
<div
16+
className="custom-callouts nx-w-full nx-mt-6 nx-flex nx-justify-center nx-items-center nx-bg-white dark:nx-bg-black"
17+
>
18+
<div className="nx-w-full nx-px-4 nx-text-center nx-font-medium nx-text-sm nx-text-left">
19+
<div className="nx-text-left">
20+
Normally we expect Superchain blockchains to run an autorelayer and relay your messages automatically.
21+
However, for performance reasons or reliability, you might decide to submit the executing message manually.
22+
See below to learn how to do that.
23+
</div>
24+
</div>
25+
</div>
26+
);
27+
}

pages/stack/interop/message-passing.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ sequenceDiagram
6969
```mermaid
7070
7171
sequenceDiagram
72-
participant app as Application
72+
participant app as Autorelayer
7373
box rgba(0,0,0,0.1) Source Chain
7474
participant log as Event Log
7575
end
@@ -88,7 +88,7 @@ sequenceDiagram
8888

8989
1. Before the executing message is processed, the log event of the initiating message has to get to `op-supervisor` on the destination chain.
9090

91-
2. The application (or a contract calling on the application's behalf) calls [`L2ToL2CrossDomainMessenger.SendMessage.relayMessage`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L156-L216).
91+
2. The autorelayer, the application, or a contract calling on the application's behalf calls [`L2ToL2CrossDomainMessenger.SendMessage.relayMessage`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L156-L216).
9292
This call includes the message that was sent (`_sendMessage`), 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).
9393

9494
3. The `L2ToL2CrossDomainMessenger` uses `CrossL2Inbox` to verify the message was sent from the source.
@@ -107,10 +107,9 @@ sequenceDiagram
107107
## Next steps
108108

109109
* Build a [revolutionary app](/app-developers/get-started) that uses multiple blockchains within the Superchain
110+
* Actually [pass messages between blockchains](/stack/interop/tutorials/message-passing).
110111
* Deploy a [SuperchainERC20](/stack/interop/tutorials/deploy-superchain-erc20) to the Superchain
111112
* Practice how to use [Superchain interop message passing](/stack/interop/message-passing)
112113
* Read how [messages get from one blockchain to another (`CrossL2Inbox`)](explainer#how-messages-get-from-one-chain-to-the-other).
113114
* Try [Supersim](tools/supersim) for testing cross-chain messages locally.
114115
* Learn about [manually relaying messages](/stack/interop/tutorials/relay-messages-viem)
115-
116-
{/* After the tutorial for L2ToL2CrossDomainMessenger is written, need to add a link here */}

pages/stack/interop/superchain-weth.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ sequenceDiagram
8282

8383
4. An off-chain entity submits a transaction to execute the message.
8484
Any address can submit this transaction, but it must have ETH on the destination chain.
85-
Typically, a relayer submits the transaction, since the user does not yet have ETH on the destination chain.
85+
Typically, this would be the chain's autorelayer.
8686

8787
5. `L2ToL2CrossDomainMessenger` on the destination chain calls `SuperchainWETH` with the following details:
8888

89-
* Source of the ETH
90-
* Destination address
91-
* Amount of ETH
89+
* Source of the ETH
90+
* Destination address
91+
* Amount of ETH
9292

9393
`SuperchainWETH` performs several sanity checks:
9494

pages/stack/interop/tutorials/message-passing.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ description: Learn to implement cross-chain communication in the Superchain by b
77
import { Callout } from 'nextra/components'
88
import { Steps } from 'nextra/components'
99
import { InteropCallout } from '@/components/WipCallout'
10+
import { AutorelayCallout } from '@/components/AutorelayCallout'
1011

1112
<InteropCallout />
1213

@@ -362,9 +363,7 @@ In this section we change `Greeter.sol` to emit a separate event in it receives
362363

363364
## Implement manual message relaying
364365

365-
So far we relied on `--interop.autorelay` to send the executing messages to chain B.
366-
But we only have it because we're using a development system.
367-
In production we will not have this, we need to create our own executing messages.
366+
<AutorelayCallout />
368367

369368
<Steps>
370369
### Set up

0 commit comments

Comments
 (0)