From b7c0095974d52ed4ec6ffb137285e2834cae2b0c Mon Sep 17 00:00:00 2001 From: jcstein Date: Wed, 8 May 2024 11:04:31 -0400 Subject: [PATCH 01/18] fix: The language 'error' is not loaded, falling back to 'txt' for syntax highlighting. (x2) --- developers/golang-client-tutorial.md | 0 nodes/full-consensus-node.md | 2 +- nodes/validator-node.md | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 developers/golang-client-tutorial.md diff --git a/developers/golang-client-tutorial.md b/developers/golang-client-tutorial.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/nodes/full-consensus-node.md b/nodes/full-consensus-node.md index 7ee31772224..a40f63dba3e 100644 --- a/nodes/full-consensus-node.md +++ b/nodes/full-consensus-node.md @@ -408,7 +408,7 @@ configuration to load the new settings. If you encounter an error like: -```error +```bash 2024-04-25 14:48:24 6:48PM ERR CONSENSUS FAILURE!!! err="+2/3 committed an invalid block: wrong Block.Header.Version. Expected {11 1}, got {11 2}" module=consensus stack="goroutine 214 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x64\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine.func2()\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:746 +0x44\npanic({0x1b91180?, 0x400153b240?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x124\ngithub.com/tendermint/tendermint/consensus.(*State).finalizeCommit(0x400065ea88, 0x3)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:1637 +0xd30\ngithub.com/tendermint/tendermint/consensus.(*State).tryFinalizeCommit(0x400065ea88, 0x3)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:1606 +0x26c\ngithub.com/tendermint/tendermint/consensus.(*State).handleCompleteProposal(0x400065ea88, 0x3)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:2001 +0x2d8\ngithub.com/tendermint/tendermint/consensus.(*State).handleMsg(0x400065ea88, {{0x2b30a00, 0x400143e048}, {0x40002a61b0, 0x28}})\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:856 +0x1c8\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine(0x400065ea88, 0x0)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:782 +0x2c4\ncreated by github.com/tendermint/tendermint/consensus.(*State).OnStart in goroutine 169\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:391 +0x110\n" ``` diff --git a/nodes/validator-node.md b/nodes/validator-node.md index 01dc548727f..e79b6977b51 100644 --- a/nodes/validator-node.md +++ b/nodes/validator-node.md @@ -232,7 +232,7 @@ For additional resources, refer to If you encounter an error like: -```error +```bash 2024-04-25 14:48:24 6:48PM ERR CONSENSUS FAILURE!!! err="+2/3 committed an invalid block: wrong Block.Header.Version. Expected {11 1}, got {11 2}" module=consensus stack="goroutine 214 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x64\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine.func2()\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:746 +0x44\npanic({0x1b91180?, 0x400153b240?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x124\ngithub.com/tendermint/tendermint/consensus.(*State).finalizeCommit(0x400065ea88, 0x3)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:1637 +0xd30\ngithub.com/tendermint/tendermint/consensus.(*State).tryFinalizeCommit(0x400065ea88, 0x3)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:1606 +0x26c\ngithub.com/tendermint/tendermint/consensus.(*State).handleCompleteProposal(0x400065ea88, 0x3)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:2001 +0x2d8\ngithub.com/tendermint/tendermint/consensus.(*State).handleMsg(0x400065ea88, {{0x2b30a00, 0x400143e048}, {0x40002a61b0, 0x28}})\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:856 +0x1c8\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine(0x400065ea88, 0x0)\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:782 +0x2c4\ncreated by github.com/tendermint/tendermint/consensus.(*State).OnStart in goroutine 169\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/consensus/state.go:391 +0x110\n" ``` From c7b6b9ae3e2d12aa3cfcd95e6201b281e195b9f1 Mon Sep 17 00:00:00 2001 From: jcstein Date: Wed, 8 May 2024 16:49:22 -0400 Subject: [PATCH 02/18] docs: edit intro page for optimism --- developers/intro-to-op-stack.md | 107 ++++++++++++++------------------ 1 file changed, 48 insertions(+), 59 deletions(-) diff --git a/developers/intro-to-op-stack.md b/developers/intro-to-op-stack.md index 88ac9274477..bea08de8349 100644 --- a/developers/intro-to-op-stack.md +++ b/developers/intro-to-op-stack.md @@ -7,43 +7,72 @@ description: Learn about the integration of OP Stack with Celestia. [Optimism](https://optimism.io) is a low-cost and lightning-fast Ethereum L2 blockchain, built with [the OP Stack](https://stack.optimism.io/). -[Celestia](https://celestia.org) is a modular consensus and data network, +[Celestia](https://celestia.org) is a modular consensus and data availability (DA) network, built to enable anyone to easily deploy their own blockchain with minimal overhead. -## About the integration +Together, they allow developers to create rollups that +post data to Celestia and settle on Ethereum. -_Discover how to integrate existing blockchain frameworks -like the OP Stack with Celestia in this category._ - -:::tip -Tested on a machine with 8GB RAM, 160 GB SSD, -Ubuntu 22.10, and a 4 core AMD CPU. -::: +## About the integration This is a **beta integration** and we are working on resolving [open issues](https://github.com/celestiaorg/optimism/issues). [Optimism](https://www.optimism.io/) uses Ethereum as -a data availability (DA) layer. Currently, settlement and DA for +a DA layer. Currently, settlement and DA for Optimism are on Ethereum, both onchain. `op-batcher` batches up rollup blocks and posts to Ethereum. -### Table of contents of the category +The integration of OP Stack with Celestia underneath for DA +allows rollup operators to reduce overhead that is associated with posting +data as `calldata` on Ethereum. Instead, `op-batcher` batches up +rollup blocks and posts them to Celestia's DA network. -- [Bubs testnet](./bubs-testnet.md) -- [Deploy a smart contract on Bubs testnet](./deploy-on-bubs.md) -- [Deploy a GM Portal dapp on Bubs testnet](./gm-portal-bubs.md) -- [Deploy an OP Stack devnet](./optimism-devnet.md) -- [Deploy an OP Stack devnet on Celestia](./optimism.md) +The handling of data is accomplished in two ways. First, data is written +to the data availability (DA) layer i.e. in this case Celestia, then the +data commitment is written to the `op-batcher`. When reading `op-node` +simply reads the data back from the DA layer by reading the +data commitment from the `op-batcher` first, then reading the +data from the DA layer using the data commitment. Hence, while +previously `op-node` was reading from `calldata` on Ethereum, +but now it reads data from Celestia. -## Celestia and OP Stack repository +There are a few tools involved in the data handling process. `op-batcher` +batches up rollup blocks and posts them to Ethereum. `op-geth` handles +execution, while `op-proposer` is responsible for state commitment +submission. + +By using Celestia as a DA layer, existing L2s can switch from posting +their data as `calldata` on Ethereum, to posting to Celestia. +The commitment to the block is posted on Celestia, which is +purpose-built for data availability. This is a more scalable than +the traditional method of posting this data as `calldata` on monolithic chains. + +### GitHub repository Find the [repository for this integration](https://github.com/celestiaorg/optimism/) at `https://github.com/celestiaorg/optimism`. -### What are Optimism and the OP Stack? +## Category contents + +This category will guide you through interacting with existing OP Stack rollups +with Celestia underneath, then how to start your own devnet +with a modified version of `optimism-bedrock` that uses Celestia as a +DA layer. + +_Discover how to integrate existing blockchain frameworks +like the OP Stack with Celestia in this category._ + +- [Bubs testnet](./bubs-testnet.md): learn about +the first testnet made with OP Stack with Celestia underneath +- [Deploy a smart contract on Bubs testnet](./deploy-on-bubs.md) +- [Deploy a GM Portal dapp on Bubs testnet](./gm-portal-bubs.md) +- [Deploy an OP Stack devnet](./optimism-devnet.md) +- [Deploy an OP Stack devnet on Celestia](./optimism.md) + + ## Next steps From 390994cb2ad1da26421f1aa8e627d802c1659de5 Mon Sep 17 00:00:00 2001 From: jcstein Date: Wed, 8 May 2024 17:13:44 -0400 Subject: [PATCH 03/18] docs: update bubs page --- developers/bubs-testnet.md | 38 ++++++++++----------------------- developers/deploy-on-bubs.md | 6 ++++++ developers/intro-to-op-stack.md | 13 +++++------ 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/developers/bubs-testnet.md b/developers/bubs-testnet.md index 6a9c330b1fe..7634d3e5de4 100644 --- a/developers/bubs-testnet.md +++ b/developers/bubs-testnet.md @@ -1,14 +1,17 @@ --- description: The first testnet built with OP Stack and Celestia. +next: + text: "Deploy a smart contract on Bubs testnet" + link: "/developers/deploy-on-bubs" --- # Bubs testnet ![Bubs testnet](/img/Celestia_Bubs_Testnet.jpg) -[Bubs Testnet](https://bubs-sepolia.hub.caldera.xyz/) is a fresh offering from -[Caldera](https://caldera.xyz) with support from Celestia Labs, -built with OP Stack and Celestia, and is dedicated to providing developers with +[Bubs Testnet](https://bubs-sepolia.hub.caldera.xyz/) is a the first +OP Stack testnet with Celestia underneath hosted by +[Caldera](https://caldera.xyz) with support from Celestia Labs. Bubs is dedicated to providing developers with an EVM-compatible execution layer to deploy their EVM applications on. ## Built with the OP Stack and Celestia @@ -19,27 +22,12 @@ layer. This integration can be found in the [@celestiaorg/optimism repository](https://github.com/celestiaorg/optimism). The testnet is hosted by [Caldera](https://caldera.xyz), who makes it easy to launch rollups with no code required. - -In this setup, data handling is accomplished in two ways. Firstly, data is -written to the DA layer, in this case, Celestia -(on the [Mocha testnet](../nodes/mocha-testnet.md)). Then, the data -commitment is written to the `op-batcher`. When reading, the `op-node` -retrieves the data back from the DA layer by first reading the data commitment -from the `op-batcher`, then reading the data from the DA layer using the data -commitment. Hence, while previously `op-node` was reading from `calldata` on -Ethereum, it now reads data from Celestia. +Bubs' data is posted to Celestia +on the [Mocha testnet](../nodes/mocha-testnet.md). [View the namespace for Bubs on Celestia's Mocha testnet](https://mocha-4.celenium.io/namespace/000000000000000000000000000000000000ca1de12ad45362e77e87). -The tools involved in the data handling process include `op-batcher`, -which batches up rollup blocks and posts them to Ethereum, `op-geth` -that handles execution, and `op-proposer` responsible for state commitment -submission. - -By using Celestia as a DA layer, existing L2s can switch from posting their -data as `calldata` on Ethereum to posting to Celestia. The commitment to the -block is posted on Celestia, which is purpose-built for data availability. -This is more scalable than the traditional method of posting this data as -`calldata` on monolithic chains. +[Learn more about the setup of the integration in +the introduction](./intro-to-op-stack.md#about-the-integration). ## Building on Bubs @@ -102,8 +90,4 @@ To see the status and uptime information for Bubs, Now that you have a better understanding of the Bubs Testnet and its integration of OP Stack and Celestia, you can start exploring its -capabilities: - -- [Deploy a smart contract on Bubs testnet](./deploy-on-bubs.md) -- [Deploy a GM Portal dapp on Bubs testnet](./gm-portal-bubs.md) - +capabilities. \ No newline at end of file diff --git a/developers/deploy-on-bubs.md b/developers/deploy-on-bubs.md index 7e5af4f47ce..e275eb6dbca 100644 --- a/developers/deploy-on-bubs.md +++ b/developers/deploy-on-bubs.md @@ -1,3 +1,9 @@ +--- +prev: + text: "Bubs testnet" + link: "/developers/bubs-testnet" +--- + # Deploy a smart contract on Bubs testnet In this tutorial, we will deploy a smart contract to the diff --git a/developers/intro-to-op-stack.md b/developers/intro-to-op-stack.md index bea08de8349..ab7fd31c9b7 100644 --- a/developers/intro-to-op-stack.md +++ b/developers/intro-to-op-stack.md @@ -16,9 +16,6 @@ post data to Celestia and settle on Ethereum. ## About the integration -This is a **beta integration** and we are working on resolving -[open issues](https://github.com/celestiaorg/optimism/issues). - [Optimism](https://www.optimism.io/) uses Ethereum as a DA layer. Currently, settlement and DA for Optimism are on Ethereum, both onchain. `op-batcher` batches up @@ -34,9 +31,8 @@ to the data availability (DA) layer i.e. in this case Celestia, then the data commitment is written to the `op-batcher`. When reading `op-node` simply reads the data back from the DA layer by reading the data commitment from the `op-batcher` first, then reading the -data from the DA layer using the data commitment. Hence, while -previously `op-node` was reading from `calldata` on Ethereum, -but now it reads data from Celestia. +data from the DA layer using the data commitment. While +previously `op-node` was reading from `calldata` on Ethereum, it now reads data from Celestia. There are a few tools involved in the data handling process. `op-batcher` batches up rollup blocks and posts them to Ethereum. `op-geth` handles @@ -55,6 +51,11 @@ Find the [repository for this integration](https://github.com/celestiaorg/optimism/) at `https://github.com/celestiaorg/optimism`. +:::warning +This is a **beta integration** and we are working on resolving +[open issues](https://github.com/celestiaorg/optimism/issues). +::: + ## Category contents This category will guide you through interacting with existing OP Stack rollups From ff153d293e05efc12fd7df8928b4726c952a82a8 Mon Sep 17 00:00:00 2001 From: jcstein Date: Wed, 8 May 2024 17:33:34 -0400 Subject: [PATCH 04/18] fix: sidebar flow for new pages --- developers/blobstream-proof-queries.md | 3 +++ developers/blobstream-rollups.md | 6 ++++++ developers/blobstream-x-deploy.md | 6 ++++++ developers/celestia-node-key.md | 4 ++-- developers/ethereum-fallback.md | 3 +++ developers/optimism.md | 4 ++-- developers/requesting-data-commitment-ranges.md | 6 ++++++ developers/submit-data.md | 6 ++++++ 8 files changed, 34 insertions(+), 4 deletions(-) diff --git a/developers/blobstream-proof-queries.md b/developers/blobstream-proof-queries.md index 59ffb65edee..edc9f303625 100644 --- a/developers/blobstream-proof-queries.md +++ b/developers/blobstream-proof-queries.md @@ -1,5 +1,8 @@ --- description: Learn how to query the inclusion proofs used in Blobstream +next: + text: "Requesting data commitment ranges" + link: "/developers/requesting-data-commitment-ranges" --- # Blobstream proofs queries diff --git a/developers/blobstream-rollups.md b/developers/blobstream-rollups.md index 8f61ecc791a..c790b6c7351 100644 --- a/developers/blobstream-rollups.md +++ b/developers/blobstream-rollups.md @@ -1,5 +1,11 @@ --- description: Learn how to build rollups that use Blobstream. +prev: + text: "Ethereum fallback mechanism" + link: "/developers/ethereum-fallback" +next: + text: "Submitting data blobs to Celestia" + link: "/developers/submit-data" --- # Introduction to Blobstream rollups diff --git a/developers/blobstream-x-deploy.md b/developers/blobstream-x-deploy.md index 7f7d73eb9d1..e9a947102bc 100644 --- a/developers/blobstream-x-deploy.md +++ b/developers/blobstream-x-deploy.md @@ -1,3 +1,9 @@ +--- +next: + text: "Celestia-node key" + link: "/developers/celestia-node-key" +--- + # New Blobstream X deployments If you want to deploy Blobstream X to a new chain, where a Gateway diff --git a/developers/celestia-node-key.md b/developers/celestia-node-key.md index f6b2fc9e890..027e8f5429a 100644 --- a/developers/celestia-node-key.md +++ b/developers/celestia-node-key.md @@ -1,8 +1,8 @@ --- description: Use the cel-key utility to generate a wallet on celestia-node. prev: - text: "Rollkit" - link: "/developers/rollkit" + text: "New Blobstream X deployments" + link: "/developers/blobstream-x-deploy" --- # Create a wallet with celestia-node diff --git a/developers/ethereum-fallback.md b/developers/ethereum-fallback.md index 853e787722a..630694fda8b 100644 --- a/developers/ethereum-fallback.md +++ b/developers/ethereum-fallback.md @@ -1,5 +1,8 @@ --- description: The DA fallback mechanism to Ethereum for rollups. +next: + text: "Blobstream rollups" + link: "/developers/blobstream-rollups" --- # Ethereum fallback diff --git a/developers/optimism.md b/developers/optimism.md index 84f588df203..a90f8fc4bf7 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -1,8 +1,8 @@ --- description: Start your own devnet with a modified version of optimism-bedrock. next: - text: "Rollkit" - link: "/developers/rollkit" + text: "Ethereum fallback mechanism" + link: "/developers/ethereum-fallback" --- # Deploy an OP Stack devnet to Celestia diff --git a/developers/requesting-data-commitment-ranges.md b/developers/requesting-data-commitment-ranges.md index 6f4045d0ebe..784ed557c41 100644 --- a/developers/requesting-data-commitment-ranges.md +++ b/developers/requesting-data-commitment-ranges.md @@ -1,3 +1,9 @@ +--- +prev: + text: "Querying the Blobstream proofs" + link: "/developers/blobstream-proof-queries" +--- + # Requesting data commitment ranges By default, the Blobstream X deployments on Ethereum will be diff --git a/developers/submit-data.md b/developers/submit-data.md index 77643c48845..7842f362eef 100644 --- a/developers/submit-data.md +++ b/developers/submit-data.md @@ -1,3 +1,9 @@ +--- +prev: + text: "Blobstream rollups" + link: "/developers/blobstream-rollups" +--- + # Submitting data blobs to Celestia From d818870581e8c1662124e136be9745c17b52b484 Mon Sep 17 00:00:00 2001 From: jcstein Date: Wed, 8 May 2024 18:06:10 -0400 Subject: [PATCH 05/18] docs: rename pages --- .vitepress/config.ts | 4 ++-- developers/intro-to-op-stack.md | 4 ++-- developers/optimism-devnet.md | 2 +- developers/optimism.md | 2 +- developers/rollkit.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 2b61b50e94c..0c9f8231f7d 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -585,11 +585,11 @@ function sidebarHome() { link: "/developers/gm-portal-bubs", }, { - text: "Deploy an OP Stack devnet", + text: "Run an OP Stack devnet", link: "/developers/optimism-devnet", }, { - text: "Deploy an OP Stack devnet on Celestia", + text: "Run an OP Stack devnet posting to Celestia testnet", link: "/developers/optimism", }, { diff --git a/developers/intro-to-op-stack.md b/developers/intro-to-op-stack.md index ab7fd31c9b7..8e90c5b8161 100644 --- a/developers/intro-to-op-stack.md +++ b/developers/intro-to-op-stack.md @@ -70,8 +70,8 @@ like the OP Stack with Celestia in this category._ the first testnet made with OP Stack with Celestia underneath - [Deploy a smart contract on Bubs testnet](./deploy-on-bubs.md) - [Deploy a GM Portal dapp on Bubs testnet](./gm-portal-bubs.md) -- [Deploy an OP Stack devnet](./optimism-devnet.md) -- [Deploy an OP Stack devnet on Celestia](./optimism.md) +- [Run an OP Stack devnet](./optimism-devnet.md) +- [Run an OP Stack devnet posting to Celestia testnet](./optimism.md) -In order to deploy a devnet to Celestia, you will need to have a modified -version of `optimism-bedrock`. -Refer to the -[steps to install dependencies and the modified version of OP Stack](./optimism-devnet.md) -for your environment setup. +This guide will show you how to run your own OP Stack devnet locally. + +## Dependency setup + +### Environment setup + +First, [install dependencies for Celestia software](../nodes/environment.md) +and for [OP Stack](https://community.optimism.io/docs/developers/build/dev-node/). + +### Clone repository + +Next, clone the repo: + +```bash +cd $HOME +git clone https://github.com/celestiaorg/optimism +cd optimism +``` + +Check out to the version for either the +[stable version](https://github.com/celestiaorg/optimism/releases) or +[upstream version](https://github.com/celestiaorg/optimism/tree/celestia-develop): + +::: code-group + +```bash-vue [v1.2.0-OP_op-node/v1.7.5-CN_v0.13.2] +git checkout tags/v1.2.0-OP_op-node/v1.7.5-CN_v0.13.2 +git submodule update --init --recursive +``` + +```bash-vue [celestia-develop] +git checkout celestia-develop +git submodule update --init --recursive +``` -## Pick your deployment type +::: -Using Celestia and OP stack, you have the option to either -run a light node of your own or a `local-celestia-devnet`, -both of which will give you a local devnet to test things out with. +## Build devnet -### Using a local devnet +Build TypeScript definitions for TS dependencies: -If you'd like to use the `local-celestia-devnet`, you're in luck! -This is the default for the OP Stack + Celestia repository. Head -to the [previous page](./optimism-devnet.md) to get started. +```bash +make +``` -### Using a light node +Set environment variables to start network: -This is a **beta integration** and we are working on resolving -[open issues](https://github.com/celestiaorg/optimism/issues/). +```bash +export SEQUENCER_BATCH_INBOX_ADDRESS=0xff00000000000000000000000000000000000000 +export L2OO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 +``` + +## Using a light node In order to allow your light node to post and retrieve data without errors, you will need to change `UseShareExchange` @@ -95,29 +125,18 @@ By default, the node will run with the account named If you have your own setup you'd like to try, you can always edit `optimism/ops-bedrock/docker-compose.yml` to work with your setup. -### Using a RaaS provider - -If you'd like to use a Rollups as a Service (RaaS) provider, you can do so -by going to the RaaS category in the menu. - -## Build the devnet - -Build TypeScript definitions for TS dependencies: +Set your Celestia node auth token: ```bash -cd $HOME -cd optimism -make +export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network ) ``` -Set environment variables to start network: +### Using a RaaS provider -```bash -export SEQUENCER_BATCH_INBOX_ADDRESS=0xff00000000000000000000000000000000000000 -export L2OO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 -``` +If you'd like to use a Rollups as a Service (RaaS) provider, you can do so +by going to the RaaS category in the menu. -## Start the devnet +### Docker changes First, make sure your light node is synced and funded. It must not be running for this example to work. @@ -170,7 +189,32 @@ Now start the devnet: make devnet-up ``` -## View the logs of the devnet +## Start devnet + +Start the network by running: + +```bash +make devnet-up +``` + +This starts up the layer 1 (ETH), layer 2 (`op-geth`), data availability +layer (Celestia), the sequencer (`op-node`), batch submitter (`op-batcher`), +state commitment service (`op-proposer`). + +:::tip +You'll see logs related to blank variables, it is safe to ignore these. + +```bash +WARN[0000] The "CELESTIA_NODE_AUTH_TOKEN" variable is not set. Defaulting to a blank string. +WARN[0000] The "DGF_ADDRESS" variable is not set. Defaulting to a blank string. +WARN[0000] The "L2OO_ADDRESS" variable is not set. Defaulting to a blank string. +WARN[0000] The "DG_TYPE" variable is not set. Defaulting to a blank string. +WARN[0000] The "PROPOSAL_INTERVAL" variable is not set. Defaulting to a blank string. +``` + +::: + +### View the logs of the devnet If you'd like to view the logs of the devnet, run the following command from the root of the Optimism directory: @@ -179,17 +223,16 @@ from the root of the Optimism directory: make devnet-logs ``` -## Stop the devnet +### Optional: Stop devnet -To safely stop the devnet, run the following command: +If you'd like to start the network over, use the following command +to safely shut down all of the containers: ```bash make devnet-down ``` -## Clean the devnet - -To remove all data from the devnet, run the following command: +Then clean out the old config: ```bash make devnet-clean @@ -199,3 +242,233 @@ make devnet-clean If you'd like to deploy to an EVM L1 or L2, reference the [OP stack deployment guide](https://community.optimism.io/docs/developers/bedrock/node-operator-guide/). + +## Find a transaction + +Now, we'll check for a recent transaction on the L1 with: + +```bash +cast block latest --rpc-url localhost:8545 +``` + +Output of a block that contains a transaction will look like this: + +```console +baseFeePerGas 7 +difficulty 2 +extraData 0xd883010d04846765746888676f312e32312e33856c696e7578000000000000006b3afa42dce1f87f1f07a1ef569c4d43e41738ef93c865098bfa1458645f384e2e4498bcfe4ad9353ff1913a2e16162f496fafe5b0939a6c78fb5b503248d6da01 +gasLimit 30000000 +gasUsed 21568 +hash 0x1cb54d2369752ef73511c202ff9cdfd0eadf3a77b7aef0092bea63f2b5d57659 +logsBloom 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +miner 0x0000000000000000000000000000000000000000 +mixHash 0x0000000000000000000000000000000000000000000000000000000000000000 +nonce 0x0000000000000000 +number 1141 +parentHash 0x664bf4bb4a57dd5768a0a98991d77c58fb7a4e164c2581c79fb33ce9c3d4c250 +receiptsRoot 0xaf8ff6af1180c8be9e4e8f3a5f882b3b227233f4abbefa479836d3721682a389 +sealFields [] +sha3Uncles 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 +size 767 +stateRoot 0xd4b998a35d20d98ed3488221f0c161a0a9572d3de66399482553c8e3d2fae751 +timestamp 1699638350 +withdrawalsRoot +totalDifficulty 2283 +transactions: [ + 0x79a0a7a1b4936aafe7a37dbfb07a6a9e55c145a4ed6fd54f962649b4b7db8de7 +] +``` + +Copy the transaction hash from `transactions: ` and +set it as a variable: + +```bash +export TX_HASH=0x79a0a7a1b4936aafe7a37dbfb07a6a9e55c145a4ed6fd54f962649b4b7db8de7 +``` + +## Read the transaction call data + +Now read the transaction call data on the L1: + +```bash +cast tx $TX_HASH --rpc-url localhost:8545 +``` + +The output will look similar to below: + +```console +blockHash 0x9f4dfae061b5ddd86f95a81be5daa0d7fe32e7f7f770f86dc375e0007d249bd2 +blockNumber 24 +from 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC +gas 21572 +gasPrice 1040676758 +hash 0xadd3a5dc0b8c605aeac891098e87cbaff43bb642896ebbf74f964c0690e46df2 +input 0xce3500000000000000769074a923011bdda721eacc34c8a77c69c10f2b6c8e659f987e82f217a5340f +nonce 4 +r 0xaf5c1505c7dfcebca94d9a6a8c0caf99b6c87a8ed6d6c0b3161c9026f270a84f +s 0x383ed2debf9f9055920cd7340418dda7e2bca6b989eb6992d83d123d4e322f2a +to 0xFf00000000000000000000000000000000000901 +transactionIndex 0 +v 0 +value 0 +yParity 0 +``` + +::: tip +You are looking for a batcher transaction to the address +`0xFf00000000000000000000000000000000000901`. +::: + +First, remove the prefix `0xce`. +Now, set the `input` as the `INPUT` variable and encode it as +base64: + +```bash +export INPUT=3500000000000000769074a923011bdda721eacc34c8a77c69c10f2b6c8e659f987e82f217a5340f +export ENCODED_INPUT=$(echo "$INPUT" | xxd -r -p | base64) +``` + +:::tip +Remember to remove the `0xce` prefix! +::: + +## Find the data on Celestia + + + +Clone the `go-da` repository: + +```bash +cd $HOME +git clone https://github.com/rollkit/go-da.git +cd go-da/proto/da +``` + +Now, from `go-da/proto/da` run: + + + +```bash +grpcurl -proto da.proto -plaintext -d "{\"ids\": [{\"value\": \"$ENCODED_INPUT\"}]}" 127.0.0.1:26650 da.DAService.Get +``` + +Your result will look similar to the below! + +```console +{ + "blobs": [ + { + "value": "AKUumhJ8FnuyVrBs38FDKEIAAAAAAZB42trhw/DDc4GFAlv4klkv5Zh4E16mmO5fpNOS1f5wzpds8YK3S0Rvs4ULLJj13euw+Ovdv6Q23zuV1ShROEvk5aptIT7bGmZunvc1OiKwJTXVbN0BiGm6k2zNWq78cNsT2ez3+nzQq84Ds28or/aKz/o1w4NpV7w4caZtgJomX71w96m63+xzYnarXLu7WWvRrwbeb6cW8R93YHXt1r4+TXCBGVe76obzf5JLTNu22gksD2cL+83D8DGjX0FKcwZD0VofkGmboKY1uTddu8704s2MwgNNe09s1bzw+n9Fq6fKFw7pvwJL200eCS0oFJ3HfPAEywnlgyyGQc89dh+98GD5TrdU4aNql9afmW+sDzJtC9S0fzLWYROOS0bvK3W7EvNpmWXe5qrdzKlBmv1LZi4ofrrxLHGmbYOaJhHsEn+B81lGUh33HDet8K9nVKKSF2+W3Xul6uPSxydPBwsv2GHskR+yfUlDbvyl1ROTvtS1zXlpEPz0M1e/RIIt57fVj0Gm7TgACAAA//+Qdel2AQ==" + } + ] +} +``` + +## Ethereum fallback mechanism in OP Stack + +The [Ethereum fallback mechanism](ethereum-fallback.md) allows rollups to +"fall back" to Ethereum or another EVM chain in the case of downtime or +errors submitting data to Celestia. + +### Implementation of fallback + +The Ethereum fallback mechanism is implemented in the +[celestiaorg/optimism](https://github.com/celestiaorg/optimism/tree/release-v1.1.0) +v1.1.0 release. + +The `op-batcher/batcher/driver.go` and +`op-node/rollup/derive/calldata_source.go` files are part of the Ethereum +fallback mechanism in the `op-batcher` and `op-node` respectively. + +In [`driver.go`, the `calldataTxCandidate` function is responsible for the write path](https://github.com/celestiaorg/optimism/blob/release-v1.1.0/op-batcher/batcher/driver.go#L405-L419) +of the Ethereum fallback. This function creates and submits a transaction to the +batch inbox address with the given data. It uses the underlying `txmgr` to +handle transaction sending and gas price management. + +If the transaction data can be published as a blob to Celestia, +it replaces the calldata with a blob identifier and sends the +transaction with this data. If it cannot be published to Celestia, +it falls back to Ethereum without any change to the transaction. + +The blob identifier starts with the special prefix `0xce`, which was chosen as a +mnemonic for Celestia, and indicates that the remaining data has to +interpreted as a little-endian encoded Block Height (8 bytes) and +Blob Commitment (32 bytes). The combination of these can later be used to +retrieve the original calldata from Celestia. + + + +| Prefix | 8 bytes | 32 bytes | +| ------ | ------------ | --------------- | +| 0xce | Block Height | Blob Commitment | + + + +```go +func (l *BatchSubmitter) sendTransaction( + txdata txData, + queue *txmgr.Queue[txData], + receiptsCh chan txmgr.TxReceipt[txData], +) { + // ... +} +``` + +In `calldata_source.go`, +[the `DataFromEVMTransactions` function defines the read path](https://github.com/celestiaorg/optimism/blob/release-v1.1.0/op-node/rollup/derive/calldata_source.go#L102-L139) +of the Ethereum fallback. This function filters all of the transactions +and returns the calldata from transactions that are sent to the batch +inbox address from the batch sender address. + +If the calldata matches the version prefix `0xce`, it is decoded as a +blob identifier, the original calldata is retrieved from Celestia +and returned for derivation. If the calldata does not match the prefix, +the entire calldata is returned for derivation. + +```go +func DataFromEVMTransactions( + config *rollup.Config, + batcherAddr common.Address, + txs types.Transactions, + log log.Logger +) ([]eth.Data, error) { + // ... +} +``` + +These two functions work together to ensure that the Ethereum +fallback mechanism operates correctly, allowing the rollup +to continue functioning even during periods of downtime on +Celestia. + +### Testing the fallback + +Testing out the Ethereum fallback mechanism can be done +with the `go-da` tool. Triggering a simultaneous blob transaction will +cause the `op-batcher` blob transaction to fail, with an `incorrect account +sequence` error, which triggers a fallback to Ethereum. + +To trigger the transaction, send this command from the same `go/proto/da` directory: + + + +```bash +grpcurl -proto da.proto -plaintext -d '{"blobs": [{"value": "SGVsbG8gd28ybGQh"}]}' 127.0.0.1:26650 da.DAService.Submit +``` + + + +Alternatively, you can shut off the `local-celestia-devnet` and see that +the OP Stack devnet logs show that the rollup has fallen back to the L1, +in this case Ethereum, for posting data. + +## Span batches + +Span batches can be enabled by setting `OP_BATCHER_BATCH_TYPE: 1` +in your `docker-compose.yml` file. + +Note that this requires the Delta activation time to be configured. +For your devnet, you should set `"l2GenesisDeltaTimeOffset": "0x0",` +in `devnetL1-template.json`. This will enable span batches and can be tested +by grepping `docker compose logs -f | grep batch_type` which should include +`batch_type=SpanBatch` and `batch_type=1`. From c13590ae407674031340d88567461ecfba0a58c3 Mon Sep 17 00:00:00 2001 From: jcstein Date: Thu, 9 May 2024 15:45:35 -0400 Subject: [PATCH 08/18] style: raas remove hyphens --- .vitepress/config.ts | 2 +- developers/build-whatever.md | 2 +- developers/optimism.md | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index e0fbe63c91d..b86f41a6267 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -597,7 +597,7 @@ function sidebarHome() { link: "https://thirdweb.com/bubs-testnet", }, { - text: "Rollups-as-a-Service", + text: "Rollups as a Service", collapsed: true, items: [ { diff --git a/developers/build-whatever.md b/developers/build-whatever.md index 4dff4e7cec1..72649c3794f 100644 --- a/developers/build-whatever.md +++ b/developers/build-whatever.md @@ -32,7 +32,7 @@ Here are a few options that are currently available for developers. -### Rollups-as-a-Service +### Rollups as a Service Deploy your rollup with a RaaS provider. diff --git a/developers/optimism.md b/developers/optimism.md index b1f3f7d84d4..80de9751cb4 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -14,6 +14,8 @@ import constants from '/.vitepress/constants/constants.js' This guide will show you how to run your own OP Stack devnet locally. +If you'd like to use a Rollups as a Service (RaaS) provider, you can visit the RaaS category in the menu. + ## Dependency setup ### Environment setup @@ -131,11 +133,6 @@ Set your Celestia node auth token: export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network ) ``` -### Using a RaaS provider - -If you'd like to use a Rollups as a Service (RaaS) provider, you can do so -by going to the RaaS category in the menu. - ### Docker changes First, make sure your light node is synced and funded. It must From c457239580b265b0c1beca59dea17d4f23005140 Mon Sep 17 00:00:00 2001 From: jcstein Date: Thu, 9 May 2024 16:05:37 -0400 Subject: [PATCH 09/18] docs: update to optimism devnet guide --- .vitepress/config.ts | 2 +- developers/ethereum-fallback.md | 2 +- developers/intro-to-op-stack.md | 2 +- developers/optimism.md | 84 ++++++++++++++++++++++++--------- developers/rollkit.md | 2 +- 5 files changed, 65 insertions(+), 27 deletions(-) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index b86f41a6267..4ea55510755 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -585,7 +585,7 @@ function sidebarHome() { link: "/developers/gm-portal-bubs", }, { - text: "Run an OP Stack devnet posting to Celestia testnet", + text: "Run an OP Stack devnet posting Celestia", link: "/developers/optimism", }, { diff --git a/developers/ethereum-fallback.md b/developers/ethereum-fallback.md index 6314a51d70f..3dd443ca2a2 100644 --- a/developers/ethereum-fallback.md +++ b/developers/ethereum-fallback.md @@ -4,7 +4,7 @@ next: text: "Blobstream rollups" link: "/developers/blobstream-rollups" prev: - text: "Run an OP Stack devnet posting to Celestia testnet" + text: "Run an OP Stack devnet posting Celestia" link: "/developers/optimism" --- diff --git a/developers/intro-to-op-stack.md b/developers/intro-to-op-stack.md index 37eca6e5265..ea5ab2ab2c2 100644 --- a/developers/intro-to-op-stack.md +++ b/developers/intro-to-op-stack.md @@ -70,7 +70,7 @@ like the OP Stack with Celestia in this category._ the first testnet made with OP Stack with Celestia underneath - [Deploy a smart contract on Bubs testnet](./deploy-on-bubs.md) - [Deploy a GM Portal dapp on Bubs testnet](./gm-portal-bubs.md) -- [Run an OP Stack devnet posting to Celestia testnet](./optimism.md) +- [Run an OP Stack devnet posting Celestia](./optimism.md) -This guide will show you how to run your own OP Stack devnet locally. +This guide will show you how to run your own OP Stack devnet locally that posts to a Celestia network. If you'd like to use a Rollups as a Service (RaaS) provider, you can visit the RaaS category in the menu. @@ -142,8 +142,8 @@ This example is for Mainnet Beta. You can modify the `da:` section of your `$HOME/optimism/ops-bedrock/docker-compose.yml` for your specific use, similarly to the example below: -This setup will use `celestia-da`, which is `celestia-node` with -a DA server on port 26650. +This setup will use `celestia-node` with +a DA server on port 26658. For the `P2P_NETWORK` variable, you'll need to supply the network of choice, either `celestia`, `mocha`, or `arabica`. Using `celestia`, the volume path will be just @@ -152,26 +152,22 @@ to provide a core.ip RPC URL for the network you are using. -```yaml +::: code-group + +```yaml-vue [Mainnet Beta] da: - image: ghcr.io/rollkit/local-celestia-devnet:v0.12.1 // [!code --] - image: ghcr.io/rollkit/celestia-da:v0.12.9 // [!code ++] - command: > // [!code ++] - celestia-da light start // [!code ++] - --p2p.network= // [!code ++] - --da.grpc.namespace=000008e5f679bf7116cb // [!code ++] - --da.grpc.listen=0.0.0.0:26650 // [!code ++] - --core.ip // [!code ++] - --gateway // [!code ++] - environment: // [!code ++] - - NODE_TYPE=light // [!code ++] - - P2P_NETWORK= // [!code ++] + image: ghcr.io/rollkit/local-celestia-devnet:v0.13.1 // [!code --] + image: ghcr.io/celestiaorg/celestia-node:v0.13.2 // [!code ++] + command: celestia light start --p2p.network {{constants.mainnetChainId}} --core.ip rpc.celestia.pops.one --gateway// [!code ++] ports: - - "26650:26650" - "26658:26658" - - "26659:26659" + - "26659:26659" // [!code ++] volumes: // [!code ++] - - $HOME/.celestia-light-/:/home/celestia/.celestia-light-/ // [!code ++] + - $HOME/.celestia-light/:/home/celestia/.celestia-light/ // [!code ++] + environment: // [!code ++] + NODE_TYPE: "light" // [!code ++] + P2P_NETWORK: "{{constants.mainnetChainId}}" // [!code ++] + user: root // [!code ++] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] interval: 10s @@ -180,12 +176,54 @@ da: start_period: 30s ``` -Now start the devnet: +```yaml-vue [Mocha testnet] +da: + image: ghcr.io/rollkit/local-celestia-devnet:v0.13.1 // [!code --] + image: ghcr.io/celestiaorg/celestia-node:v0.13.2 // [!code ++] + command: celestia light start --p2p.network {{constants.mochaChainId}} --core.ip consensus-full-mocha-4.celestia-mocha.com --gateway// [!code ++] + ports: + - "26658:26658" + - "26659:26659" // [!code ++] + volumes: // [!code ++] + - $HOME/.celestia-light-{{constants.mochaChainId}}/:/home/celestia/.celestia-light-{{constants.mochaChainId}}/ // [!code ++] + environment: // [!code ++] + NODE_TYPE: "light" // [!code ++] + P2P_NETWORK: "{{constants.mochaChainId}}" // [!code ++] + user: root // [!code ++] + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s +``` -```bash -make devnet-up +```yaml-vue [Arabica devnet] +da: + image: ghcr.io/rollkit/local-celestia-devnet:v0.13.1 // [!code --] + image: ghcr.io/celestiaorg/celestia-node:v0.13.2 // [!code ++] + command: celestia light start --p2p.network {{constants.arabicaChainId}} --core.ip validator-1.celestia-arabica-11.com --gateway// [!code ++] + ports: + - "26658:26658" + - "26659:26659" // [!code ++] + volumes: // [!code ++] + - $HOME/.celestia-light-{{constants.arabicaChainId}}/:/home/celestia/.celestia-light-{{constants.arabicaChainId}}/ // [!code ++] + environment: // [!code ++] + NODE_TYPE: "light" // [!code ++] + P2P_NETWORK: "{{constants.arabicaChainId}}" // [!code ++] + user: root // [!code ++] + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s ``` +::: + +Now you're ready to start your devnet. + ## Start devnet Start the network by running: diff --git a/developers/rollkit.md b/developers/rollkit.md index 9be4f24a16a..e551f26fe2c 100644 --- a/developers/rollkit.md +++ b/developers/rollkit.md @@ -1,7 +1,7 @@ --- description: Learn how to build Cosmos-SDK applications that connect to Celestia's Data Availability Layer via Rollkit. prev: - text: "Run an OP Stack devnet posting to Celestia testnet" + text: "Run an OP Stack devnet posting Celestia" link: "/developers/optimism" next: text: "Create a wallet with celestia-node" From 4cefe55c5d596b7b0f8ab7ce46867de0c45d4ef7 Mon Sep 17 00:00:00 2001 From: jcstein Date: Thu, 9 May 2024 16:20:41 -0400 Subject: [PATCH 10/18] docs: updates --- developers/optimism.md | 52 +++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/developers/optimism.md b/developers/optimism.md index 8d94b576ce7..4bcaa9b70aa 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -68,6 +68,8 @@ export L2OO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 ## Using a light node + + In order to allow your light node to post and retrieve data without errors, you will need to change `UseShareExchange` to `false` in: @@ -91,16 +93,13 @@ $HOME/.celestia-light-{{constants.arabicaChainId}}/config.toml If you choose to use your own node store, the light node must be **fully synced** and **funded** for you to be able to submit and retrieve `PayForBlobs` to a Celestia network. - -If it is not synced, you will run into -[errors similar to this](https://github.com/celestiaorg/celestia-node/issues/2151/). - Visit the [Arabica](../nodes/arabica-devnet.md) or [Mocha](../nodes/mocha-testnet.md) pages to -visit their faucets. +visit their faucets. If it is not synced, you will run into +[errors similar to this](https://github.com/celestiaorg/celestia-node/issues/2151/). In order to mount existing data, you must have a node store that is -in this directory: +in the default directory: ::: code-group @@ -118,37 +117,22 @@ $HOME/.celestia-light-{{constants.arabicaChainId}} ::: -This is the default location of the node store -when you initialize and run a new Celestia node. - By default, the node will run with the account named `my_celes_key`. - If you have your own setup you'd like to try, you can always edit `optimism/ops-bedrock/docker-compose.yml` to work with your setup. -Set your Celestia node auth token: - -```bash -export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network ) -``` - ### Docker changes -First, make sure your light node is synced and funded. It must -not be running for this example to work. - -This example is for Mainnet Beta. -You can modify the `da:` section of your `$HOME/optimism/ops-bedrock/docker-compose.yml` -for your specific use, similarly to the example below: - +You will need to modify the `da:` section of your `$HOME/optimism/ops-bedrock/docker-compose.yml` +for your specific use, similarly to the example below. This setup will use `celestia-node` with a DA server on port 26658. For the `P2P_NETWORK` variable, you'll need to supply the network of choice, either `celestia`, `mocha`, or `arabica`. Using `celestia`, the volume path will be just `.celestia-light` instead of `.celestia-light-`. You will also need -to provide a core.ip RPC URL for the network you are using. +to provide a `--core.ip ` for the network you are using. @@ -222,6 +206,24 @@ da: ::: +### Set your Celestia node auth token + +::: code-group + +```bash-vue [Mainnet Beta] +export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write) +``` + +```bash-vue [Mocha testnet] +export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network mocha) +``` + +```bash-vue [Arabica devnet] +export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network arabica) +``` + +::: + Now you're ready to start your devnet. ## Start devnet @@ -478,6 +480,8 @@ Celestia. ### Testing the fallback + + Testing out the Ethereum fallback mechanism can be done with the `go-da` tool. Triggering a simultaneous blob transaction will cause the `op-batcher` blob transaction to fail, with an `incorrect account From 276e02a6524e368beb73d6d308099b1bc785d140 Mon Sep 17 00:00:00 2001 From: jcstein Date: Thu, 9 May 2024 18:25:21 -0400 Subject: [PATCH 11/18] docs: edits --- developers/optimism.md | 59 ++++++++++-------------------------------- 1 file changed, 14 insertions(+), 45 deletions(-) diff --git a/developers/optimism.md b/developers/optimism.md index 4bcaa9b70aa..8d6e73508fb 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -66,9 +66,7 @@ export SEQUENCER_BATCH_INBOX_ADDRESS=0xff00000000000000000000000000000000000000 export L2OO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 ``` -## Using a light node - - +## Setting up your light node In order to allow your light node to post and retrieve data without errors, you will need to change `UseShareExchange` @@ -211,15 +209,15 @@ da: ::: code-group ```bash-vue [Mainnet Beta] -export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write) +export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin) ``` ```bash-vue [Mocha testnet] -export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network mocha) +export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin --p2p.network mocha) ``` ```bash-vue [Arabica devnet] -export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network arabica) +export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin --p2p.network arabica) ``` ::: @@ -238,19 +236,6 @@ This starts up the layer 1 (ETH), layer 2 (`op-geth`), data availability layer (Celestia), the sequencer (`op-node`), batch submitter (`op-batcher`), state commitment service (`op-proposer`). -:::tip -You'll see logs related to blank variables, it is safe to ignore these. - -```bash -WARN[0000] The "CELESTIA_NODE_AUTH_TOKEN" variable is not set. Defaulting to a blank string. -WARN[0000] The "DGF_ADDRESS" variable is not set. Defaulting to a blank string. -WARN[0000] The "L2OO_ADDRESS" variable is not set. Defaulting to a blank string. -WARN[0000] The "DG_TYPE" variable is not set. Defaulting to a blank string. -WARN[0000] The "PROPOSAL_INTERVAL" variable is not set. Defaulting to a blank string. -``` - -::: - ### View the logs of the devnet If you'd like to view the logs of the devnet, run the following command @@ -371,34 +356,16 @@ Remember to remove the `0xce` prefix! ## Find the data on Celestia - - -Clone the `go-da` repository: - -```bash -cd $HOME -git clone https://github.com/rollkit/go-da.git -cd go-da/proto/da -``` - -Now, from `go-da/proto/da` run: - ```bash -grpcurl -proto da.proto -plaintext -d "{\"ids\": [{\"value\": \"$ENCODED_INPUT\"}]}" 127.0.0.1:26650 da.DAService.Get +curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" -d '{ "id": 1, "jsonrpc": "2.0", "method": "da.Get", "params": [["3wAAAAAAAABmGvJUORYLqY8wVdjgp6/0oSh6brQqG3ZGr/cfUMuElg=="], "AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA="]}' http://127.0.0.1:26658 ``` Your result will look similar to the below! ```console -{ - "blobs": [ - { - "value": "AKUumhJ8FnuyVrBs38FDKEIAAAAAAZB42trhw/DDc4GFAlv4klkv5Zh4E16mmO5fpNOS1f5wzpds8YK3S0Rvs4ULLJj13euw+Ovdv6Q23zuV1ShROEvk5aptIT7bGmZunvc1OiKwJTXVbN0BiGm6k2zNWq78cNsT2ez3+nzQq84Ds28or/aKz/o1w4NpV7w4caZtgJomX71w96m63+xzYnarXLu7WWvRrwbeb6cW8R93YHXt1r4+TXCBGVe76obzf5JLTNu22gksD2cL+83D8DGjX0FKcwZD0VofkGmboKY1uTddu8704s2MwgNNe09s1bzw+n9Fq6fKFw7pvwJL200eCS0oFJ3HfPAEywnlgyyGQc89dh+98GD5TrdU4aNql9afmW+sDzJtC9S0fzLWYROOS0bvK3W7EvNpmWXe5qrdzKlBmv1LZi4ofrrxLHGmbYOaJhHsEn+B81lGUh33HDet8K9nVKKSF2+W3Xul6uPSxydPBwsv2GHskR+yfUlDbvyl1ROTvtS1zXlpEPz0M1e/RIIt57fVj0Gm7TgACAAA//+Qdel2AQ==" - } - ] -} +{"jsonrpc":"2.0","result":["SGVsbG8gd28ybGQh"],"id":1} ``` ## Ethereum fallback mechanism in OP Stack @@ -480,24 +447,26 @@ Celestia. ### Testing the fallback - - Testing out the Ethereum fallback mechanism can be done with the `go-da` tool. Triggering a simultaneous blob transaction will cause the `op-batcher` blob transaction to fail, with an `incorrect account sequence` error, which triggers a fallback to Ethereum. -To trigger the transaction, send this command from the same `go/proto/da` directory: - ```bash -grpcurl -proto da.proto -plaintext -d '{"blobs": [{"value": "SGVsbG8gd28ybGQh"}]}' 127.0.0.1:26650 da.DAService.Submit +curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" -d '{ "id": 1, "jsonrpc": "2.0", "method": "da.Submit", "params": [["SGVsbG8gd28ybGQh"], -1, "AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA="]}' http://127.0.0.1:26658 +``` + +Which should return: + +```bash +{"jsonrpc":"2.0","result":["9QEAAAAAAABmGvJUORYLqY8wVdjgp6/0oSh6brQqG3ZGr/cfUMuElg=="],"id":1} ``` -Alternatively, you can shut off the `local-celestia-devnet` and see that +Alternatively, you can shut off the light node and see that the OP Stack devnet logs show that the rollup has fallen back to the L1, in this case Ethereum, for posting data. From b8471710a84943f1a6e22445dc49c4d2c769ffed Mon Sep 17 00:00:00 2001 From: jcstein Date: Fri, 10 May 2024 13:20:29 -0400 Subject: [PATCH 12/18] docs: use mocha not mocha-4 for chainid in some places --- developers/intro-to-op-stack.md | 5 +---- developers/optimism.md | 12 ++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/developers/intro-to-op-stack.md b/developers/intro-to-op-stack.md index ea5ab2ab2c2..3c2a6630d07 100644 --- a/developers/intro-to-op-stack.md +++ b/developers/intro-to-op-stack.md @@ -26,7 +26,7 @@ allows rollup operators to reduce overhead that is associated with posting data as `calldata` on Ethereum. Instead, `op-batcher` batches up rollup blocks and posts them to Celestia's DA network. -The handling of data is accomplished in two ways. First, data is written +Data is managed in two ways. First, data is written to the data availability (DA) layer i.e. in this case Celestia, then the data commitment is written to the `op-batcher`. When reading `op-node` simply reads the data back from the DA layer by reading the @@ -63,9 +63,6 @@ with Celestia underneath, then how to start your own devnet with a modified version of `optimism-bedrock` that uses Celestia as a DA layer. -_Discover how to integrate existing blockchain frameworks -like the OP Stack with Celestia in this category._ - - [Bubs testnet](./bubs-testnet.md): learn about the first testnet made with OP Stack with Celestia underneath - [Deploy a smart contract on Bubs testnet](./deploy-on-bubs.md) diff --git a/developers/optimism.md b/developers/optimism.md index 8d6e73508fb..f8e8d784bc4 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -140,7 +140,7 @@ to provide a `--core.ip ` for the network you are using. da: image: ghcr.io/rollkit/local-celestia-devnet:v0.13.1 // [!code --] image: ghcr.io/celestiaorg/celestia-node:v0.13.2 // [!code ++] - command: celestia light start --p2p.network {{constants.mainnetChainId}} --core.ip rpc.celestia.pops.one --gateway// [!code ++] + command: celestia light start --p2p.network celestia --core.ip rpc.celestia.pops.one --gateway// [!code ++] ports: - "26658:26658" - "26659:26659" // [!code ++] @@ -148,7 +148,7 @@ da: - $HOME/.celestia-light/:/home/celestia/.celestia-light/ // [!code ++] environment: // [!code ++] NODE_TYPE: "light" // [!code ++] - P2P_NETWORK: "{{constants.mainnetChainId}}" // [!code ++] + P2P_NETWORK: "celestia" // [!code ++] user: root // [!code ++] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] @@ -162,7 +162,7 @@ da: da: image: ghcr.io/rollkit/local-celestia-devnet:v0.13.1 // [!code --] image: ghcr.io/celestiaorg/celestia-node:v0.13.2 // [!code ++] - command: celestia light start --p2p.network {{constants.mochaChainId}} --core.ip consensus-full-mocha-4.celestia-mocha.com --gateway// [!code ++] + command: celestia light start --p2p.network mocha --core.ip consensus-full-mocha-4.celestia-mocha.com --gateway// [!code ++] ports: - "26658:26658" - "26659:26659" // [!code ++] @@ -170,7 +170,7 @@ da: - $HOME/.celestia-light-{{constants.mochaChainId}}/:/home/celestia/.celestia-light-{{constants.mochaChainId}}/ // [!code ++] environment: // [!code ++] NODE_TYPE: "light" // [!code ++] - P2P_NETWORK: "{{constants.mochaChainId}}" // [!code ++] + P2P_NETWORK: "mocha" // [!code ++] user: root // [!code ++] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] @@ -184,7 +184,7 @@ da: da: image: ghcr.io/rollkit/local-celestia-devnet:v0.13.1 // [!code --] image: ghcr.io/celestiaorg/celestia-node:v0.13.2 // [!code ++] - command: celestia light start --p2p.network {{constants.arabicaChainId}} --core.ip validator-1.celestia-arabica-11.com --gateway// [!code ++] + command: celestia light start --p2p.network arabica --core.ip validator-1.celestia-arabica-11.com --gateway// [!code ++] ports: - "26658:26658" - "26659:26659" // [!code ++] @@ -192,7 +192,7 @@ da: - $HOME/.celestia-light-{{constants.arabicaChainId}}/:/home/celestia/.celestia-light-{{constants.arabicaChainId}}/ // [!code ++] environment: // [!code ++] NODE_TYPE: "light" // [!code ++] - P2P_NETWORK: "{{constants.arabicaChainId}}" // [!code ++] + P2P_NETWORK: "arabica" // [!code ++] user: root // [!code ++] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] From 4d985857f0ffcf7534e7be52103875cc7762ad18 Mon Sep 17 00:00:00 2001 From: jcstein Date: Fri, 17 May 2024 15:51:49 -0400 Subject: [PATCH 13/18] feat: update version --- developers/optimism.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developers/optimism.md b/developers/optimism.md index f8e8d784bc4..72e3964b1f3 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -39,8 +39,8 @@ Check out to the version for either the ::: code-group -```bash-vue [v1.2.0-OP_op-node/v1.7.5-CN_v0.13.2] -git checkout tags/v1.2.0-OP_op-node/v1.7.5-CN_v0.13.2 +```bash-vue [v1.3.0-OP_op-node/v1.7.5-CN_v0.13.2] +git checkout tags/v1.3.0-OP_op-node/v1.7.5-CN_v0.13.2 git submodule update --init --recursive ``` From 9283c9578df827610016708b63e52e440b542e3f Mon Sep 17 00:00:00 2001 From: jcstein Date: Fri, 17 May 2024 15:54:18 -0400 Subject: [PATCH 14/18] feat: update curl cmd --- developers/optimism.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developers/optimism.md b/developers/optimism.md index 72e3964b1f3..b4b01985cdc 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -359,7 +359,7 @@ Remember to remove the `0xce` prefix! ```bash -curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" -d '{ "id": 1, "jsonrpc": "2.0", "method": "da.Get", "params": [["3wAAAAAAAABmGvJUORYLqY8wVdjgp6/0oSh6brQqG3ZGr/cfUMuElg=="], "AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA="]}' http://127.0.0.1:26658 +curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" -d '{ "id": 1, "jsonrpc": "2.0", "method": "da.Get", "params": [["$ENCODED_INPUT"], "AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA="]}' http://127.0.0.1:26658 ``` Your result will look similar to the below! From b8681cd21f15cdb2ab311ac42ffe98de91bf05ff Mon Sep 17 00:00:00 2001 From: jcstein Date: Fri, 17 May 2024 15:56:57 -0400 Subject: [PATCH 15/18] feat: suggestions from code review --- developers/optimism.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developers/optimism.md b/developers/optimism.md index b4b01985cdc..054da881b7a 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -448,7 +448,7 @@ Celestia. ### Testing the fallback Testing out the Ethereum fallback mechanism can be done -with the `go-da` tool. Triggering a simultaneous blob transaction will +with a curl command. Triggering a simultaneous blob transaction will cause the `op-batcher` blob transaction to fail, with an `incorrect account sequence` error, which triggers a fallback to Ethereum. From a4678ab989aa8b2c1045798204d9b6aa86f47dea Mon Sep 17 00:00:00 2001 From: jcstein Date: Fri, 17 May 2024 15:58:26 -0400 Subject: [PATCH 16/18] feat: suggestions from code review --- developers/optimism.md | 1 - 1 file changed, 1 deletion(-) diff --git a/developers/optimism.md b/developers/optimism.md index 054da881b7a..7017729d9dc 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -160,7 +160,6 @@ da: ```yaml-vue [Mocha testnet] da: - image: ghcr.io/rollkit/local-celestia-devnet:v0.13.1 // [!code --] image: ghcr.io/celestiaorg/celestia-node:v0.13.2 // [!code ++] command: celestia light start --p2p.network mocha --core.ip consensus-full-mocha-4.celestia-mocha.com --gateway// [!code ++] ports: From 494ea96ac3ec06b8abf85a84d950e8d09961ec72 Mon Sep 17 00:00:00 2001 From: jcstein Date: Fri, 17 May 2024 16:00:06 -0400 Subject: [PATCH 17/18] feat: resolve conflicts --- ...s.md => blobstream-x-requesting-data-commitment-ranges.md} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename developers/{requesting-data-commitment-ranges.md => blobstream-x-requesting-data-commitment-ranges.md} (93%) diff --git a/developers/requesting-data-commitment-ranges.md b/developers/blobstream-x-requesting-data-commitment-ranges.md similarity index 93% rename from developers/requesting-data-commitment-ranges.md rename to developers/blobstream-x-requesting-data-commitment-ranges.md index 784ed557c41..3f4a1f1d67f 100644 --- a/developers/requesting-data-commitment-ranges.md +++ b/developers/blobstream-x-requesting-data-commitment-ranges.md @@ -39,7 +39,7 @@ Here are example values for the `.env` file: ## Local proving -[Run the Blobstream X operator with local proving](https://github.com/succinctlabs/blobstreamx?tab=readme-ov-file#local-proving--relaying). +To run the Blobstream X operator with local proving, follow this [guide](https://hackmd.io/@succinctlabs/HJE7XRrup). :::tip Note: Requires a large cloud machine to run in a reasonable @@ -60,4 +60,4 @@ and relayed by the Succinct platform. 2. A `DataCommitmentStored(uint256, uint64, uint64, bytes32)` will be emitted for the requested range when it is stored in the contract. Listen to this event to know that the proof has been - generated successfully. + generated successfully. \ No newline at end of file From d1a01f029afc07be11521f408c4e253cbeaccfe3 Mon Sep 17 00:00:00 2001 From: jcstein Date: Fri, 17 May 2024 16:01:42 -0400 Subject: [PATCH 18/18] docs: add params --- developers/optimism.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/developers/optimism.md b/developers/optimism.md index 7017729d9dc..b736fe3d9b3 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -361,6 +361,8 @@ Remember to remove the `0xce` prefix! curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" -d '{ "id": 1, "jsonrpc": "2.0", "method": "da.Get", "params": [["$ENCODED_INPUT"], "AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA="]}' http://127.0.0.1:26658 ``` +The params are `[]blobs, namespace`, base64-encoded. + Your result will look similar to the below! ```console