diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 98531c75de2..af13b1ff2e4 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -608,6 +608,10 @@ function sidebarHome() { text: "Caldera", link: "https://caldera.xyz/", }, + { + text: "Conduit", + link: "https://conduit.xyz/", + } ], }, diff --git a/developers/ethereum-fallback.md b/developers/ethereum-fallback.md index 3dd443ca2a2..99511602c03 100644 --- a/developers/ethereum-fallback.md +++ b/developers/ethereum-fallback.md @@ -10,14 +10,12 @@ prev: # Ethereum fallback -Ethereum fallback is -[a fallback mechanism](https://github.com/celestiaorg/optimism/pull/266) +Ethereum fallback is a mechanism that enables Ethereum L2s (or L3s) to “fall back” to using Ethereum calldata for data availability in the event of downtime on Celestia Mainnet Beta. This feature is currently supported by Celestia integrations with: -- [OP Stack](./optimism-devnet.md#ethereum-fallback-mechanism-in-op-stack) - [Arbitrum Nitro](./arbitrum-integration.md#ethereum-fallback-mechanism-in-nitro) In the case of Celestia downtime or temporary unavailability, L2s can diff --git a/developers/optimism-devnet.md b/developers/optimism-devnet.md index 1baa0ffeaaf..ddbe0c28c0c 100644 --- a/developers/optimism-devnet.md +++ b/developers/optimism-devnet.md @@ -1,3 +1,121 @@ -# Optimism devnet +# Optimism devnet deep dive -This page has moved to [developers/optimism](./optimism.md). +This page is for those interested in doing a deep dive +on their pre-`op-plasma-celestia` `@celestiaorg/optimism` +rollups. + +## 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 + + + +```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": [["$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 +{"jsonrpc":"2.0","result":["SGVsbG8gd28ybGQh"],"id":1} +``` + +## 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`. \ No newline at end of file diff --git a/developers/optimism.md b/developers/optimism.md index b1b0e84acdf..28c2b1c12ce 100644 --- a/developers/optimism.md +++ b/developers/optimism.md @@ -1,483 +1,112 @@ --- -description: Start your own devnet with a modified version of optimism-bedrock. +description: Start your own rollup with op-plasma-celestia and roll-op. next: text: "Ethereum fallback mechanism" link: "/developers/ethereum-fallback" --- -# Run an OP Stack devnet posting Celestia +# Run an OP Stack rollup with Celestia underneath -This guide will show you how to run your own OP Stack devnet locally that posts to a Celestia network. +This guide will show you how to run your own OP Stack devnet and testnet that posts data to Celestia's Mocha testnet using [roll-op](https://github.com/celestiaorg/roll-op) and [op-plasma-celestia](https://github.com/celestiaorg/op-plasma-celestia). -If you'd like to use a Rollups as a Service (RaaS) provider, you can visit the RaaS category in the menu. +If you don't have devops experience and would like to use a Rollups as a Service (RaaS) provider, see the RaaS category in the menu. ## Dependency setup -### Environment setup +- [celestia-node](../nodes/celestia-node.md) +- [roll-op](https://github.com/celestiaorg/roll-op?tab=readme-ov-file#prerequisites) -First, [install dependencies for Celestia software](../nodes/environment.md) -and for [OP Stack](https://community.optimism.io/docs/developers/build/dev-node/). +### Setting up your light node -### Clone repository +Sync and fund a Celestia light node. The light node must be **fully synced** and **funded** for you to be able to submit and retrieve `PayForBlobs` to Mocha Testnet. This allows your rollup to post and retrieve data without any errors. -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.3.0-OP_op-node/v1.7.7-rc.1-CN_v0.13.2] -git checkout tags/v1.3.0-OP_op-node/v1.7.7-rc.1-CN_v0.13.2 -git submodule update --init --recursive -``` - -```bash-vue [celestia-develop] -git checkout celestia-develop -git submodule update --init --recursive -``` - -::: - -## Build devnet - -Build TypeScript definitions for TS dependencies: - -```bash -make -``` - -Set environment variables to start network: - -```bash -export SEQUENCER_BATCH_INBOX_ADDRESS=0xff00000000000000000000000000000000000000 -export L2OO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 -``` - -## 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` -to `false` in: +In order to mount existing data, you must have a node store that is in the default directory: ::: code-group -```bash-vue [Mainnet Beta] -$HOME/.celestia-light/config.toml -``` - ```bash-vue [Mocha] -$HOME/.celestia-light-{{constants.mochaChainId}}/config.toml -``` - -```bash-vue [Arabica] -$HOME/.celestia-light-{{constants.arabicaChainId}}/config.toml +$HOME/.celestia-light-{{constants.mochaChainId}} ``` -::: - -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. -Visit the [Arabica](../nodes/arabica-devnet.md) -or [Mocha](../nodes/mocha-testnet.md) pages to -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 the default directory: - -::: code-group - ```bash-vue [Mainnet Beta] $HOME/.celestia-light ``` -```bash-vue [Mocha] -$HOME/.celestia-light-{{constants.mochaChainId}} -``` - ```bash-vue [Arabica] $HOME/.celestia-light-{{constants.arabicaChainId}} ``` ::: -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. - -### Docker changes - -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 ` for the network you are using. - - - -::: code-group - -```yaml-vue [Mainnet Beta] -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 celestia --core.ip rpc.celestia.pops.one --gateway// [!code ++] - ports: - - "26658:26658" - - "26659:26659" // [!code ++] - volumes: // [!code ++] - - $HOME/.celestia-light/:/home/celestia/.celestia-light/ // [!code ++] - environment: // [!code ++] - NODE_TYPE: "light" // [!code ++] - P2P_NETWORK: "celestia" // [!code ++] - user: root // [!code ++] - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] - interval: 10s - timeout: 5s - retries: 5 - start_period: 30s -``` - -```yaml-vue [Mocha testnet] -da: - 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: - - "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: "mocha" // [!code ++] - user: root // [!code ++] - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] - interval: 10s - timeout: 5s - retries: 5 - start_period: 30s -``` - -```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 arabica --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: "arabica" // [!code ++] - user: root // [!code ++] - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"] - interval: 10s - timeout: 5s - retries: 5 - start_period: 30s -``` +By default, the node will run with the account named `my_celes_key` on Mocha. This is the account that needs to be funded. +::: tip +Unless you changed your configuration, you won't have to change anything. 😎 ::: -### Set your Celestia node auth token - -::: code-group +## Deploying a devnet to Mocha -```bash-vue [Mainnet Beta] -export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin) -``` +See [the Alt-DA x Celestia README](https://github.com/celestiaorg/op-plasma-celestia/blob/main/README.md) for instructions on [how to deploy a Devnet](https://github.com/celestiaorg/op-plasma-celestia/blob/main/README.md#devnet). -```bash-vue [Mocha testnet] -export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin --p2p.network mocha) -``` +:::tip TIP for macOS users +If you are on macOS, you will need to run a `venv` before starting `roll-op`. -```bash-vue [Arabica devnet] -export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin --p2p.network arabica) +```sh +cd $HOME/roll-op +python3 -m venv ./venv +source ./venv/bin/activate ``` ::: -Now you're ready to start your 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`). - -### 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: - -```bash -make devnet-logs -``` - -### Optional: Stop devnet - -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 -``` - -Then clean out the old config: - -```bash -make devnet-clean -``` - -## Deploying to an L1 (or L2) - -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 +Congrats! Your devnet is running on a mock EVM chain and Celestia Mocha. -Now, we'll check for a recent transaction on the L1 with: +## Deploying a testnet to to an L1 (or L2) and Mocha -```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) -``` +See [the Alt-DA x Celestia README](https://github.com/celestiaorg/op-plasma-celestia/blob/main/README.md) for instructions on [how to deploy a Testnet](https://github.com/celestiaorg/op-plasma-celestia/blob/main/README.md#testnet). :::tip -Remember to remove the `0xce` prefix! +If you are using a public RPC for your EVM chain, you should to enable `deploy_slowly = true` in your `config.toml`. If you still have issues, we recommend running the +integration with a high-availability, paid endpoint. ::: -## Find the data on Celestia +When you are deploying to a live EVM network, pay attention and modify the configuration to post to non-Sepolia EVM chains. - +Here is an example: -```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": [["$ENCODED_INPUT"], "AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA="]}' http://127.0.0.1:26658 -``` +```toml +# Chain ID of your rollup +l2_chain_id = 1117733 -The params are `[]blobs, namespace`, base64-encoded. +# Sepolia Ethereum +l1_chain_id = 11155111 +l1_rpc_url = "https://ethereum-sepolia-rpc.publicnode.com" -Your result will look similar to the below! +## Avoid issues with public RPC +deploy_slowly = true -```console -{"jsonrpc":"2.0","result":["SGVsbG8gd28ybGQh"],"id":1} +## Keys +contract_deployer_account = "0xaddress" +contract_deployer_key = "privatekey" +batcher_account = "0xaddress" +batcher_key = "privatekey" +proposer_account = "0xaddress" +proposer_key = "privatekey" +admin_account = "0xaddress" +admin_key = "privatekey" +p2p_sequencer_account = "0xaddress" +p2p_sequencer_key = "privatekey" ``` -## 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 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. - - - -```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.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 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. +Your `0xaddress` key must also be funded with testnet ETH. We recommend at least 10 SepoliaETH to get your chain started, but you will need more to keep it running longer. -## Span batches +## Congratulations -Span batches can be enabled by setting `OP_BATCHER_BATCH_TYPE: 1` -in your `docker-compose.yml` file. +Congrats! You now have an OP Stack rollup running with Celestia underneath. -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`. +You can [learn more about Alt-DA in Optimism docs](https://docs.optimism.io/builders/chain-operators/features/alt-da-mode#setup-your-da-server).