From 2808f629b893559b4564575b3b726559bf64304b Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Sun, 15 Dec 2024 13:23:39 -0600 Subject: [PATCH 01/15] Sanity check --- pages/stack/interop/_meta.json | 1 + pages/stack/interop/architecture.mdx | 100 +++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 pages/stack/interop/architecture.mdx diff --git a/pages/stack/interop/_meta.json b/pages/stack/interop/_meta.json index ac5d2f1f3..469dc5cda 100644 --- a/pages/stack/interop/_meta.json +++ b/pages/stack/interop/_meta.json @@ -1,5 +1,6 @@ { "explainer": "Interop explainer", + "architecture": "Architecture", "devnet": "Interop devnet", "supersim": "Supersim Multichain Development Environment", "cross-chain-message": "Anatomy of cross-chain message", diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx new file mode 100644 index 000000000..fd73ae742 --- /dev/null +++ b/pages/stack/interop/architecture.mdx @@ -0,0 +1,100 @@ +--- +title: Interoperability architecture +lang: en-US +description: How it works. +--- + +import { Callout } from 'nextra/components' +import Image from 'next/image' + +import { InteropCallout } from '@/components/WipCallout' + + + +# Interoperability architecture + +Interoperability is provided by an [OP Supervisor](./op-supervisor). +This supervisor keeps a copy of the events for all the blockchains in the interoperability cluster, and can therefore validate that cross-chain messages (which are always initiated with an event on the source cluster). + +```mermaid + +graph TB + supervisor[OP Supervisor] + subgraph mainnet[OP Mainnet] + node1[OP Node]<-->geth1[Execution Engine] + end + subgraph base[Base] + node2[OP Node]<-->geth2[Execution Engine] + end + subgraph l1[Ethereum L1] + node3[Consensus Layer]<-->geth3[Execution Layer] + end + supervisor<-->mainnet + supervisor<-->base + supervisor<-->l1 +``` + +## How messages get from one chain to the other + +```mermaid + +sequenceDiagram + participant app as Application + participant src as Soucre Chain + participant op-sup as OP Supervisor + participant dst as Destination Chain + app->>src: Transaction + src->>op-sup: Log Event + note over src,op-sup: Log Event = Initializing Message + app->>dst: Transaction + dst->>dst: Call to CrossL2Inbox to execute or verify a message. + dst->>op-sup: Did you receive this initiating message? + op-sup->>dst: Yes + note left of dst: Call is successful + dst->>dst: CrossL2Inbox emits ExecutingMessage. + note over dst: Executing Message +``` + +## Safety levels + +- *Unsafe* - not yet written to L1, obtained through gossip channels, ultimately based on trust in a sequencer. +- *Cross unsafe* - verified that all executing messages have legitimate initiating messages, but otherwise still unsafe. + Treated as unsafe for most purposes. +- *Safe* - the block and all the blocks on which it depends (those with initiating mesages to which it has executing messages) have been written to L1. +- *Finalized* - the block and all the blocks on which it depends have been on L1 for long enough to make a reorg impossible. + + +```mermaid + +flowchart LR + classDef finalized fill:#CCC + classDef safe fill:#8F8 + classDef unsafe fill:#F89 + subgraph I[Blocks with Initiating Messages] + style I fill:none + subgraph A[Chain A] + A0[Block n] + A1[Block n+100] + A2[Block n+105] + class A0 finalized + class A1 safe + class A2 unsafe + end + subgraph B[Chain B] + B0[Block m] + B1[Block m+3] + class B0,B1 safe + end + end + subgraph C[Chain C] + C0[Block with executing messages] + class C0 unsafe + end + A0 --> C0 + A1 --> C0 + A2 --> C0 + B0 --> C0 + B1 --> C0 +``` + +A block should only be written to L1 once the blocks on which it depends are all safe. \ No newline at end of file From fba37030791999aabd6eb39c7f62eda196e4fc1b Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Tue, 17 Dec 2024 17:57:01 -0600 Subject: [PATCH 02/15] docs(interop/architecture): first version --- pages/stack/interop/architecture.mdx | 101 ++++++++++++++++++--------- 1 file changed, 69 insertions(+), 32 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index fd73ae742..9422b1d63 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -13,56 +13,80 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability architecture -Interoperability is provided by an [OP Supervisor](./op-supervisor). -This supervisor keeps a copy of the events for all the blockchains in the interoperability cluster, and can therefore validate that cross-chain messages (which are always initiated with an event on the source cluster). +Interoperability is provided by an [OP Supervisor](./op-supervisor), a new component that we expect every node operator to run in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). ```mermaid -graph TB - supervisor[OP Supervisor] - subgraph mainnet[OP Mainnet] - node1[OP Node]<-->geth1[Execution Engine] +graph LR + + classDef chain fill:#FFC + + subgraph chain1[OP Stack chain #1] + node1[OP Node] + super1[OP Supervisor] + geth1[Execution Engine] + super1-->|remote block status|node1 + node1-->|local block status|super1 + super1-->|initiating message validation|geth1 + node1<-->geth1 end - subgraph base[Base] - node2[OP Node]<-->geth2[Execution Engine] + chain2[OP Stack chain #2] + chain3[OP Stack chain #3] + subgraph l1[Ethereum L1 chain] + l1node[Consensus Layer] + l1geth[Execution Layer] end - subgraph l1[Ethereum L1] - node3[Consensus Layer]<-->geth3[Execution Layer] - end - supervisor<-->mainnet - supervisor<-->base - supervisor<-->l1 + + chain2-->|log events|super1 + chain3-->|log events|super1 + l1node-->|block status|super1 + + class chain1,chain2,chain3,l1 chain ``` +OP Supervisor holds a database of all the log events of all the chains in the interoperability cluster. +Every event can potentially initiate a cross domain message, and it is the job of OP Supervisor to validate that the log event really happened on the source chain. +Additionally, OP Supervisor reads information from L1's consensus layer to know what L2 blocks are unsafe (not written to L1 yet), which are safe (written to L1, but might suffer from a [reorg](https://blog.quicknode.com/understanding-blockchain-reorgs-why-block-numbers-dont-matter-as-much-as-you-think)), and which are finalized (old enough to be immune to reorgs). + + ## How messages get from one chain to the other +To understand *why* we need this additional component, it is useful to know how interop messages get from one blockchain to another. + ```mermaid sequenceDiagram participant app as Application participant src as Soucre Chain - participant op-sup as OP Supervisor - participant dst as Destination Chain + box rgba(0,0,0,0.1) Destination Chain + participant dst-sup as OP Supervisor + participant dst-geth as Execution Engine + end app->>src: Transaction - src->>op-sup: Log Event - note over src,op-sup: Log Event = Initializing Message - app->>dst: Transaction - dst->>dst: Call to CrossL2Inbox to execute or verify a message. - dst->>op-sup: Did you receive this initiating message? - op-sup->>dst: Yes - note left of dst: Call is successful - dst->>dst: CrossL2Inbox emits ExecutingMessage. - note over dst: Executing Message + src->>dst-sup: Log Event + note over src,dst-sup: Log Event = Initializing Message + app->>dst-geth: Transaction + dst-geth->>dst-geth: Call to CrossL2Inbox to execute or verify a message. + dst-geth->>dst-sup: Did you receive this initiating message? + dst-sup->>dst-geth: Yes + note left of dst-geth: Call is successful + dst-geth->>dst-geth: CrossL2Inbox emits ExecutingMessage. + note over dst-geth: Executing Message ``` -## Safety levels +Cross domain messages require two transactions. +The first transaction creates an *initiating message* on the source chain. +The second transaction creates an *executing message* on the destination chain. +This executing message could result in a contract function being executed on the destination chain. -- *Unsafe* - not yet written to L1, obtained through gossip channels, ultimately based on trust in a sequencer. -- *Cross unsafe* - verified that all executing messages have legitimate initiating messages, but otherwise still unsafe. - Treated as unsafe for most purposes. -- *Safe* - the block and all the blocks on which it depends (those with initiating mesages to which it has executing messages) have been written to L1. -- *Finalized* - the block and all the blocks on which it depends have been on L1 for long enough to make a reorg impossible. +The initiating message is simply a log event. Any log event on any chain that inteoperates with the destination can initiate a cross domain message. + +The transaction that receives the message calls a contract called [`CrossL2Inbox`](https://specs.optimism.io/interop/predeploys.html#crossl2inbox), directly or indirectly. +The call to `CrossL2Inbox`, also known as the *executing message*, needs to [identify the initiating message uniquely](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L35-L42), using the chain ID of the source chain, the block number, and the index of the log event within that block, as well as a few other fields as a sanity check. + +`CrossL2Inbox` can either [validate the message exists](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L171-L185), or [call a contract if the message exists](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L171-L185). +## Safety levels ```mermaid @@ -97,4 +121,17 @@ flowchart LR B1 --> C0 ``` -A block should only be written to L1 once the blocks on which it depends are all safe. \ No newline at end of file +In addition to being written to L1, a *safe* block is one that only depends on other safe blocks. +For example, in the image below, most blocks are safe. +Block `n` in chain A is even finalized, and immune from reorgs. +However, block `n+105` in chain A is unsafe. +Since the new block depends upon it, it is also unsafe. + + +{/* +- *Unsafe* - not yet written to L1, obtained through gossip channels, ultimately based on trust in a sequencer. +- *Cross unsafe* - verified that all executing messages have legitimate initiating messages, but otherwise still unsafe. + Treated as unsafe for most purposes. +- *Safe* - the block and all the blocks on which it depends (those with initiating mesages to which it has executing messages) have been written to L1. +- *Finalized* - the block and all the blocks on which it depends have been on L1 for long enough to make a reorg impossible. +*/} \ No newline at end of file From 629499d7a0c328980ad419ca63523d57cd494d6b Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Tue, 17 Dec 2024 18:07:54 -0600 Subject: [PATCH 03/15] lint --- pages/stack/interop.mdx | 5 ++++- pages/stack/interop/architecture.mdx | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pages/stack/interop.mdx b/pages/stack/interop.mdx index 466533c36..c601fdb88 100644 --- a/pages/stack/interop.mdx +++ b/pages/stack/interop.mdx @@ -11,9 +11,12 @@ import { Card, Cards } from 'nextra/components' Documentation covering Cross Chain Message, Explainer, Message Passing, Op Supervisor, Superchain Erc20, Superchain Weth, Supersim, Transfer Superchainerc20 in the Interop section of the OP Stack ecosystem. + + + + - diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index 9422b1d63..4205336c7 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -11,7 +11,7 @@ import { InteropCallout } from '@/components/WipCallout' -# Interoperability architecture +# Interoperability architecture Interoperability is provided by an [OP Supervisor](./op-supervisor), a new component that we expect every node operator to run in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). @@ -48,7 +48,6 @@ OP Supervisor holds a database of all the log events of all the chains in the in Every event can potentially initiate a cross domain message, and it is the job of OP Supervisor to validate that the log event really happened on the source chain. Additionally, OP Supervisor reads information from L1's consensus layer to know what L2 blocks are unsafe (not written to L1 yet), which are safe (written to L1, but might suffer from a [reorg](https://blog.quicknode.com/understanding-blockchain-reorgs-why-block-numbers-dont-matter-as-much-as-you-think)), and which are finalized (old enough to be immune to reorgs). - ## How messages get from one chain to the other To understand *why* we need this additional component, it is useful to know how interop messages get from one blockchain to another. @@ -127,11 +126,10 @@ Block `n` in chain A is even finalized, and immune from reorgs. However, block `n+105` in chain A is unsafe. Since the new block depends upon it, it is also unsafe. - {/* - *Unsafe* - not yet written to L1, obtained through gossip channels, ultimately based on trust in a sequencer. - *Cross unsafe* - verified that all executing messages have legitimate initiating messages, but otherwise still unsafe. Treated as unsafe for most purposes. - *Safe* - the block and all the blocks on which it depends (those with initiating mesages to which it has executing messages) have been written to L1. - *Finalized* - the block and all the blocks on which it depends have been on L1 for long enough to make a reorg impossible. -*/} \ No newline at end of file +*/} From 4bdc6532de0f0ef22ac0b121a9f9142974e8a9f8 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Tue, 17 Dec 2024 18:11:51 -0600 Subject: [PATCH 04/15] lint --- pages/stack/interop/architecture.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index 4205336c7..2b478f5dc 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -78,7 +78,8 @@ The first transaction creates an *initiating message* on the source chain. The second transaction creates an *executing message* on the destination chain. This executing message could result in a contract function being executed on the destination chain. -The initiating message is simply a log event. Any log event on any chain that inteoperates with the destination can initiate a cross domain message. +The initiating message is simply a log event. +Any log event on any chain that inteoperates with the destination can initiate a cross domain message. The transaction that receives the message calls a contract called [`CrossL2Inbox`](https://specs.optimism.io/interop/predeploys.html#crossl2inbox), directly or indirectly. The call to `CrossL2Inbox`, also known as the *executing message*, needs to [identify the initiating message uniquely](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L35-L42), using the chain ID of the source chain, the block number, and the index of the log event within that block, as well as a few other fields as a sanity check. From 6e05b4e086309776d166e1242106085acc839570 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Tue, 17 Dec 2024 18:18:23 -0600 Subject: [PATCH 05/15] words --- words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/words.txt b/words.txt index 5ab0b5b84..5cce66c49 100644 --- a/words.txt +++ b/words.txt @@ -154,6 +154,7 @@ Inator inator INFLUXDBV influxdbv +inteoperates interchain IPCDISABLE ipcdisable From 85ddb8fc7775f54458e86b5978526285eb557b8a Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Wed, 18 Dec 2024 12:24:00 -0600 Subject: [PATCH 06/15] @zainbacchus comments --- pages/stack/interop/architecture.mdx | 27 +++++++++++++++++++-------- words.txt | 1 + 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index 2b478f5dc..107713fb3 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -13,7 +13,8 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability architecture -Interoperability is provided by an [OP Supervisor](./op-supervisor), a new component that we expect every node operator to run in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). +Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. +Every node operator is expected to run this service in addition to the rollup node]\(/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). ```mermaid @@ -23,7 +24,7 @@ graph LR subgraph chain1[OP Stack chain #1] node1[OP Node] - super1[OP Supervisor] + super1[OP-Supervisor] geth1[Execution Engine] super1-->|remote block status|node1 node1-->|local block status|super1 @@ -44,9 +45,9 @@ graph LR class chain1,chain2,chain3,l1 chain ``` -OP Supervisor holds a database of all the log events of all the chains in the interoperability cluster. -Every event can potentially initiate a cross domain message, and it is the job of OP Supervisor to validate that the log event really happened on the source chain. -Additionally, OP Supervisor reads information from L1's consensus layer to know what L2 blocks are unsafe (not written to L1 yet), which are safe (written to L1, but might suffer from a [reorg](https://blog.quicknode.com/understanding-blockchain-reorgs-why-block-numbers-dont-matter-as-much-as-you-think)), and which are finalized (old enough to be immune to reorgs). +OP-Supervisor holds a database of all the log events of all the chains in the interoperability cluster. +Every event can potentially initiate a cross domain message, and it is the job of OP-Supervisor to validate that the log event really happened on the source chain. +Additionally, OP-Supervisor reads information from L1's consensus layer to know what the transaction safety of the L2 blocks. ## How messages get from one chain to the other @@ -58,7 +59,7 @@ sequenceDiagram participant app as Application participant src as Soucre Chain box rgba(0,0,0,0.1) Destination Chain - participant dst-sup as OP Supervisor + participant dst-sup as OP-Supervisor participant dst-geth as Execution Engine end app->>src: Transaction @@ -124,8 +125,18 @@ flowchart LR In addition to being written to L1, a *safe* block is one that only depends on other safe blocks. For example, in the image below, most blocks are safe. Block `n` in chain A is even finalized, and immune from reorgs. -However, block `n+105` in chain A is unsafe. -Since the new block depends upon it, it is also unsafe. +However, block `n+105` in chain A is unsafe, it (or a block on which it depends is not written to L1). +Because the new block depends upon it, it is also unsafe. + +## Next steps + +* Want to learn more? Read our guide on the anatomy of a \[cross-chain message]\(cross-chain-mess + age) or check out this \[interop design video walk-thru]\([https://www.youtube.com/watch?v=FKc5RgjtG](https://www.youtube.com/watch?v=FKc5RgjtG) + es). +* Ready to get started? Use [Supersim](supersim), a local dev environment that simulates intero + p for testing applications against a local version of the Superchain. +* For more info about how OP Stack interoperability works under the hood, \[check out the specs] + ([https://specs.optimism.io/interop/overview.html](https://specs.optimism.io/interop/overview.html)). {/* - *Unsafe* - not yet written to L1, obtained through gossip channels, ultimately based on trust in a sequencer. diff --git a/words.txt b/words.txt index 5cce66c49..2271ce254 100644 --- a/words.txt +++ b/words.txt @@ -156,6 +156,7 @@ INFLUXDBV influxdbv inteoperates interchain +intero IPCDISABLE ipcdisable ipcfile From f5345ae17cfe0b28e4610cc371c4856d54e7ece3 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Wed, 18 Dec 2024 16:16:41 -0600 Subject: [PATCH 07/15] WIP --- pages/stack/interop/architecture.mdx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index 107713fb3..2732c507c 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -14,7 +14,7 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability architecture Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. -Every node operator is expected to run this service in addition to the rollup node]\(/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). +Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). ```mermaid @@ -130,13 +130,12 @@ Because the new block depends upon it, it is also unsafe. ## Next steps -* Want to learn more? Read our guide on the anatomy of a \[cross-chain message]\(cross-chain-mess - age) or check out this \[interop design video walk-thru]\([https://www.youtube.com/watch?v=FKc5RgjtG](https://www.youtube.com/watch?v=FKc5RgjtG) - es). -* Ready to get started? Use [Supersim](supersim), a local dev environment that simulates intero - p for testing applications against a local version of the Superchain. -* For more info about how OP Stack interoperability works under the hood, \[check out the specs] - ([https://specs.optimism.io/interop/overview.html](https://specs.optimism.io/interop/overview.html)). +- Want to learn more? + Read our guide on the anatomy of a [cross-chain message](./cross-chain-message) or check out this + [interop design video walk-thru]([https://www.youtube.com/watch?v=FKc5RgjtG](https://www.youtube.com/watch?v=FKc5RgjtG) +- Ready to get started? Use [Supersim](./supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. +- For more info about how OP Stack interoperability works under the hood, + [check out the specs](https://specs.optimism.io/interop/overview.html). {/* - *Unsafe* - not yet written to L1, obtained through gossip channels, ultimately based on trust in a sequencer. From fb424dc291891380b4872941c309bafff3f3091a Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Wed, 18 Dec 2024 16:18:24 -0600 Subject: [PATCH 08/15] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/stack/interop/architecture.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index 2732c507c..f31349665 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -47,7 +47,7 @@ graph LR OP-Supervisor holds a database of all the log events of all the chains in the interoperability cluster. Every event can potentially initiate a cross domain message, and it is the job of OP-Supervisor to validate that the log event really happened on the source chain. -Additionally, OP-Supervisor reads information from L1's consensus layer to know what the transaction safety of the L2 blocks. +Additionally, OP-Supervisor reads information from L1's consensus layer to determine the transaction safety of L2 blocks. ## How messages get from one chain to the other @@ -57,7 +57,7 @@ To understand *why* we need this additional component, it is useful to know how sequenceDiagram participant app as Application - participant src as Soucre Chain + participant src as Source Chain box rgba(0,0,0,0.1) Destination Chain participant dst-sup as OP-Supervisor participant dst-geth as Execution Engine From 6323a3853a8d660063b595b8336c9915a2596d6d Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Wed, 18 Dec 2024 16:23:03 -0600 Subject: [PATCH 09/15] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- words.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/words.txt b/words.txt index 2271ce254..78133f282 100644 --- a/words.txt +++ b/words.txt @@ -154,7 +154,7 @@ Inator inator INFLUXDBV influxdbv -inteoperates +interoperates interchain intero IPCDISABLE From c2d79cf4ae5efec8fd4bc45febe3f99485d5ad19 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Wed, 18 Dec 2024 16:40:51 -0600 Subject: [PATCH 10/15] WIP --- pages/stack/interop/architecture.mdx | 31 +++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index f31349665..dee99fba7 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -16,33 +16,40 @@ import { InteropCallout } from '@/components/WipCallout' Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). + +{/* + + super1-->|remote block status|node1 + node1-->|local block status|super1 + super1-->|initiating message validation|geth1 + node1<-->geth1 + +*/} ```mermaid graph LR - classDef chain fill:#FFC + classDef chain fill:#FFE + classDef transparent fill:none, stroke:none subgraph chain1[OP Stack chain #1] node1[OP Node] super1[OP-Supervisor] geth1[Execution Engine] - super1-->|remote block status|node1 - node1-->|local block status|super1 - super1-->|initiating message validation|geth1 - node1<-->geth1 + node1<-->super1<-->geth1<-->node1 end - chain2[OP Stack chain #2] - chain3[OP Stack chain #3] - subgraph l1[Ethereum L1 chain] - l1node[Consensus Layer] - l1geth[Execution Layer] + subgraph X[ ] + chain2[OP Stack chain #2] + chain3[OP Stack chain #3] + l1node[L1 Consensus Layer] end chain2-->|log events|super1 chain3-->|log events|super1 l1node-->|block status|super1 - class chain1,chain2,chain3,l1 chain + class chain1,chain2,chain3 chain + class X transparent ``` OP-Supervisor holds a database of all the log events of all the chains in the interoperability cluster. @@ -132,7 +139,7 @@ Because the new block depends upon it, it is also unsafe. - Want to learn more? Read our guide on the anatomy of a [cross-chain message](./cross-chain-message) or check out this - [interop design video walk-thru]([https://www.youtube.com/watch?v=FKc5RgjtG](https://www.youtube.com/watch?v=FKc5RgjtG) + [interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). - Ready to get started? Use [Supersim](./supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. - For more info about how OP Stack interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). From 28341d241d9e3361a831a3718a4cdaf838a0cff5 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Wed, 18 Dec 2024 17:45:37 -0600 Subject: [PATCH 11/15] More comments --- pages/stack/interop/architecture.mdx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index dee99fba7..c928bcc44 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -58,7 +58,7 @@ Additionally, OP-Supervisor reads information from L1's consensus layer to deter ## How messages get from one chain to the other -To understand *why* we need this additional component, it is useful to know how interop messages get from one blockchain to another. +To understand *why* we need this additional service, it is useful to know how interop messages get from one blockchain to another. ```mermaid @@ -89,7 +89,8 @@ This executing message could result in a contract function being executed on the The initiating message is simply a log event. Any log event on any chain that inteoperates with the destination can initiate a cross domain message. -The transaction that receives the message calls a contract called [`CrossL2Inbox`](https://specs.optimism.io/interop/predeploys.html#crossl2inbox), directly or indirectly. +The transaction that receives the message on the destination chain calls a contract called [`CrossL2Inbox`](https://specs.optimism.io/interop/predeploys.html#crossl2inbox). +This call can be at the top level, directly from the externally owned account, or come through a smart contract. The call to `CrossL2Inbox`, also known as the *executing message*, needs to [identify the initiating message uniquely](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L35-L42), using the chain ID of the source chain, the block number, and the index of the log event within that block, as well as a few other fields as a sanity check. `CrossL2Inbox` can either [validate the message exists](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L171-L185), or [call a contract if the message exists](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L171-L185). @@ -129,10 +130,15 @@ flowchart LR B1 --> C0 ``` -In addition to being written to L1, a *safe* block is one that only depends on other safe blocks. +Interop expands the scope of trust for unsafe blocks, blocks that are shared through [the gossip protocol](/builders/chain-operators/architecture#sequencer). +To trust that an unsafe block is valid and is going to become safe and then finalized, you need to trust not only the sequencer that produces it, but also all the other sequencer that produce other blocks that are still unsafe, but that include initiating messages that are executed in that block. + +However, this is only for *unsafe* blocks, and only if the sequencer allows messages from unsafe blocks to be processed. +A block is only considered promotable to *safe*, and therefore ready to be written to L1, when all the blocks on which it depends are safe. + For example, in the image below, most blocks are safe. Block `n` in chain A is even finalized, and immune from reorgs. -However, block `n+105` in chain A is unsafe, it (or a block on which it depends is not written to L1). +However, block `n+105` in chain A is unsafe, it (or a block on which it depends) is not written to L1. Because the new block depends upon it, it is also unsafe. ## Next steps From 95ab156a822a1db1137f706559cc141678356e67 Mon Sep 17 00:00:00 2001 From: Zain Bacchus Date: Thu, 19 Dec 2024 14:20:01 -0600 Subject: [PATCH 12/15] Update architecture.mdx --- pages/stack/interop/architecture.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index c928bcc44..37f46cf96 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -12,9 +12,7 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability architecture - -Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. -Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). +An OP Stack node consists of two pieces of software: a consensus client (e.g. op-node) and an execution client, which is responsible for processing user transactions, constructing blocks and serving RPC calls. Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). {/* From 1b933e9df0ea4c7d642665252922d344d24f7127 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Thu, 19 Dec 2024 15:58:52 -0600 Subject: [PATCH 13/15] final @zainbacchus comments --- pages/stack/interop/architecture.mdx | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index 37f46cf96..ef93f910c 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -14,15 +14,6 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability architecture An OP Stack node consists of two pieces of software: a consensus client (e.g. op-node) and an execution client, which is responsible for processing user transactions, constructing blocks and serving RPC calls. Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). - -{/* - - super1-->|remote block status|node1 - node1-->|local block status|super1 - super1-->|initiating message validation|geth1 - node1<-->geth1 - -*/} ```mermaid graph LR @@ -129,7 +120,7 @@ flowchart LR ``` Interop expands the scope of trust for unsafe blocks, blocks that are shared through [the gossip protocol](/builders/chain-operators/architecture#sequencer). -To trust that an unsafe block is valid and is going to become safe and then finalized, you need to trust not only the sequencer that produces it, but also all the other sequencer that produce other blocks that are still unsafe, but that include initiating messages that are executed in that block. +To trust that an unsafe block is valid and is going to become safe and then finalized, you need to trust not only the sequencer that produces it, but also all the other sequencers that produce other blocks that are still unsafe, but that include initiating messages that are executed in that block. However, this is only for *unsafe* blocks, and only if the sequencer allows messages from unsafe blocks to be processed. A block is only considered promotable to *safe*, and therefore ready to be written to L1, when all the blocks on which it depends are safe. @@ -147,11 +138,3 @@ Because the new block depends upon it, it is also unsafe. - Ready to get started? Use [Supersim](./supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. - For more info about how OP Stack interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). - -{/* -- *Unsafe* - not yet written to L1, obtained through gossip channels, ultimately based on trust in a sequencer. -- *Cross unsafe* - verified that all executing messages have legitimate initiating messages, but otherwise still unsafe. - Treated as unsafe for most purposes. -- *Safe* - the block and all the blocks on which it depends (those with initiating mesages to which it has executing messages) have been written to L1. -- *Finalized* - the block and all the blocks on which it depends have been on L1 for long enough to make a reorg impossible. -*/} From 837903c0cb4b0744cfd3b34235a5e1a9594f396b Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Thu, 19 Dec 2024 16:13:10 -0600 Subject: [PATCH 14/15] fix --- pages/stack/interop/architecture.mdx | 13 +++++++------ words.txt | 3 +-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index ef93f910c..8d412ac3f 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -12,6 +12,7 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability architecture + An OP Stack node consists of two pieces of software: a consensus client (e.g. op-node) and an execution client, which is responsible for processing user transactions, constructing blocks and serving RPC calls. Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). ```mermaid @@ -132,9 +133,9 @@ Because the new block depends upon it, it is also unsafe. ## Next steps -- Want to learn more? - Read our guide on the anatomy of a [cross-chain message](./cross-chain-message) or check out this - [interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). -- Ready to get started? Use [Supersim](./supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. -- For more info about how OP Stack interoperability works under the hood, - [check out the specs](https://specs.optimism.io/interop/overview.html). +* Want to learn more? + Read our guide on the anatomy of a [cross-chain message](./cross-chain-message) or check out this + [interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). +* Ready to get started? Use [Supersim](./supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. +* For more info about how OP Stack interoperability works under the hood, + [check out the specs](https://specs.optimism.io/interop/overview.html). diff --git a/words.txt b/words.txt index 78133f282..5cce66c49 100644 --- a/words.txt +++ b/words.txt @@ -154,9 +154,8 @@ Inator inator INFLUXDBV influxdbv -interoperates +inteoperates interchain -intero IPCDISABLE ipcdisable ipcfile From 7c01e6d66a3ec90348c90654a9106c03864d74c1 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Fri, 20 Dec 2024 20:53:55 -0600 Subject: [PATCH 15/15] @bradleycamacho comments --- pages/stack/interop/architecture.mdx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pages/stack/interop/architecture.mdx b/pages/stack/interop/architecture.mdx index 8d412ac3f..c068cdf61 100644 --- a/pages/stack/interop/architecture.mdx +++ b/pages/stack/interop/architecture.mdx @@ -13,7 +13,8 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability architecture -An OP Stack node consists of two pieces of software: a consensus client (e.g. op-node) and an execution client, which is responsible for processing user transactions, constructing blocks and serving RPC calls. Interoperability among OP Stack chains is enabled via a new service called *OP-Supervisor*. Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). +An OP Stack node consists of two pieces of software: a consensus client (e.g. op-node) and an execution client, which is responsible for processing user transactions and constructing blocks. Interoperability among OP Stack chains is enabled via a new service called +[*OP Supervisor*](/stack/interop/op-supervisor). Every node operator is expected to run this service in addition to the [rollup node](/builders/node-operators/architecture#rollup-node) and [execution client](/builders/node-operators/architecture#execution-client). ```mermaid @@ -85,6 +86,8 @@ The call to `CrossL2Inbox`, also known as the *executing message*, needs to [ide `CrossL2Inbox` can either [validate the message exists](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L171-L185), or [call a contract if the message exists](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L171-L185). +[For more information, see the cross-chain messages anatomy page](./cross-chain-message). + ## Safety levels ```mermaid @@ -127,8 +130,8 @@ However, this is only for *unsafe* blocks, and only if the sequencer allows mess A block is only considered promotable to *safe*, and therefore ready to be written to L1, when all the blocks on which it depends are safe. For example, in the image below, most blocks are safe. -Block `n` in chain A is even finalized, and immune from reorgs. -However, block `n+105` in chain A is unsafe, it (or a block on which it depends) is not written to L1. +Block `n` in chain `A` is even finalized, and immune from reorgs. +However, block `n+105` in chain `A` is unsafe, it (or a block on which it depends) is not written to L1. Because the new block depends upon it, it is also unsafe. ## Next steps