-
Notifications
You must be signed in to change notification settings - Fork 305
Add alt-da mode docs #752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add alt-da mode docs #752
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
97513ef
add alt-da technical explainer doc
K-Ho 9dea0d8
Apply suggestions from code review
cpengilly 5cb0051
add FAQ to alt-da mode explainer
K-Ho 8932b51
Merge branch 'alt-da-generic-commitment-docs' of https://github.com/e…
K-Ho 482d4d2
add alt-da mode docs for chain operators
K-Ho 55598ff
add docs on integrating a new DA Layer
K-Ho 2f33476
Apply suggestions from code review
cpengilly fa2891b
lint fixes
cpengilly 10dc911
Merge branch 'main' into alt-da-generic-commitment-docs
cpengilly 3138c6b
lint fixes, lang updates
cpengilly 9244f58
several updates
cpengilly b62c0de
Apply suggestions from code review
cpengilly 3389ef3
address comment feedback
K-Ho e0a49c4
fix link format
K-Ho 52b3e01
add new line at end of file
K-Ho b99da6c
fix typo
K-Ho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| { | ||
| "preinstalls": "Preinstalls", | ||
| "alt-da-mode": "Run an Alt-DA Mode Chain", | ||
| "custom-gas-token": "Run a Custom Gas Token Chain" | ||
| } |
111 changes: 111 additions & 0 deletions
111
pages/builders/chain-operators/features/alt-da-mode.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| --- | ||
| title: How to Run an Alt-DA Mode Chain | ||
| lang: en-US | ||
| description: Learn how to configure and run an Alt-DA mode chain within the OP Stack. | ||
| --- | ||
|
|
||
| import { Callout, Steps } from 'nextra/components' | ||
|
|
||
| # How to Run an Alt-DA Mode Chain | ||
|
|
||
| <Callout type="warning"> | ||
| The Alt-DA Mode feature is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing and may have bugs or other issues. | ||
| </Callout> | ||
|
|
||
| This guide provides a walkthrough for chain operators who want to run an Alt-DA Mode chain. See the [Alt-DA Mode Explainer](/stack/protocol/features/alt-da-mode) for a general overview of this OP Stack configuration. | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| An Alt-DA Mode OP Stack chain enables a chain operator to post and read data to any alternative data availability layer that has built a functioning OP Stack DA Server. | ||
|
|
||
| ## Prerequisite | ||
|
|
||
| You should use at least the following compatible op\* versions when running your chain. | ||
|
|
||
| * op-node/v1.8.0-rc.1 | ||
| * op-proposer/v1.8.0-rc.1 | ||
| * op-batcher/v1.8.0-rc.1 | ||
| * [Latest version of op-geth](https://github.com/ethereum-optimism/op-geth/releases/latest) | ||
|
|
||
| For deploying your contracts, use the latest release. | ||
|
|
||
| <Callout type="info"> | ||
| If you are trying to launch an Alt-DA Mode Chain using a custom gas token, follow the contract deployment instructions in our [Custom Gas Token docs](/builders/chain-operators/features/custom-gas-token.mdx). | ||
| </Callout> | ||
|
|
||
| <Steps> | ||
| ### Setup Your DA Server | ||
|
|
||
| <Callout type="warning"> | ||
| DA Servers are not built or maintained by Optimism Collective Core Contributors. They are often maintained by the team that built the DA Layer that the DA Server enables access to. Please reach out to the team who built the DA Server you are trying to run with any questions or issues. | ||
| </Callout> | ||
|
|
||
| * Celestia's docs on how to run the [Celestia DA server](https://github.com/celestiaorg/op-plasma-celestia/blob/main/README.md) | ||
| * EigenDA's docs on how to run the [EigenDA DA server](https://github.com/Layr-Labs/op-plasma-eigenda/blob/main/README.md) | ||
| * Avail's docs on how to run the [AvailDA DA Server](https://docs.availproject.org/docs/build-with-avail/Optimium/op-stack/op-stack#setup-avail-da-server) | ||
|
|
||
| ### Configure Your `op-node` | ||
|
|
||
| * Spin up your OP chain as usual but set `--altda.enabled=true` and point both `op-batcher` and `op-node` to the DA server. | ||
K-Ho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * No configuration changes are required for `op-geth` or `op-proposer`. | ||
|
|
||
| ``` | ||
| Alt-DA (EXPERIMENTAL) | ||
| --altda.da-server value ($OP_NODE_ALTDA_DA_SERVER) | ||
| HTTP address of a DA Server | ||
| --altda.enabled (default: false) ($OP_NODE_ALTDA_ENABLED) | ||
| Enable Alt-DA mode | ||
| --altda.verify-on-read (default: true) ($OP_NODE_ALTDA_VERIFY_ON_READ) | ||
| Verify input data matches the commitments from the DA storage service | ||
| ``` | ||
|
|
||
| ### Configure Your Batcher | ||
|
|
||
| * Set `--altda.enabled=true` and `--altda.da-service=true`. | ||
| * Provide the URL for `--atlda.da-server=$DA_SERVER_HTTP_URL`. | ||
|
|
||
| ``` | ||
| --altda.da-server value ($OP_BATCHER_ALTDA_DA_SERVER) | ||
| HTTP address of a DA Server | ||
| --altda.da-service (default: false) ($OP_BATCHER_ALTDA_DA_SERVICE) | ||
| Use DA service type where commitments are generated by the DA server | ||
| --altda.enabled (default: false) ($OP_BATCHER_ALTDA_ENABLED) | ||
| Enable Alt-DA mode | ||
| --altda.verify-on-read (default: true) ($OP_BATCHER_ALTDA_VERIFY_ON_READ) | ||
| Verify input data matches the commitments from the DA storage service | ||
| ``` | ||
|
|
||
| After completing steps 1-3 above, you will have an Alt-DA mode chain up and running. | ||
|
|
||
| ### Set Your Fee Configuration | ||
|
|
||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * Chain operators are not posting everything to Ethereum, just commitments, so chain operators will need to determine fee scalars values to charge users. The fee scalar values are network throughput dependent, so values will need to be adjusted by chain operators as needed. | ||
| * Cost structure for Alt-DA Mode: The transaction data is split up into 128kb chunks and then submitted to your DA Layer. Then, 32 byte commitments are submitted (goes to batch inbox address) to L1 for each 128kb chunk. Then, figure out how much that costs relative to the amount of transactions your chain is putting through. | ||
K-Ho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * Set scalar values inside the deploy config. The example below shows some possible fee scalar values, calculated assuming negligible DA Layer costs, but will need to be adjusted up or down based on network throughput - as a reminder of how to set your scalar values, see [this section](https://docs.optimism.io/builders/chain-operators/management/blobs#update-your-scalar-values-for-blobs) of the docs. | ||
K-Ho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ``` | ||
| // Set in Deploy Config | ||
| "gasPriceOracleBaseFeeScalar": 7663, // Approximate commitment tx base cost | ||
| "gasPriceOracleBlobBaseFeeScalar": 0, // blobs aren't used for submitting the small data commitments | ||
| ``` | ||
|
|
||
| <Callout> | ||
| Some initial scalar values must be set early on in the deploy config in [Step 2](#configure-your-op-node). And then at a later point, chain operators can update the scalar values with an L1 transaction. | ||
| </Callout> | ||
| </Steps> | ||
|
|
||
| ## For Node Operators (Full and Archive Nodes) | ||
|
|
||
| * Run a DA server as laid out in [Step 1](#setup-your-da-server) | ||
| * Provide the same `--altda.enabled=true, --altda.da-server...` on `op-node` as listed in [Step 2](#configure-your-op-node) | ||
|
|
||
| ## Next Steps | ||
|
|
||
| * Additional questions? See the FAQ section in the [Alt-DA Mode Explainer](/stack/protocol/features/alt-da-mode#faqs). | ||
| * For more detailed info on Alt-DA Mode, see the [specs](https://specs.optimism.io/experimental/alt-da.html). | ||
| * If you experience any problems, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
pages/builders/chain-operators/tutorials/integrating-da-layer.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| title: Integrating a New DA Layer with Alt-DA | ||
| lang: en-US | ||
| description: Learn how to add support for a new DA Layer within the OP Stack. | ||
| --- | ||
|
|
||
| import { Callout, Steps } from 'nextra/components' | ||
|
|
||
| # Integrating a New DA Layer with Alt-DA | ||
|
|
||
| <Callout type="warning"> | ||
| The Alt-DA Mode feature is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing and may have bugs or other issues. | ||
| </Callout> | ||
|
|
||
| [Alt-DA Mode](/stack/protocol/features/alt-da-mode) enables seamless integration of any DA Layer, regardless of their commitment type, into the OP Stack. After a DA Server is built for a DA Layer, any chain operator can launch an OP Stack chain using that DA Layer for sustainably low costs. | ||
|
|
||
| ## Build Your DA Server | ||
|
|
||
| Our suggestion is for every DA Layer to build and maintain their own DA Server, with support from the OP Labs team along the way. The DA Server will need to be run by every node operator, so we highly recommend making your DA Server open source and MIT licensed. | ||
|
|
||
| <Steps> | ||
| ### Design your commitment binary encoding | ||
|
|
||
| * It must point to the data on your layer (like block height / hash). | ||
| * It must be able to validate the data returned from the data (i.e., include a cryptographic commitment to the data like a hash, merkle proof, or polynomial commitment, this could be done against the block hash with a complex proof). | ||
|
|
||
| <Callout> | ||
| See the [specs](https://specs.optimism.io/experimental/alt-da.html?highlight=input-commitment-submission#input-commitment-submission) for more info on commitment submission. | ||
| </Callout> | ||
|
|
||
| ### Claim your da\_layer byte | ||
|
|
||
| * Claim your [byte](https://github.com/ethereum-optimism/specs/discussions/135) | ||
|
|
||
| ### Implement the DA Server | ||
|
|
||
| * Write a simple HTTP server which supports `get` and `put` | ||
| * `put` is used by the batcher and can return the commitment to the batcher in the body. It should not return until the data is known to be submitted to your DA layer. | ||
| * `get` should fetch the data. If the data is not available, it should return a `404` not found. If there are other errors, a different error should be returned. | ||
|
|
||
| </Steps> | ||
|
|
||
| ## Run Alt-DA | ||
| Follow our guide on [how to operate an Alt-DA Mode chain](/builders/chain-operators/features/alt-da-mode), except instead of using the S3 DA server, use the DA server that you built. | ||
|
|
||
| ## Next Steps | ||
|
|
||
| * Want to explore more? See an [example DA server](https://github.com/ethereum-optimism/optimism/blob/develop/op-plasma/daserver.go) | ||
| * For more detail on implementing the DA Server, [see the specification](https://specs.optimism.io/experimental/alt-da.html#da-server). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| { | ||
| "custom-gas-token": "Custom Gas Token" | ||
| "custom-gas-token": "Custom Gas Token", | ||
| "alt-da-mode": "Alt-DA Mode" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| title: Alt-DA Mode Explainer | ||
| lang: en-US | ||
| description: Learn the basic process, benefits, and considerations for running an Alt-DA mode chain. | ||
| --- | ||
|
|
||
| import { Callout } from 'nextra/components' | ||
|
|
||
| # Alt-DA Mode Explainer | ||
|
|
||
| Alt-DA Mode enables seamless integration of various Data Availability (DA) Layers, regardless of their commitment type, into the OP Stack. This allows any chain operator to launch an OP Stack chain using their favorite DA Layer for sustainably low costs. | ||
|
|
||
| ## Sustainably Low Costs | ||
|
|
||
| In order to function securely, OP Stack chains need to ensure that L2 transaction data is available to all node operators. EIP-4844 has massively reduced Ethereum L1 data costs for OP Stack rollups, but blobspace is on the path to congestion, which will lead to higher blob fees and increased chain operator costs. | ||
| Over the past few years, alternative DA Layers have been built as an alternative place for L2s to post L2 data that is cheap, with more throughput, but remains stable and minimizes security and decentralization tradeoffs. | ||
K-Ho marked this conversation as resolved.
Show resolved
Hide resolved
K-Ho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## How It Works | ||
|
|
||
| Alt-DA Mode introduces a standard interface for reading and writing data to Alt-DA Layers and allows any DA Layer team to build and maintain their own [DA Server](https://specs.optimism.io/experimental/alt-da.html#da-server) to enable the OP Stack to communicate with their DA Layer. The DA Server handles any of the custom DA Layer logic, such as key management, interfacing with a DA Layer node, etc. | ||
|
|
||
| This abstraction ensures that new features and improvements to Alt-DA Mode will come to all chains using Alt-DA Mode, regardless of the DA Layer they choose to use. | ||
| Although the Data Availability Challenge (DA Challenge) will be disabled at launch, this integration provides a solution compatible with upcoming OP Stack features. | ||
|
|
||
| ## Future Improvements | ||
|
|
||
| Just like with the Rollup configuration of the OP Stack, core contributors are continuously improving the decentralization, security, and cost-effectiveness of Alt-DA Mode. Some of the future features that core contributors are looking to build are: | ||
|
|
||
| * Integration with Fault Proofs | ||
| * Plasma Data Availability Challenges support for more DA Layers (currently only supports DA Layers with a `keccak256` commitment type) | ||
| * DA Bridge integrations (like Celestia Blobstream and Eigen DA Cert Verification) | ||
| * Increasing the amount of data that can be committed to in a single commitment (potentially with merklization) | ||
|
|
||
| ## Tradeoffs of Alt-DA Mode | ||
|
|
||
| Alt-DA Mode will always have more trust assumptions than simply posting data to L1 Ethereum. In its current initial iteration, Alt-DA Mode with generic commitments fully trusts the chain operator to make data available by both posting all data to the DA Layer and posting corresponding commitments to L1 Ethereum. If a chain operator posts incorrect commitments or does not post data to the DA Layer, it will not be accessible by node operators. The future improvements mentioned above are intended to address this trust assumption. After DA Bridges are integrated, then as long as the DA Layer and its DA Bridge are decentralized and functioning as intended, then once data is posted to the DA Layer, the L1 commitments would be bridged without relying on a single trusted party. It is important to remember that, even after integrating the DA Bridges and Fault Proofs, there will still be an added trust assumption that the DA Layer and DA Bridge are secure and functioning as intended. | ||
|
|
||
| ## Next Steps | ||
|
|
||
| * Ready to get started? Read our guide on how to [deploy your Alt-DA Mode chain](/builders/chain-operators/features/alt-da-mode). | ||
| * For more info about how Alt-DA Mode works under the hood, [check out the specs](https://specs.optimism.io/experimental/alt-da.html). | ||
|
|
||
| ## FAQs | ||
K-Ho marked this conversation as resolved.
Show resolved
Hide resolved
K-Ho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Can I deploy a chain using Ethereum L1 DA and later switch to Alt-DA? | ||
|
|
||
| While it is a future goal to spec out a migration path from Ethereum L1 DA to Alt-DA Mode, the migration path has not been scoped out yet. | ||
|
|
||
| ### Can I deploy a chain using Alt-DA and then later switch to Ethereum L1 DA? | ||
|
|
||
| Same as above, it is a future goal to spec out this migration path, but the migration path has not been scoped out yet. | ||
|
|
||
| ### Can I switch between Alt-DA layers when using Alt-DA Mode? | ||
|
|
||
| This is technically possible today. A chain operator can start posting data to two DA Layers simultaneously during a transition period and coordinates their node operators to switch the DA Server they operate during that time. | ||
| If assistance is needed here, please reach out [via Github](https://github.com/ethereum-optimism/developers/discussions) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.