Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 27 additions & 19 deletions pages/notices/pectra-changes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Pectra contains a variety of EIPs, some of which apply to the OP Stack; others d

Node operators will need to upgrade to the respective releases before the activation dates.These following steps are necessary for every node operator:


### Update to the latest release

<Callout type="warning">
Expand All @@ -53,42 +52,49 @@ Node operators will need to upgrade to the respective releases before the activa

* `op-node` at [`v1.11.0`](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.11.0)
* `op-geth` at [`v1.101500.0`](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101500.0)
* `op-batcher` at [`v1.11.1`](https://github.com/ethereum-optimism/optimism/releases/tag/op-batcher%2Fv1.11.1)
* `op-reth` at [`v1.1.5`](https://github.com/paradigmxyz/reth/releases/tag/v1.1.5) also includes L1 Pectra support.

## For chain operators

The following sections are how chain operators can prepare the first part of the OP Stack's Pectra L1 support. This ensures OP Stack chains do not break when the L1 Pectra upgrade activates.
The following sections are how chain operators can prepare the first part of the OP Stack's Pectra L1 support. This ensures OP Stack chains do not break when the L1 Pectra upgrade activates. Every chain operator will need to:

<Steps>

### Update your node binaries

Follow the guidance outlined in the [Node Operator section](#update-to-the-latest-release) to update your nodes to the latest releases.

### Update your batcher

Then update your batcher to [`op-batcher/v1.11.1`](https://github.com/ethereum-optimism/optimism/releases/tag/op-batcher%2Fv1.11.1).

</Steps>

Every chain operator will need to first follow the guidance outlined in the [Node Operator section](#update-to-the-latest-release) to update your nodes to the latest releases.

## For fault proof enabled chains

<Callout type="info">
The following instructions assume your chain is on the latest contract release `op-contracts/v1.8.0` and have Holocene activated.
</Callout>

The following steps are to update your absolute prestate on your chain. **This is absolutely necessary for chains running permissionless fault proofs.** For chains running the Fault Proof System with permissioned games you can skip this section because games will not be played out and the absolute prestate is not used.
The following steps are to update your absolute prestate with new dispute game contracts. **This is absolutely necessary for chains running permissionless fault proofs.** For chains running the Fault Proof System with permissioned games you can skip this section because games will not be played out and the absolute prestate is not used.

The Pectra upgrade changes the derivation rules, permissionless fault proof chains need to upgrade the `op-program` version used in the fault proof system to support these changes. The `op-program` version used is specified via the `faultGameAbsolutePrestate` setting, deployed as part of `FaultDisputeGame` and `PermissionedDisputeGame` contracts.

<Steps>
### Make sure the Superchain Registry is up to date

The new `op-program` release will pull the configurations from the [superchain-registry](https://github.com/ethereum-optimism/superchain-registry). This is important because the op-challenger uses the `op-program` and it needs to be aware of your chain's configuration. If your chain that not in the superchain-registry, please [open a PR to add your chain to the superchain-registry](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#adding-a-chain).
### Update your `op-challenger`

### Verify the new absolute prestate
Update your `op-challenger` binary to [`op-challenger/v1.3.1`](https://github.com/ethereum-optimism/optimism/releases/tag/op-challenger%2Fv1.3.1).

<Callout type="info">
The following is based on the [op-program/v1.5.0-rc.2](https://github.com/ethereum-optimism/optimism/tree/op-program/v1.5.0-rc.2) which will be included in the `op-challenger` release.
</Callout>
### Verify the new absolute prestate

You can use this new absolute prestate (`0x035ac388b5cb22acf52a2063cfde108d09b1888655d21f02f595f9c3ea6cbdcd`) for the following chains:
The absolute prestate is generated with the [op-program/v1.5.0-rc.2](https://github.com/ethereum-optimism/optimism/tree/op-program/v1.5.0-rc.2). You can use this new absolute prestate (`0x035ac388b5cb22acf52a2063cfde108d09b1888655d21f02f595f9c3ea6cbdcd`) for the following chains:

* Sepolia: Base, OP, Metal, Mode, Zora, Ethernity, Unichain, Ink
* Mainnet: Base, OP, Orderly, Lyra, Metal, Mode, Zora, Lisk, Ethernity, Binary, Ink, Unichain

You can verify this absolute prestate by running the following [command](https://github.com/ethereum-optimism/optimism/blob/3f18df1c8a502136bbe33f10ed1e29a26cd4678a/Makefile#L129-L131) in the root of the monorepo:
You can verify this absolute prestate by running the following [command](https://github.com/ethereum-optimism/optimism/blob/3f18df1c8a502136bbe33f10ed1e29a26cd4678a/Makefile#L129-L131) in the root of the monorepo on the `op-program/v1.5.0-rc.2` tag:

```shell
make reproducible-prestate
Expand All @@ -105,6 +111,12 @@ The Pectra upgrade changes the derivation rules, permissionless fault proof chai
0x0379d61de1833af6766f07b4ed931d85b3f6282508bbcbf9f4637398d97b61c1
```

### Upload your new preimage file

During the previous step, you also generated the preimage of the absolute prestate, which is basically the op-program serialized into a binary file. You'll find that new file at `optimism/op-program/bin/prestate.bin.gz`. Rename that file to have the absolute prestate hash as the filename so it looks like `0x035ac388b5cb22acf52a2063cfde108d09b1888655d21f02f595f9c3ea6cbdcd.bin.gz`.

Upload that file to where you're storing your other absolute preimage files. This should be the location where you're pointing your `--cannon-prestates-url` at. The `op-challenger` will grab this file and use it when it needs to challenge games.

### Deploy new dispute game contracts

You will then take the absolute prestate and deploy new `FaultDisputeGame` and `PermissionedDisputeGame` contracts with that value. You can reuse the [Holocene script](https://github.com/ethereum-optimism/optimism/tree/op-contracts/v1.8.0-rc.4/packages/contracts-bedrock/scripts/upgrades/holocene) to deploy the new contracts. The only change you will need to make is to update the `absolutePrestate` value in your [deploy-config](https://github.com/ethereum-optimism/optimism/blob/2073f4059bd806af3e8b76b820aa3fa0b42016d0/packages/contracts-bedrock/scripts/upgrades/holocene/README.md?plain=1#L53-L54). Alternatively we will be releasing an `OPPrestateUpdater` that can be used to deploy the new contracts.
Expand All @@ -113,13 +125,9 @@ The Pectra upgrade changes the derivation rules, permissionless fault proof chai

You will then need to update the `DisputeGameFactory` to point to the new `FaultDisputeGame` and `PermissionedDisputeGame` contracts by calling `DisputeGameFactory.setImplementation`. You can utilize this [template](https://github.com/ethereum-optimism/superchain-ops/tree/main/tasks/sep/fp-recovery/005-set-game-implementation) to generate the transaction and validation script for this step. Before executing, you will need to update your op-challenger.

### Update your op-challenger

Update your `op-challenger` to the new release version that will be provided soon and configure it to use the new absolute prestate.

### Execute the upgrade

Once your challenger is ready, you can execute the "Set Dispute Game Implementation" transaction. Please simulate and validate that the expected output prior to executing the transaction.
Once your `op-challenger` is ready with the new preimage, you can execute the "Set Dispute Game Implementation" transaction. Please simulate and validate that the expected output prior to executing the transaction.
</Steps>

## For OP Stack forks
Expand Down
2 changes: 2 additions & 0 deletions pages/stack/interop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ Documentation covering Cross Chain Message, Explainer, Message Passing, Op Super
<Card title="Tutorials" href="/stack/interop/tutorials" icon={<img src="/img/icons/shapes.svg" />} />

<Card title="Safe interoperability measures" href="/stack/interop/interop-security" icon={<img src="/img/icons/shapes.svg" />} />

<Card title="Interop reorg awareness" href="/stack/interop/reorg" />
</Cards>
105 changes: 50 additions & 55 deletions pages/stack/interop/reorg.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,43 @@ import { InteropCallout } from '@/components/WipCallout'

# Interop reorg awareness

[A chain reorganization, or reorg,](https://www.alchemy.com/overviews/what-is-a-reorg#what-happens-to-reorgs-after-the-merge) happens when validators disagree on the most accurate version of the blockchain.
If not handled correctly, reorgs in a cross-chain context could result in a [double-spend problem](https://en.wikipedia.org/wiki/Double-spending).
[A chain reorganization, or "reorg",](https://www.alchemy.com/overviews/what-is-a-reorg#what-happens-to-reorgs-after-the-merge) happens when validators disagree on the most accurate version of the blockchain.
If not handled correctly, reorgs in a cross-chain context could result in a [double-spend problem](https://en.wikipedia.org/wiki/Double-spending).
The most frequent solution to mitigate the double-spend problem is to wait for Ethereum finality; however, that solution results in high latency cross-chain communication and a poor user experience.

<details>

<summary>What is double-spending?</summary>

```mermaid

flowchart LR
subgraph init ["Initiating transaction (source chain)"]
burn(tokens burned)
burn-->send(send)
end
subgraph exec ["Executing transaction (destination chain)"]
send==initiating message==>receive(receive)
receive-->mint(tokens minted)
end
```

In a normal asset transfer tokens are burned on the source chain first, then a message is sent to the destination chain.
When that message is received, the tokens are minted on the destination chain, where the user can now use those tokens.

```mermaid

flowchart LR
subgraph init ["Not really the source chain"]
err((error))
end
subgraph exec ["Executing transaction (destination chain)"]
err==initiating message==>receive(receive)
receive-->mint(tokens minted)
end
```

A double-spend problem occurs when the destination chain receives a valid initiating message, but due to issues on the source chain, such as a reorg, that initiating transaction is no longer valid.
When that happens, the tokens are still on the source chain, but they are also on the destination chain.

<summary>What is double-spending?</summary>

```mermaid

flowchart LR
subgraph init ["Initiating transaction (source chain)"]
burn(tokens burned)
burn-->send(send)
end
subgraph exec ["Executing transaction (destination chain)"]
send==initiating message==>receive(receive)
receive-->mint(tokens minted)
end
```

In a normal asset transfer tokens are burned on the source chain first, then a message is sent to the destination chain.
When that message is received, the tokens are minted on the destination chain, where the user can now use those tokens.

```mermaid

flowchart LR
subgraph init ["Not really the source chain"]
err((error))
end
subgraph exec ["Executing transaction (destination chain)"]
err==initiating message==>receive(receive)
receive-->mint(tokens minted)
end
```

A double-spend problem occurs when the destination chain receives a valid initiating message, but due to issues on the source chain, such as a reorg, that initiating transaction is no longer valid.
When that happens, the tokens are still on the source chain, but they are also on the destination chain.
</details>

Most solutions to mitigate the double-spend problem rely on [L1 finality](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/#finality). However, that solution results in high latency and poor user experience.
Expand Down Expand Up @@ -81,13 +79,13 @@ graph LR
class A101,A102,A103,B302,B303 unsafe
```

In the diagram above, solid arrows are the derivation of a block from the previous block in the chain.
In the diagram above, solid arrows are the derivation of a block from the previous block in the chain.
Dotted arrows go from the block with the initiating message (the source) to the block with the executing message (the destination).
Blocks can either be finalized (grey), cross-safe (green), or unsafe (red).
Blockchain A has only written block A<sub>100</sub> to the blockchain.
Blockchain A has only written block A<sub>100</sub> to the blockchain.
As a result, block A<sub>101</sub> is unsafe, and so are all the blocks that depend on it, directly (A<sub>102</sub> and B<sub>302</sub>) or indirectly (A<sub>103</sub> and B<sub>303</sub>).
Blocks B<sub>302</sub> and B<sub>303</sub> may be *local-safe* (if they are written to L1), but they cannot be *cross-safe* because they depend on a block that isn't.
If all goes well, eventually A<sub>101</sub> will be written to L1, turn safe, and then the blocks that depend on it can become safe as well.
Blocks B<sub>302</sub> and B<sub>303</sub> may be *local-safe* (if they are written to L1), but they cannot be *cross-safe* because they depend on a block that isn't.
If all goes well, eventually A<sub>101</sub> will be written to L1, turn safe, and then the blocks that depend on it can become safe as well.

The message between A<sub>101</sub> and B<sub>302</sub> can be an asset moving across the bridge.
In that case, the initiating message (A<sub>101</sub>) burns `n` tokens on the source chain (A), and the executing message (B<sub>302</sub>) mints `n` tokens on the destination chain (B).
Expand All @@ -104,11 +102,10 @@ So L1 reorgs are basically invisible to L2.

Sequencers inform the rest of the Superchain about a new block in two ways:

- The gossip protocol, which is typically used as soon as the block is created.
The problem is that the gossip protocol does not create a commitment.
- Posting to L1, which typically happens a few minutes after the block is created.
The reason is cost, it is a lot cheaper if compression and L1 posting are done in large batches, rather than for each individual block.

* The gossip protocol, which is typically used as soon as the block is created.
The problem is that the gossip protocol does not create a commitment.
* Posting to L1, which typically happens a few minutes after the block is created.
The reason is cost, it is a lot cheaper if compression and L1 posting are done in large batches, rather than for each individual block.

Equivocation happens when a sequencer publishes a block using the gossip protocol that is different from the one that eventually gets written to L1.
In this case, the block that is written to L1 (let's call it A'<sub>101</sub>) is the valid one, and that causes every dependent block to be recalculated.
Expand Down Expand Up @@ -154,15 +151,13 @@ So the change from A<sub>101</sub> to A'<sub>101</sub> cannot invalidate any exi
If a block is invalid, even if it is posted on L1, the canonical chain replaces it with a block that only includes the deposit transactions, those transactions posted to L1.

<details>
<summary>What makes a block invalid?</summary>

<summary>What makes a block invalid?</summary>

There are several potential reasons:

- The block posted to L1 includes incorrect information, for example because it relied on a node on a different blockchain for interop and that node reported incorrect information.
- The block was never posted.
After a timeout of twelve hours all the verifiers will assume that the block that should have been posted is a deposit-only block.
There are several potential reasons:

* The block posted to L1 includes incorrect information, for example because it relied on a node on a different blockchain for interop and that node reported incorrect information.
* The block was never posted.
After a timeout of twelve hours all the verifiers will assume that the block that should have been posted is a deposit-only block.
</details>

This is functionally equivalent to equivocation, and dealt with the same way, so it can change unsafe blocks but only those blocks.
Expand All @@ -177,6 +172,6 @@ At worst, some unsafe blocks need to be recalculated (if one fork is chosen over

## Next steps

- Build a [revolutionary app](/app-developers/get-started) that uses multiple blockchains within the Superchain.
- Deploy a [SuperchainERC20](./tutorials/deploy-superchain-erc20) to the Superchain.
- View more [interop tutorials](./tutorials).
* Build a [revolutionary app](/app-developers/get-started) that uses multiple blockchains within the Superchain.
* Deploy a [SuperchainERC20](./tutorials/deploy-superchain-erc20) to the Superchain.
* View more [interop tutorials](./tutorials).
Loading