Skip to content

Commit 06a44c8

Browse files
authored
Merge pull request #1578 from ethereum-optimism/sb/u15-docs-warning
adding custom genesis guidance
2 parents e51a1d8 + c29598b commit 06a44c8

File tree

4 files changed

+154
-138
lines changed

4 files changed

+154
-138
lines changed

pages/interop/tutorials/message-passing.mdx

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ For development purposes, we'll first use autorelay mode to handle message execu
119119
1. In the directory where Supersim is installed, start it with autorelay.
120120

121121
```sh
122-
supersim --interop.autorelay
122+
./supersim --interop.autorelay
123123
```
124124

125125
Supersim creates three `anvil` blockchains:
@@ -221,12 +221,24 @@ For development purposes, we'll first use autorelay mode to handle message execu
221221
4. Install the Optimism Solidity libraries into the project.
222222

223223
```sh
224-
forge install ethereum-optimism/optimism --no-commit
224+
cd lib
225+
npm install @eth-optimism/contracts-bedrock
226+
cd ..
227+
echo @eth-optimism/=lib/node_modules/@eth-optimism/ >> remappings.txt
225228
```
226229

227-
5. Create `src/GreetingSender.sol`.
230+
5. The [`@eth-optimism/contracts-bedrock`](https://www.npmjs.com/package/@eth-optimism/contracts-bedrock) library does not have the Interop Solidity code yet.
231+
Run these commands to add it.
228232

229-
```solidity file=<rootDir>/public/tutorials/GreetingSender.sol#L1-L28 hash=9ed77001810caf52bbaa94da8b0dc5c6
233+
```sh
234+
mkdir -p lib/node_modules/@eth-optimism/contracts-bedrock/interfaces/L2
235+
wget https://raw.githubusercontent.com/ethereum-optimism/optimism/refs/heads/develop/packages/contracts-bedrock/interfaces/L2/IL2ToL2CrossDomainMessenger.sol
236+
mv IL2ToL2CrossDomainMessenger.sol lib/node_modules/@eth-optimism/contracts-bedrock/interfaces/L2
237+
```
238+
239+
6. Create `src/GreetingSender.sol`.
240+
241+
```solidity file=<rootDir>/public/tutorials/GreetingSender.sol#L1-L28 hash=75d197d1e1da112421785c2160f6a55a
230242
```
231243

232244
<details>
@@ -284,8 +296,8 @@ In this section we change `Greeter.sol` to emit a separate event in it receives
284296
//SPDX-License-Identifier: MIT
285297
pragma solidity ^0.8.0;
286298
287-
import { Predeploys } from "lib/optimism/packages/contracts-bedrock/src/libraries/Predeploys.sol";
288-
import { IL2ToL2CrossDomainMessenger } from "lib/optimism/packages/contracts-bedrock/interfaces/L2/IL2ToL2CrossDomainMessenger.sol";
299+
import { Predeploys } from "@eth-optimism/contracts-bedrock/src/libraries/Predeploys.sol";
300+
import { IL2ToL2CrossDomainMessenger } from "@eth-optimism/contracts-bedrock/interfaces/L2/IL2ToL2CrossDomainMessenger.sol";
289301
290302
contract Greeter {
291303
@@ -505,29 +517,29 @@ In this section we change `Greeter.sol` to emit a separate event in it receives
505517
<details>
506518
<summary>Explanation</summary>
507519

508-
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L11 hash=fef2e60f0dbefba4d1e16f4d87800993
520+
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L11-L15 hash=84fb4799b2fdd18785f691d602567145
509521
```
510522

511523
Import from the [`@eth-optimism/viem`](https://www.npmjs.com/package/@eth-optimism/viem) package.
512524

513-
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L18-L24 hash=ffa76edb1191121e15eb4286e16ad041
525+
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L22-L28 hash=28c42407a1a01774f25ca78535d93c6e
514526
```
515527

516528
In addition to extending the wallets with [Viem public actions](https://viem.sh/docs/accounts/local#5-optional-extend-with-public-actions), extend with the OP-Stack actions, both the public ones and the ones that require an account.
517529

518-
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L55 hash=23aa6f24baeb5757130361f30c1b0e9c
530+
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L59 hash=fc1aae397872717a3ed364930cdab9fc
519531
```
520532

521533
To relay a message we need the information in the receipt.
522534
Also, we need to wait until the transaction with the relayed message is actually part of a block.
523535

524-
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L57-L60 hash=8cc99e67ee36474c81183108531cb295
536+
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L61-L63 hash=d45ebbc0d53dfbecbd8d357eb83e1b68
525537
```
526538

527539
A single transaction can send multiple messages.
528540
But here we know we sent just one, so we look for the first one in the list.
529541

530-
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L61-L68 hash=fa49aa2a099c57f3b86671a4c0414f31
542+
```typescript file=<rootDir>/public/tutorials/app_v2.mts#L64-L70 hash=079ffd3e6fdf4eff3653ee7a74078183
531543
```
532544

533545
Here we first send the relay message on chain B, and then wait for the receipt for it.
@@ -593,15 +605,13 @@ In this section we change `Greeter.sol` to emit a separate event in it receives
593605
To see what messages were relayed by a specific transaction you can use this code:
594606

595607
```typescript
596-
const messages = await walletA.interop.getCrossDomainMessages({
597-
logs: receiptRelay.logs,
598-
})
599-
600-
console.log(messages)
601-
const status = await walletB.interop.getCrossDomainMessageStatus({
602-
message: messages[0],
603-
})
604-
console.log(status)
608+
import { decodeRelayedL2ToL2Messages } from '@eth-optimism/viem'
609+
610+
const decodedRelays = decodeRelayedL2ToL2Messages(
611+
{receipt: receiptRelay})
612+
613+
console.log(decodedRelays)
614+
console.log(decodedRelays.successfulMessages[0].log)
605615
```
606616
</Steps>
607617

pages/interop/tutorials/transfer-superchainERC20.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,27 @@ The tutorial uses these primary tools:
191191
<details>
192192
<summary>Explanation of `xfer-erc20.mts`</summary>
193193

194-
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L75-L80 hash=b144852a4fa9ae45e79ec6f124e48e79
194+
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L79-L84 hash=5084a0cf4064dc7cfaf1cf0f88e1f2d1
195195
```
196196

197197
Use `@eth-optimism/viem`'s `walletActionsL2().sendSuperchainERC20` to send the `SuperchainERC20` tokens.
198198
Internally, this function calls [`SuperchainTokenBridge.sendERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol#L52-L78) to send the tokens.
199199

200200
<AutorelayCallout />
201201

202-
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L84-L86 hash=cab6e961b558f4f5a7b877062b1cfa45
202+
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L88-L90 hash=b353aebabd92c4af52858461d18fe8cd
203203
```
204204

205205
To relay a message, we need the information in the receipt.
206206
Also, we need to wait until the transaction with the relayed message is actually part of a block.
207207

208-
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L88-L91 hash=e1445aa565f4aaff02a62365fb196ca8
208+
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L92-L94 hash=47d2387a65e4a5f5dbfa98868c2c5abc
209209
```
210210

211211
A single transaction can send multiple messages.
212212
But here we know we sent just one, so we look for the first one in the list.
213213

214-
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L92-L96 hash=0a65e0138ab6954b863ebafacaa23c84
214+
```typescript file=<rootDir>/public/tutorials/xfer-erc20.mts#L96-L99 hash=4cf177987a894a8cb58ae5a3e9d731e8
215215
```
216216

217217
This is how you use `@eth-optimism/viem` to create an executing message.

pages/notices/upgrade-15.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ These following steps are necessary for every node operator:
129129
The override flag for op-node was missed and will be added in the mainnet release. If you utilize the override flags, please just set the activation time in the rollup configuration file.
130130
</Callout>
131131

132+
<Callout type="warning">
133+
If you use custom genesis chain configuration, you need to set the `pragueTime` to the same value as the `isthmusTime`. It is not automatically set, this happens by default for chains using the network flags and also when using the override flags.
134+
</Callout>
135+
132136
* **Option 1:** Set the activation time in the `rollup.json` for `op-node`. You will still need to set the `override.isthmus` flag in `op-geth` if you use this option. Please note that the chain configuration file is subject to a stricter format and needs to contain the `chain_op_config` outlined in the `op-node/v1.11.0` [release notes](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.11.0).
133137
* **Option 2:** Set the activation time via overrides (CLI) in both `op-node` and `op-geth`. These will need to be set on `op-node` and `op-geth` for the sequencer and all other nodes.
134138

0 commit comments

Comments
 (0)