Skip to content

Commit 380fd31

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)
1 parent a2864db commit 380fd31

File tree

29 files changed

+1053
-41
lines changed

29 files changed

+1053
-41
lines changed

.github/workflows/cannon.yml

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
name: Cannon Tests
2+
3+
env:
4+
FOUNDRY_PROFILE: ci
5+
OP_E2E_CANNON_ENABLED: "false"
6+
7+
on:
8+
push:
9+
branches: [celestia-develop]
10+
pull_request:
11+
branches: [celestia-develop]
12+
workflow_dispatch:
13+
14+
jobs:
15+
contracts-build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
# Debug step to check directory structure
21+
- name: Debug directory structure
22+
run: |
23+
echo "Current directory: $(pwd)"
24+
echo "Directory contents:"
25+
ls -la
26+
echo "Checking for packages directory:"
27+
ls -la packages || echo "No packages directory"
28+
29+
# Install just command
30+
- name: Install just
31+
run: |
32+
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to "$HOME/.local/bin"
33+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
34+
35+
# Install Node.js without npm cache initially
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: "18"
40+
41+
- name: Install npm dependencies
42+
run: |
43+
if [ ! -d "packages/contracts-bedrock" ]; then
44+
echo "contracts-bedrock directory not found. Creating it..."
45+
mkdir -p packages/contracts-bedrock
46+
fi
47+
cd packages/contracts-bedrock
48+
49+
# Initialize package.json if it doesn't exist
50+
if [ ! -f "package.json" ]; then
51+
echo "Creating package.json..."
52+
echo '{
53+
"name": "contracts-bedrock",
54+
"version": "1.0.0",
55+
"private": true,
56+
"description": "Optimism Bedrock smart contracts",
57+
"scripts": {
58+
"test": "echo \"Error: no test specified\" && exit 1"
59+
}
60+
}' > package.json
61+
fi
62+
63+
# List contents after setup
64+
echo "Directory contents after setup:"
65+
ls -la
66+
67+
npm install
68+
69+
- name: Install Foundry
70+
uses: foundry-rs/foundry-toolchain@v1
71+
72+
- name: Install contract dependencies
73+
working-directory: packages/contracts-bedrock
74+
run: just install
75+
76+
- name: Pull artifacts
77+
working-directory: packages/contracts-bedrock
78+
run: bash scripts/ops/pull-artifacts.sh
79+
80+
- name: Build contracts
81+
working-directory: packages/contracts-bedrock
82+
run: forge build --deny-warnings
83+
84+
- name: Upload contract artifacts
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: contract-artifacts
88+
path: |
89+
packages/contracts-bedrock/artifacts
90+
packages/contracts-bedrock/forge-artifacts
91+
packages/contracts-bedrock/cache
92+
93+
cannon-prestate:
94+
needs: [contracts-build]
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Create contract artifact directories
100+
run: |
101+
mkdir -p packages/contracts-bedrock/{artifacts,forge-artifacts,cache}
102+
103+
- name: Download contract artifacts
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: contract-artifacts
107+
path: packages/contracts-bedrock
108+
109+
- name: Build cannon
110+
run: make cannon
111+
112+
- name: Build op-program
113+
run: make op-program
114+
115+
- name: Create prestate directories
116+
run: mkdir -p op-program/bin
117+
118+
- name: Cache cannon prestate
119+
id: cache-prestate
120+
uses: actions/cache@v4
121+
with:
122+
path: |
123+
op-program/bin/prestate.bin.gz
124+
op-program/bin/meta.json
125+
op-program/bin/prestate-proof.json
126+
key: cannon-prestate-${{ hashFiles('cannon/bin/cannon') }}-${{ hashFiles('op-program/bin/op-program-client.elf') }}
127+
128+
- name: Sanitize op-program guest
129+
run: make -f cannon/Makefile sanitize-program GUEST_PROGRAM=op-program/bin/op-program-client.elf
130+
131+
- name: Generate cannon prestate
132+
if: steps.cache-prestate.outputs.cache-hit != 'true'
133+
run: make cannon-prestate
134+
135+
- name: Generate cannon-mt prestate
136+
run: make cannon-prestate-mt
137+
138+
- name: Upload prestate artifacts
139+
uses: actions/upload-artifact@v4
140+
with:
141+
name: prestate-artifacts
142+
path: |
143+
op-program/bin/prestate.bin.gz
144+
op-program/bin/meta.json
145+
op-program/bin/prestate-proof.json
146+
147+
cannon-go-test:
148+
needs: [contracts-build]
149+
runs-on: ubuntu-latest
150+
steps:
151+
- uses: actions/checkout@v4
152+
153+
- name: Create contract artifact directories
154+
run: |
155+
mkdir -p packages/contracts-bedrock/{artifacts,forge-artifacts,cache}
156+
157+
- name: Download contract artifacts
158+
uses: actions/download-artifact@v4
159+
with:
160+
name: contract-artifacts
161+
path: packages/contracts-bedrock
162+
163+
- name: Set up Go
164+
uses: actions/setup-go@v5
165+
with:
166+
go-version: "1.21"
167+
168+
- name: Build example binaries
169+
working-directory: cannon/testdata/example
170+
run: make elf
171+
172+
- name: Run Go lint
173+
working-directory: cannon
174+
run: make lint
175+
176+
- name: Create test results directory
177+
run: |
178+
mkdir -p tmp/test-results
179+
mkdir -p tmp/testlogs
180+
181+
- name: Run tests
182+
working-directory: cannon
183+
run: |
184+
go install gotest.tools/gotestsum@latest
185+
gotestsum --format=testname --junitfile=../tmp/test-results/cannon.xml --jsonfile=../tmp/testlogs/log.json \
186+
-- -parallel="$(nproc)" -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage.out ./...
187+
188+
- name: Upload coverage
189+
uses: codecov/codecov-action@v4
190+
with:
191+
files: ./cannon/coverage.out
192+
flags: cannon-go-tests
193+
194+
- name: Upload test results
195+
uses: actions/upload-artifact@v4
196+
with:
197+
name: test-results
198+
path: |
199+
tmp/test-results
200+
tmp/testlogs
201+
202+
# op-e2e-cannon-tests:
203+
# needs: [contracts-build, cannon-prestate]
204+
# runs-on: ubuntu-latest
205+
# steps:
206+
# - uses: actions/checkout@v4
207+
208+
# - name: Install Foundry
209+
# uses: foundry-rs/foundry-toolchain@v1
210+
211+
# - name: Create directories
212+
# run: |
213+
# mkdir -p packages/contracts-bedrock/{artifacts,forge-artifacts,cache}
214+
# mkdir -p op-program/bin
215+
216+
# - name: Download contract artifacts
217+
# uses: actions/download-artifact@v4
218+
# with:
219+
# name: contract-artifacts
220+
# path: packages/contracts-bedrock
221+
222+
# - name: Download prestate artifacts
223+
# uses: actions/download-artifact@v4
224+
# with:
225+
# name: prestate-artifacts
226+
# path: op-program/bin
227+
228+
# # Add Go installation since op-e2e tests are in Go
229+
# - name: Set up Go
230+
# uses: actions/setup-go@v5
231+
# with:
232+
# go-version: "1.21"
233+
234+
# # Install any required Go dependencies
235+
# - name: Install Go dependencies
236+
# run: |
237+
# go mod download
238+
239+
# # Debug step to verify forge installation and environment
240+
# - name: Debug environment
241+
# run: |
242+
# echo "Foundry version:"
243+
# forge --version
244+
# echo "Go version:"
245+
# go version
246+
# echo "Directory structure:"
247+
# ls -R packages/contracts-bedrock/
248+
# ls -R op-program/bin/
249+
250+
# - name: Run cannon tests
251+
# working-directory: op-e2e
252+
# run: |
253+
# make test-cannon

.github/workflows/ci.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: CI
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+
- proofs-tools
35+
- op-dispute-mon
36+
- op-conductor
37+
- da-server
38+
- op-supervisor
39+
- cannon
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

0 commit comments

Comments
 (0)