Skip to content

Commit 6f1bcd3

Browse files
authored
Merge branch 'main' into remove-sdk
2 parents 49119a1 + 7b1f223 commit 6f1bcd3

File tree

22 files changed

+1294
-805
lines changed

22 files changed

+1294
-805
lines changed

pages/app-developers/tutorials/bridging/standard-bridge-custom-token.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { WipCallout } from '@/components/WipCallout'
2323
In this tutorial, you'll learn how to bridge a custom ERC-20 token from Ethereum to an OP Stack chain using the Standard Bridge system.
2424
This tutorial is meant for developers who already have an existing ERC-20 token on Ethereum and want to create a bridged representation of that token on OP Mainnet.
2525

26-
This tutorial explains how you can create a custom token that conforms to the [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.12.2/packages/contracts-bedrock/src/universal/IOptimismMintableERC20.sol) interface so that it can be used with the Standard Bridge system.
26+
This tutorial explains how you can create a custom token that conforms to the [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/universal/OptimismMintableERC20Factory.sol) interface so that it can be used with the Standard Bridge system.
2727
A custom token allows you to do things like trigger extra logic whenever a token is deposited.
2828
If you don't need extra functionality like this, consider following the tutorial on [Bridging Your Standard ERC-20 Token Using the Standard Bridge](./standard-bridge-standard-token) instead.
2929

@@ -33,7 +33,7 @@ If you don't need extra functionality like this, consider following the tutorial
3333

3434
## About OptimismMintableERC20s
3535

36-
The Standard Bridge system requires that L2 representations of L1 tokens implement the [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.12.2/packages/contracts-bedrock/src/universal/IOptimismMintableERC20.sol) interface.
36+
The Standard Bridge system requires that L2 representations of L1 tokens implement the [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/universal/OptimismMintableERC20Factory.sol) interface.
3737
This interface is a superset of the standard ERC-20 interface and includes functions that allow the bridge to properly verify deposits/withdrawals and mint/burn tokens as needed.
3838
Your L2 token contract must implement this interface in order to be bridged using the Standard Bridge system.
3939
This tutorial will show you how to create a custom token that implements this interface.

pages/interop/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"predeploy": "Superchain interop predeploys",
1414
"message-passing": "Superchain interop message passing",
1515
"message-expiration": "Message expiration",
16+
"estimate-costs": "Cost of interop messages",
1617
"reading-logs": "Reading logs",
1718
"op-supervisor": "OP Supervisor",
1819
"superchain-eth-bridge": "Superchain ETH bridge",

