Skip to content

Commit ac46c64

Browse files
committed
da: use celestia as da
build(deps): update go-da to v0.1.0 build(deps): update go-da to v0.2.0; add ctx da: add cli flags for da config da: add get timeout to da client build(deps): bump local-celestia-devnet to v0.12.7 fix(cli): fix da rpc check fix(cli): check return err fix(da): blob data source reuse DataFromEVMTransactions da: upgrade to go-da v0.5.0 feat(op-batcher): support disable eth fallback chore(op-batcher): refactor EthFallbackDisabledFlagName da: use env auth token if set feat: enable multi frame txs and frame size setting for calldata txs chore: add log for multiframetxs setting da: try using blobdata for eth fallback da: add gas price flag (#451) da: reuse useblobs for multiframetxs (#452) Add Github CI (#472) Cleanup Github CI workflow (#478) feat: allow to toggle Celestia in op-batcher and op-node (#498) feat: add op-celestia indexer (#503) fix: init op-node client da: use celestia-node client (#504) da: fix batcher submit (#511) feat(op-celestia/indexer): add indexed l2 block status (#514) da: optionally support new tx client (#517) da: fix celestia config da: fix celestia enabled da: update celestia-node v0.26.4 da: log celestia config
1 parent 27f6f50 commit ac46c64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+6508
-389
lines changed

.github/workflows/docker.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Docker
2+
3+
env:
4+
FOUNDRY_PROFILE: ci
5+
DOCKER_BUILDKIT: 1
6+
REGISTRY: ghcr.io
7+
REPO: ${{ github.repository_owner }}
8+
9+
on:
10+
push:
11+
branches:
12+
- celestia-develop
13+
- test/github-actions
14+
pull_request:
15+
branches:
16+
- celestia-develop
17+
types: [opened, synchronize, reopened]
18+
workflow_dispatch:
19+
20+
jobs:
21+
docker-build:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
strategy:
27+
matrix:
28+
docker_name:
29+
- op-node
30+
- op-batcher
31+
- op-program
32+
- op-proposer
33+
- op-challenger
34+
- op-dispute-mon
35+
- op-conductor
36+
- da-server
37+
- op-supervisor
38+
- cannon
39+
- op-celestia-indexer
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
46+
- name: Login to GitHub Container Registry
47+
uses: docker/login-action@v3
48+
with:
49+
registry: ${{ env.REGISTRY }}
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
- name: Generate clean branch name
54+
id: clean_branch
55+
run: |
56+
# Replace invalid characters with dash
57+
CLEAN_BRANCH="$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9.]/-/g')"
58+
echo "name=${CLEAN_BRANCH}" >> "$GITHUB_OUTPUT"
59+
60+
- name: Set build environment
61+
run: |
62+
{
63+
echo "REGISTRY=${{ env.REGISTRY }}"
64+
echo "REPOSITORY=${{ env.REPO }}"
65+
echo "GIT_COMMIT=$(git rev-parse HEAD)"
66+
echo "GIT_DATE=$(git show -s --format='%ct')"
67+
echo "GIT_VERSION=untagged"
68+
echo "IMAGE_TAGS=${{ github.sha }},${{ steps.clean_branch.outputs.name }}"
69+
echo "PLATFORMS=linux/amd64"
70+
} >> "$GITHUB_ENV"
71+
72+
- name: Build Docker image
73+
run: |
74+
# Create buildx builder
75+
docker buildx create --driver=docker-container --name=buildx-build --bootstrap --use
76+
77+
# For PRs, use --load to make the image available locally
78+
# For pushes, use --push to publish to registry
79+
OUTPUT_ARG=""
80+
if [ "${{ github.event_name }}" = "pull_request" ]; then
81+
OUTPUT_ARG="--load"
82+
else
83+
OUTPUT_ARG="--push"
84+
fi
85+
86+
# Build using docker-bake.hcl
87+
docker buildx bake \
88+
--progress plain \
89+
--builder=buildx-build \
90+
-f docker-bake.hcl \
91+
"${OUTPUT_ARG}" \
92+
"${{ matrix.docker_name }}"
93+
94+
- name: Save Docker image
95+
if: github.event_name == 'pull_request'
96+
run: |
97+
CLEAN_TAG="${{ steps.clean_branch.outputs.name }}"
98+
IMAGE_NAME="${{ env.REGISTRY }}/${{ env.REPO }}/${{ matrix.docker_name }}:${CLEAN_TAG}"
99+
docker save "${IMAGE_NAME}" > "/tmp/${{ matrix.docker_name }}.tar"
100+
101+
- name: Upload Docker image
102+
if: github.event_name == 'pull_request'
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: docker-${{ matrix.docker_name }}
106+
path: /tmp/${{ matrix.docker_name }}.tar

.github/workflows/fork-sync.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Sync Fork
2+
3+
on:
4+
schedule:
5+
- cron: '*/30 * * * *' # every 30 minutes
6+
workflow_dispatch: # on button click
7+
8+
jobs:
9+
sync:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: tgymnich/[email protected]
15+
with:
16+
base: celestia-develop
17+
head: develop
18+
token: ${{ secrets.REPO_PAT }}

.github/workflows/validate.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Validate Workflows
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- celestia-develop
7+
paths:
8+
- ".github/workflows/**"
9+
10+
jobs:
11+
validate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Create actionlint config
17+
run: |
18+
echo "self-hosted-runner:
19+
# Add your custom runner labels here if needed
20+
labels:
21+
- ubuntu-latest
22+
- ubuntu-latest-16-cores" > .actionlint.yaml
23+
24+
- name: Validate workflows
25+
uses: docker://rhysd/actionlint:latest
26+
with:
27+
shellcheck: true
28+
fail-on-error: true

README.md

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
<br />
33
<br />
44
<a href="https://optimism.io"><img alt="Optimism" src="https://raw.githubusercontent.com/ethereum-optimism/brand-kit/main/assets/svg/OPTIMISM-R.svg" width=600></a>
5+
<h3><a href="https://optimism.io">Optimism</a> is a low-cost and lightning-fast Ethereum L2 blockchain, built with the OP Stack.</h3>
56
<br />
6-
<h3><a href="https://optimism.io">Optimism</a> is Ethereum, scaled.</h3>
7+
<h3>+</h3>
8+
<a href="https://celestia.org"><img alt="Celestia" src="docs/op-stack/src/assets/docs/understand/Celestia-logo-color-color.svg" width=600></a>
9+
<h3><a href="https://celestia.org">Celestia</a> is a modular data availability network that securely scales with the number of users, making it easy for anyone to launch their own blockchain.</h3>
710
<br />
811
</div>
912

@@ -29,8 +32,24 @@
2932
## What is Optimism?
3033

3134
[Optimism](https://www.optimism.io/) is a project dedicated to scaling Ethereum's technology and expanding its ability to coordinate people from across the world to build effective decentralized economies and governance systems. The [Optimism Collective](https://www.optimism.io/vision) builds open-source software that powers scalable blockchains and aims to address key governance and economic challenges in the wider Ethereum ecosystem. Optimism operates on the principle of **impact=profit**, the idea that individuals who positively impact the Collective should be proportionally rewarded with profit. **Change the incentives and you change the world.**
35+
If you're looking to run the OP Stack + Celestia setup for this repository, please visit the [Optimism & Celestia guides and tutorials](https://docs.celestia.org/developers/intro-to-op-stack/) to get started.
3236

3337
In this repository you'll find numerous core components of the OP Stack, the decentralized software stack maintained by the Optimism Collective that powers Optimism and forms the backbone of blockchains like [OP Mainnet](https://explorer.optimism.io/) and [Base](https://base.org). The OP Stack is designed to be aggressively open-source — you are welcome to explore, modify, and extend this code.
38+
The OP Stack powers Optimism, an Ethereum L2 blockchain, and forms the technical foundation for the [the Optimism Collective](https://app.optimism.io/announcement)—a group committed to the **impact=profit** principle. This principle rewards individuals for their positive contributions to the collective.
39+
40+
Optimism addresses critical coordination failures in the crypto ecosystem, such as funding public goods and infrastructure. The OP Stack focuses on creating a shared, open-source system for developing new L2 blockchains within the proposed Superchain ecosystem, promoting collaboration and preventing redundant efforts.
41+
42+
As Optimism evolves, the OP Stack will adapt, encompassing components ranging from blockchain infrastructure to governance systems. This software suite aims to simplify L2 blockchain creation while supporting the growth and development of the Optimism ecosystem.
43+
44+
## What is Celestia?
45+
46+
Celestia is a modular consensus and data network, built to enable anyone to easily deploy their own blockchain with minimal overhead.
47+
48+
Celestia is a minimal blockchain that only orders and publishes transactions and does not execute them. By decoupling the consensus and application execution layers, Celestia modularizes the blockchain technology stack and unlocks new possibilities for decentralized application builders. Lean more at [Celestia.org](https://celestia.org).
49+
50+
## Maintenance
51+
52+
The maintenance guide for this repository can be found in the Wiki tab of the repository or [here](https://github.com/celestiaorg/optimism/wiki).
3453

3554
## Documentation
3655

@@ -40,6 +59,22 @@ In this repository you'll find numerous core components of the OP Stack, the dec
4059
## Specification
4160

4261
Detailed specifications for the OP Stack can be found within the [OP Stack Specs](https://github.com/ethereum-optimism/specs) repository.
62+
If you're interested in the technical details of how Optimism works, refer to the [Optimism Protocol Specification](https://github.com/ethereum-optimism/specs).
63+
If you want to build on top of Celestia, take a look at the documentation at [docs.celestia.org](https://docs.celestia.org).
64+
65+
If you want to learn more about the OP Stack, check out the documentation at [stack.optimism.io](https://stack.optimism.io/).
66+
67+
## Community
68+
69+
### Optimism
70+
71+
General discussion happens most frequently on the [Optimism discord](https://discord.gg/optimism).
72+
Governance discussion can also be found on the [Optimism Governance Forum](https://gov.optimism.io/).
73+
74+
### Celestia
75+
76+
General discussion happens most frequently on the [Celestia discord](https://discord.com/invite/YsnTPcSfWQ).
77+
Other discussions can be found on the [Celestia forum](https://forum.celestia.org).
4378

4479
## Community
4580

@@ -54,11 +89,64 @@ The OP Stack is a collaborative project. By collaborating on free, open software
5489

5590
[Good First Issues](https://github.com/ethereum-optimism/optimism/issues?q=is:open+is:issue+label:D-good-first-issue) are a great place to look for tasks to tackle if you're not sure where to start, and see [CONTRIBUTING.md](./CONTRIBUTING.md) for info on larger projects.
5691

57-
## Security Policy and Vulnerability Reporting
92+
## e2e testing
5893

5994
Please refer to the canonical [Security Policy](https://github.com/ethereum-optimism/.github/blob/master/SECURITY.md) document for detailed information about how to report vulnerabilities in this codebase.
6095
Bounty hunters are encouraged to check out the [Optimism Immunefi bug bounty program](https://immunefi.com/bounty/optimism/).
6196
The Optimism Immunefi program offers up to $2,000,042 for in-scope critical vulnerabilities.
97+
This repository has updated end-to-end tests in the `op-e2e` package to work with
98+
Celestia as the data availability (DA) layer.
99+
100+
Currently, the tests assume a working [Celestia devnet](https://github.com/rollkit/local-celestia-devnet) running locally:
101+
102+
```sh
103+
CELESTIA_DEVNET_CONTAINER_ID=$(docker run -d -p 26658:26658 ghcr.io/rollkit/local-celestia-devnet:v0.13.1)
104+
echo "$CELESTIA_DEVNET_CONTAINER_ID"
105+
```
106+
107+
To communicate with the Celestia node, we need to prepare an authentication token and a namespace:
108+
109+
```sh
110+
export OP_E2E_DA_AUTH_TOKEN=$(docker exec "$CELESTIA_DEVNET_CONTAINER_ID" celestia bridge auth admin --node.store "~/bridge")
111+
echo "$OP_E2E_DA_AUTH_TOKEN"
112+
113+
export OP_E2E_DA_NAMESPACE="00000000000000000000000000000000000000$(head -c 10 /dev/urandom | xxd -p -c 10)"
114+
echo "$OP_E2E_DA_NAMESPACE"
115+
116+
export OP_E2E_DA_ENABLED='true'
117+
export OP_E2E_DA_RPC='http://localhost:26658'
118+
export OP_E2E_DA_FALLBACK_MODE='calldata'
119+
```
120+
121+
The e2e tests can be triggered with:
122+
123+
```sh
124+
cd $HOME/optimism
125+
cd op-e2e
126+
export OP_E2E_DISABLE_PARALLEL='true'
127+
export OP_E2E_CANNON_ENABLED='false'
128+
make test
129+
```
130+
131+
## Bridging
132+
133+
If you have the OP Stack + Celestia setup running, you can test out bridging from the L1
134+
to the L2.
135+
136+
To do this, first navigate to the `packages/contracts-bedrock` directory and create a
137+
`.env` file with the following contents:
138+
139+
```bash
140+
L1_PROVIDER_URL=http://localhost:8545
141+
L2_PROVIDER_URL=http://localhost:9545
142+
PRIVATE_KEY=bf7604d9d3a1c7748642b1b7b05c2bd219c9faa91458b370f85e5a40f3b03af7
143+
```
144+
145+
Then, run the following from the same directory:
146+
147+
```bash
148+
npx hardhat deposit --network devnetL1 --l1-provider-url http://localhost:8545 --l2-provider-url http://localhost:9545 --amount-eth <AMOUNT> --to <ADDRESS>
149+
```
62150

63151
## Directory Structure
64152

docker-bake.hcl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ variable "OP_INTEROP_MON_VERSION" {
9797
default = "${GIT_VERSION}"
9898
}
9999

100+
variable "OP_CELESTIA_INDEXER_VERSION" {
101+
default = "${GIT_VERSION}"
102+
}
103+
100104

101105
target "op-node" {
102106
dockerfile = "ops/docker/op-stack-go/Dockerfile"
@@ -304,3 +308,15 @@ target "op-interop-mon" {
304308
platforms = split(",", PLATFORMS)
305309
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-interop-mon:${tag}"]
306310
}
311+
312+
target "op-celestia-indexer" {
313+
dockerfile = "ops/docker/op-stack-go/Dockerfile"
314+
context = "."
315+
args = {
316+
GIT_COMMIT = "${GIT_COMMIT}"
317+
GIT_DATE = "${GIT_DATE}"
318+
OP_CELESTIA_INDEXER_VERSION = "${OP_CELESTIA_INDEXER_VERSION}"
319+
}
320+
platforms = split(",", PLATFORMS)
321+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-celestia-indexer:${tag}"]
322+
}
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)