pages/interop/estimate-costs.mdx

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
title: Estimating the cost of interop messages
3+
description: Estimate the gas cost of Superchain interop messages.
4+
lang: en-US
5+
content_type: guide
6+
topic: interop-gas-estimate
7+
personas:
8+
- protocol-developer
9+
- app-developer
10+
categories:
11+
- interoperability
12+
- cross-chain-messaging
13+
- superchain
14+
- message-passing
15+
- gas-cost
16+
is_imported_content: 'false'
17+
---
18+
19+
import { Callout } from 'nextra/components'
20+
import { InteropCallout } from '@/components/WipCallout'
21+
22+
<InteropCallout />
23+
24+
# Estimating the cost of interop messages
25+
26+
<Callout type="info">
27+
As of May 2025, the cost of 100 interop messages is just a few cents.
28+
Unless OP Stack transaction costs increase significantly, interop costs should not be a primary consideration in your implementation decisions.
29+
30+
To see the current cost of gas, go to a [block explorer](https://optimism.blockscout.com/) and look at a recent transaction.
31+
</Callout>
32+
33+
There are several factors that determine the cost of an [interop transaction](/interop/message-passing):
34+
35+
* How you pass the message.
36+
You can either use [`CrossL2Inbox`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol) directly, or use the cross domain messenger, [`L2ToL2CrossDomainMessenger`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol), which uses `CrossL2Inbox` internally.
37+
* The transaction type.
38+
Every interop message has two transactions, an [initiating message](/interop/message-passing#initiating-message) in a transaction to the source chain, and an [executing message](/interop/message-passing#executing-message) in the destination chain.
39+
40+
## CrossL2Inbox
41+
42+
This is the low level protocol used by all interop protocols, including `L2ToL2CrossDomainMessenger`.
43+
44+
### Initiating message
45+
46+
The initiating message is any log entry.
47+
A log entry emitted by Solidity code contains 1-4 topics (t) and unlimited unstructured data bytes (n).
48+
The gas cost is calculated as [375(t+1)+8n](https://www.evm.codes/?fork=cancun#a1).
49+
50+
### Executing message
51+
52+
The executing message cost has several components:
53+
54+
1. The cost of posting the transaction.
55+
2. The cost of hashing the message.
56+
3. The cost of `CrossL2Inbox.validateMessage`.
57+
4. The cost of using the message.
58+
59+
The first and second components depend on the log entry.
60+
`CrossL2Inbox.validateMessage` only requires a 32 byte hash of the log entry, but actually using it typically requires the information that has been hashed.
61+
62+
Additionally, you must provide the `CrossL2Inbox` with the information needed to locate the log entry.
63+
This information is encoded in a [five-member structure](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol#L7-L19) that requires 160 bytes (32 bytes × 5 members).
64+
Lastly, you need to call a function which requires a 4-byte selector.
65+
66+
Therefore, the total bytes required is: **164 + 32t + n**
67+
68+
Where:
69+
* `164` = base overhead (160 bytes for the structure + 4 bytes for the function selector)
70+
* `t` = number of topics in the log entry
71+
* `n` = number of data bytes in the log entry
72+
73+
Every transaction posted costs at least *21,000* gas.
74+
The hashing operation costs approximately [*30+0.2×\<number of bytes>*](https://www.evm.codes/?fork=cancun#20), which is negligible by comparison.
75+
We can usually ignore the [memory expansion cost](https://www.evm.codes/about#memoryexpansion), unless the validating contract uses a really large amount of memory.
76+
77+
The cost of using the message is beyond the scope here, because it depends on your application.
78+
79+
The main cost drivers are the 21,000 gas transaction cost plus the cost of posting a *164+32t+n* byte transaction.
80+
81+
## Cross domain messenger
82+
83+
This higher level protocol adds some expenses, mostly because replay protection requires storage, and [writing to storage](https://www.evm.codes/?fork=cancun#55) is a relatively expensive operation.
84+
85+
### Initiating message
86+
87+
The initiating message is sent by [`L2ToL2CrossDomainMessenger.sendMessage`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L128-L161). This function writes to storage twice.
88+
89+
It writes to [specify that the hash has a sent message](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L157).
90+
This would typically be written to previously empty storage, so the cost is *22,100* gas.
91+
92+
Then it [increments the nonce value](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L158).
93+
Overwriting previously used storage (which means storage where the present value is *not* zero) only costs *5,000* gas.
94+
95+
Hence, the gas cost for creating an initiating message is approximately *27,100* gas, plus minor overhead for log emission and contract operations.
96+
Note that this estimate excludes the 21,000 gas base transaction cost, which applies to all transactions.
97+
98+
### Executing message
99+
100+
If autorelay is turned on in a blockchain, then you don't care about the cost of the executing message.
101+
The chain operator will bear the cost.
102+
103+
If autorelay is not turned on, the executing message is a call to [`L2ToL2CrossDomainMessenger.relayMessage`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L197-L256).
104+
The only storage operation here is [noting the hash has been used for a message already](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L241).
105+
This is previously unwritten storage, so we can expect to pay the full *22,100* in gas.
106+
Plus, of course, the *21,000* that any transaction costs.
107+
All the other gas costs are negligible.
108+
109+
## Conclusion
110+
111+
Unless the message is *extremely* long, the cost of an interop message, taking both sides together, is unlikely to exceed *100,000* gas.
112+
At the time of writing, each gas unit costs approximately `$3×10^-9`, so it would take about thirty messages to add up to a full cent.
113+
114+
## Next steps
115+
116+
* Build a [revolutionary app](/app-developers/get-started) that uses multiple blockchains within the Superchain
117+
* Deploy a [SuperchainERC20](/interop/tutorials/deploy-superchain-erc20) to the Superchain
118+
* Learn [how messages get from one chain to another chain](/interop/message-passing)
119+
* Watch [this video](https://www.youtube.com/watch?v=FKc5RgjtGes), which gives an overview of Superchain interoperability.

pages/interop/get-started.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ Reimagine your app with Superchain Interop to deliver the unified UX your users
2828

2929
## Connect to Superchain Interop
3030

31-
Select a network to build, test, and quickly iterate on interoperable apps.
31+
Choose your development environment to build, test, and quickly iterate on your apps.
3232

33-
| Local network | Devnet |
34-
| :-------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
35-
| Build and iterate on your apps with Supersim – a local multi-chain dev environment. | Deploy your app to devnet – a testnet developmental version – to conduct large-scale testing. |
36-
| <ul><li>RPC Endpoint: `local RPC URL` </li><li>Chain ID: `local chain ID`</li><li>Block explorer: TBD</li></ul> | <ul><li>RPC Endpoint: `devnet RPC URL`</li><li>Chain ID: `devnet chain ID`</li><li> Block explorer: TBD</li></ul> |
37-
| [Supersim](/app-developers/tutorials/supersim) | [Devnet Docs](/interop/tools/devnet) |
33+
| Environment | Purpose | Getting Started |
34+
| --------------------- | ----------------------------------------- | ---------------------------------------------------------- |
35+
| **Local development** | Rapid iteration and testing with Supersim | [Setup supersim guide](/app-developers/tutorials/supersim) |
36+
| **Interop devnet** | Large-scale testing on testnets | [Network specs](/interop/tools/devnet) |
37+
38+
For complete network details including RPC endpoints, chain IDs, contract addresses, and bridging instructions, see the [Superchain Interop Devnet Documentation](/interop/tools/devnet).
3839

3940
## Deploy your app to devnet in minutes
4041

pages/operators/chain-operators/configuration/batcher.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The minimum tip cap and base fee are also lifted to 2 gwei because it is uncerta
8989
The resubmission timeout is increased to a few minutes to give more time for inclusion before bumping the fees because current transaction pool implementations require a doubling of fees for blob transaction replacements.
9090

9191
Multi-blob transactions are particularly useful for medium to high-throughput chains, where enough transaction volume exists to fill up 6 blobs in a reasonable amount of time.
92-
You can use [this calculator](https://docs.google.com/spreadsheets/d/12VIiXHaVECG2RUunDSVJpn67IQp9NHFJqUsma2PndpE/edit) for your chain to determine what number of blobs are right for you, and what gas scalar configuration to use. Please also refer to guide on [Using Blobs](/operators/chain-operators/management/blobs) for chain operators.
92+
You can use [this calculator](https://docs.google.com/spreadsheets/d/1V3CWpeUzXv5Iopw8lBSS8tWoSzyR4PDDwV9cu2kKOrs/edit?gid=186414307#gid=186414307) for your chain to determine what number of blobs are right for you, and what gas scalar configuration to use. Please also refer to guide on [Using Blobs](/operators/chain-operators/management/blobs) for chain operators.
9393

9494
### Set your `--batch-type=1` to use span batches
9595

pages/operators/chain-operators/deploy/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ contracts that are deployed when the chain is created.
3838
Standard OP Stack chains should only use governance approved and audited
3939
smart contracts. The monorepo has them tagged with the following pattern
4040
`op-contracts/vX.X.X` and you can review the release notes for details on the
41-
changes. Read more about the details in our [Smart Contract Release Section](/stack/smart-contracts#official-releases).
41+
changes. Read more about the details in our [Smart Contract Release Section](/stack/smart-contracts/smart-contracts#official-releases).
4242
</Callout>
4343

4444
## Sequencer node

pages/operators/chain-operators/deploy/smart-contracts.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ Deploying OP Stack L1 contracts is a critical step in setting up your rollup.
3232
generally not considered backwards compatible.
3333
</Callout>
3434

35-
## Deployment workflow
36-
3735
<Steps>
38-
### Install op-deployer
36+
37+
### Install op-deployer
3938

4039
First, install the `op-deployer` tool following the [installation instructions](/operators/chain-operators/tools/op-deployer#installation).
4140

pages/operators/chain-operators/self-hosted.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ There are two main steps to get started building your own self-hosted OP Chain:
3535
* **Chain Architecture**: OP Chains use execution and consensus clients as well as the OP Stack's privileged roles. For more details, see the [Chain Architecture](/operators/chain-operators/architecture) guide.
3636
* **Smart Contracts**: OP Chains use several smart contracts on the L1
3737
blockchain to manage aspects of the Rollup. Each OP Stack chain has its own
38-
set of [L1 smart contracts](/stack/smart-contracts),
39-
[L2 predeploy contracts](/stack/smart-contracts),
38+
set of [L1 smart contracts](/stack/smart-contracts/smart-contracts),
39+
[L2 predeploy contracts](/stack/smart-contracts/smart-contracts),
4040
and [L2 preinstall contracts](/operators/chain-operators/features/preinstalls)
4141
that are deployed when the chain is created.
4242
* **Preinstalls**: OP Chains come with [preinstalled core contracts](/operators/chain-operators/features/preinstalls), making them usable as soon as a chain is initialized on the OP Stack.

pages/operators/chain-operators/tools/op-conductor.mdx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,20 +725,40 @@ Active returns true if the op-conductor is active (not paused or stopped).
725725
</Callout>
726726

727727
CommitUnsafePayload commits an unsafe payload (latest head) to the consensus
728-
layer. TODO - usage examples that include required params are needed
728+
layer. This method is typically called by the op-node to commit execution payload envelopes.
729729

730730
<Tabs items={['curl', 'cast']}>
731731
<Tabs.Tab>
732732
```sh
733733
curl -X POST -H "Content-Type: application/json" --data \
734-
'{"jsonrpc":"2.0","method":"conductor_commitUnsafePayload","params":[],"id":1}' \
734+
'{"jsonrpc":"2.0","method":"conductor_commitUnsafePayload","params":[{
735+
"executionPayload": {
736+
"parentHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
737+
"feeRecipient": "0x4200000000000000000000000000000000000019",
738+
"stateRoot": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
739+
"receiptsRoot": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
740+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
741+
"prevRandao": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
742+
"blockNumber": "0x64",
743+
"gasLimit": "0x1c9c380",
744+
"gasUsed": "0x5208",
745+
"timestamp": "0x12345678",
746+
"extraData": "0x",
747+
"baseFeePerGas": "0x7",
748+
"blockHash": "0x9876543210fedcba9876543210fedcba9876543210fedcba9876543210fedcba",
749+
"transactions": []
750+
}
751+
}],"id":1}' \
735752
http://127.0.0.1:8547
736753
```
737754
</Tabs.Tab>
738755

739756
<Tabs.Tab>
740757
```sh
741-
cast rpc conductor_commitUnsafePayload --rpc-url http://127.0.0.1:8547
758+
# Example with basic payload structure
759+
cast rpc conductor_commitUnsafePayload \
760+
'{"executionPayload":{"parentHash":"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef","feeRecipient":"0x4200000000000000000000000000000000000019","stateRoot":"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890","receiptsRoot":"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","prevRandao":"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef","blockNumber":"0x64","gasLimit":"0x1c9c380","gasUsed":"0x5208","timestamp":"0x12345678","extraData":"0x","baseFeePerGas":"0x7","blockHash":"0x9876543210fedcba9876543210fedcba9876543210fedcba9876543210fedcba","transactions":[]}}' \
761+
--rpc-url http://127.0.0.1:8547
742762
```
743763
</Tabs.Tab>
744764
</Tabs>

pages/operators/node-operators/tutorials/run-node-from-source.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Below are suggested minimum hardware requirements for each type of node.
4444
Given the growing size of the blockchain state, choosing the right SSD size is important.
4545
Below are the storage needs as of April 2024:
4646

47-
* **Full Node:** The snapshot size for a full node is approximately 1.6TB, with the data directory's capacity increasing by about 1TB every six months.
48-
* **Archive Node:** The snapshot size for an archive node is approximately 5TB, with the data directory's capacity increasing by about 3TB every six months.
47+
* **Full Node:** The snapshot size for a full node is approximately 700GB, with the data directory's capacity increasing by about 100GB every six months.
48+
* **Archive Node:** The snapshot size for an archive node is approximately 14TB, with the data directory's capacity increasing by about 3.5TB every six months. A local SSD with a NVME interface is recommended for archive nodes
4949

5050
Based on these trends, node operators should plan for future storage needs and choose SSDs that can handle these increasing requirements.
5151

0 commit comments

Comments
 (0)