Skip to content

Commit 2ae5724

Browse files
shenkeyaoQuentinIAyiga
authored
IA1.2.10 Update docker for OP proposer (#209)
* Working devnet * Update dockers for l1 services * Fix op-proposer * Fix node js script * Remove npm from script * Install foundry * Add op-deployer path * Install dasel * Fix reshape-allocs script * Continue fixing reshape-allocs script * Continue fixing reshape-allocs script * Convert branch name * Undo branch name change * Fix typo * Fix dockerfile for l1-genesis * Update dockerfile for op-geth * More conflicts * More conflicts * Fix l2-genesis * Fix context path * Fix deployer for terraform * Fix path * More fixes and rebuild * Add preparation scripts to l2 CI * Fix l1 rpc path * Move l2-rollup command to dockerfile * Add config path in docker for op-node * Add preparation steps to op-node CI * Add l2-config to CI * Force jwt * Remove newline * Add image for batcher * Add CI for batcher * Restore servcie order * Add image for proposer * Copy deployer dir * Add game address fix * Combine duplicate image scripts * Update to v4 * Restore login verison * Fix deployment artifacts * Add dependency * Add file path * Fix file copy * UPdate init * Update GAME_FACTORY to use proxy dispute game factory address * Fix incorrect path string in GAME_FACTORY settings * Add Espresso contract configs to prepare-allocs The prepare-allocs.sh script doesn't currently have the Espresso Smart Contracts enabled. This change enables the contract and sets the preApprovedBatcherKey to work in a non-TEE environment. * Modify game-type for op-proposer The default game type when the `game-type` parameter is unspecified is `0`. By default there does not seem to be a `Dispute Game` deployed for `game-type` `0`, however, other game types do exist, including `game-type` `1`. This change sets the `game-type` of the `op-proposer` to `1` for the `docker-compose.yml` file. * Specify a `create2Salt` value for espresso deployment When the `op-deployer` performs the `apply` operation, it utilizes the values in the `state.json` file to inform how it should behave. Namely among these is the `create2Salt` value. The `op-deployer` utilizes the `create2` method for performing deployments according to specifications. This salt value is utilized and helps to assist in determining the resulting contract addresses. For convenience, it would be nice to have some deterministic values to test against for repeatability. This change modifies the `state.json` file before running `op-deployer` `apply` in order to ensure that we can see deterministic contract address generation. * Add dependency * Copy deployment artifacts * Add scripts for demo and documentation * Fix syntax * Remove another COPY * Add exposed ports for more nodes in docker-compose The `verifier`, `caff-node`, and `sequencer` all do not have their ports forwarded to the host machine. Having these ports exposed can make testing / debugging easier by utilizing the optimism RPC API. This change exposes these ports. * Fix CAFF environment variables The CAFF environment variables utilized in the `docker-compose.yml` need to have a prefix of `OP_NODE_`, otherwise they will not apply. These not applying causes the `caff-node` to never make progress. This change corrects the misconfigured `caff-node` environment variables, and cleans up an unnecessary one. * Set `caff.node` to `true` for `caff-node` The `caff-node` is meant to be running a derivation based on information retrieved from Espresso's network. However, it needs to be enabled to do so. This change enables the `caff-node`'s mode by explicitly setting `caff.node` to `true` in the launch configuration. * Support alias and input check * Undo changes to fix the build and make progress * Fix CI * Remove commented-out code --------- Co-authored-by: Artemii Gerasimovich <[email protected]> Co-authored-by: Theodore Schnepper <[email protected]>
1 parent 2c02767 commit 2ae5724

File tree

7 files changed

+184
-189
lines changed

7 files changed

+184
-189
lines changed

.github/workflows/docker-images.yml

Lines changed: 112 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ env:
1919
IMAGE_PREFIX: ghcr.io/${{ github.repository }}
2020

2121
jobs:
22-
build-l1-geth:
22+
prepare-deployment:
2323
runs-on: ubuntu-latest
24-
permissions:
25-
contents: read
26-
packages: write
24+
outputs:
25+
deployment-hash: ${{ steps.hash.outputs.hash }}
2726
steps:
2827
- name: Checkout
2928
uses: actions/checkout@v4
@@ -37,7 +36,7 @@ jobs:
3736
toolchain: stable
3837
override: true
3938

40-
- name: Setup Node.js
39+
- name: Install Node.js
4140
uses: actions/setup-node@v4
4241
with:
4342
node-version: 20.x
@@ -68,6 +67,44 @@ jobs:
6867
cd espresso
6968
./scripts/prepare-allocs.sh
7069
70+
- name: List generated files
71+
run: |
72+
echo "=== Generated deployment files ==="
73+
find espresso/deployment -type f -name "*.json" -o -name "*.toml" | head -20
74+
echo "=== L1 Config ==="
75+
ls -la espresso/deployment/l1-config/ || echo "No l1-config directory"
76+
echo "=== Deployer ==="
77+
ls -la espresso/deployment/deployer/ || echo "No deployer directory"
78+
79+
- name: Generate deployment hash
80+
id: hash
81+
run: echo "hash=$(date +%s)" >> $GITHUB_OUTPUT
82+
83+
- name: Upload deployment artifacts
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: deployment-artifacts
87+
path: |
88+
op-deployer/bin/
89+
espresso/deployment/
90+
packages/contracts-bedrock/
91+
retention-days: 1
92+
93+
build-l1-geth:
94+
needs: prepare-deployment
95+
runs-on: ubuntu-latest
96+
permissions:
97+
contents: read
98+
packages: write
99+
steps:
100+
- name: Checkout
101+
uses: actions/checkout@v4
102+
103+
- name: Download deployment artifacts
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: deployment-artifacts
107+
71108
- name: Login to GitHub Container Registry
72109
uses: docker/login-action@v3
73110
with:
@@ -98,6 +135,7 @@ jobs:
98135
labels: ${{ steps.meta.outputs.labels }}
99136

100137
build-op-geth:
138+
needs: prepare-deployment
101139
runs-on: ubuntu-latest
102140
permissions:
103141
contents: read
@@ -106,59 +144,10 @@ jobs:
106144
- name: Checkout
107145
uses: actions/checkout@v4
108146

109-
- name: Install just
110-
uses: extractions/setup-just@v2
111-
112-
- name: Install Rust
113-
uses: actions-rs/toolchain@v1
147+
- name: Download deployment artifacts
148+
uses: actions/download-artifact@v4
114149
with:
115-
toolchain: stable
116-
override: true
117-
118-
- name: Install Foundry
119-
uses: foundry-rs/foundry-toolchain@v1
120-
with:
121-
version: nightly
122-
123-
- name: Install dasel
124-
run: |
125-
curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
126-
sudo mv /tmp/dasel /usr/local/bin/dasel
127-
sudo chmod +x /usr/local/bin/dasel
128-
129-
- name: Check for package.json
130-
id: check-package
131-
run: |
132-
if [ -f "package.json" ]; then
133-
echo "has-package=true" >> $GITHUB_OUTPUT
134-
else
135-
echo "has-package=false" >> $GITHUB_OUTPUT
136-
fi
137-
138-
- name: Setup Node.js
139-
if: steps.check-package.outputs.has-package == 'true'
140-
uses: actions/setup-node@v4
141-
with:
142-
node-version: '18'
143-
cache: 'npm'
144-
145-
- name: Install dependencies
146-
if: steps.check-package.outputs.has-package == 'true'
147-
run: npm ci
148-
149-
- name: Build op-deployer
150-
run: |
151-
cd op-deployer
152-
just
153-
echo "$(pwd)/bin" >> $GITHUB_PATH
154-
155-
- name: Compile contracts
156-
run: just compile-contracts
157-
158-
- name: Prepare allocations
159-
run: |
160-
cd espresso
161-
./scripts/prepare-allocs.sh
150+
name: deployment-artifacts
162151

163152
- name: Login to GitHub Container Registry
164153
uses: docker/login-action@v3
@@ -190,6 +179,7 @@ jobs:
190179
labels: ${{ steps.meta.outputs.labels }}
191180

192181
build-op-node:
182+
needs: prepare-deployment
193183
runs-on: ubuntu-latest
194184
permissions:
195185
contents: read
@@ -198,59 +188,10 @@ jobs:
198188
- name: Checkout
199189
uses: actions/checkout@v4
200190

201-
- name: Install just
202-
uses: extractions/setup-just@v2
203-
204-
- name: Install Rust
205-
uses: actions-rs/toolchain@v1
206-
with:
207-
toolchain: stable
208-
override: true
209-
210-
- name: Install Foundry
211-
uses: foundry-rs/foundry-toolchain@v1
191+
- name: Download deployment artifacts
192+
uses: actions/download-artifact@v4
212193
with:
213-
version: nightly
214-
215-
- name: Install dasel
216-
run: |
217-
curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
218-
sudo mv /tmp/dasel /usr/local/bin/dasel
219-
sudo chmod +x /usr/local/bin/dasel
220-
221-
- name: Check for package.json
222-
id: check-package
223-
run: |
224-
if [ -f "package.json" ]; then
225-
echo "has-package=true" >> $GITHUB_OUTPUT
226-
else
227-
echo "has-package=false" >> $GITHUB_OUTPUT
228-
fi
229-
230-
- name: Setup Node.js
231-
if: steps.check-package.outputs.has-package == 'true'
232-
uses: actions/setup-node@v4
233-
with:
234-
node-version: '18'
235-
cache: 'npm'
236-
237-
- name: Install dependencies
238-
if: steps.check-package.outputs.has-package == 'true'
239-
run: npm ci
240-
241-
- name: Build op-deployer
242-
run: |
243-
cd op-deployer
244-
just
245-
echo "$(pwd)/bin" >> $GITHUB_PATH
246-
247-
- name: Compile contracts
248-
run: just compile-contracts
249-
250-
- name: Prepare allocations
251-
run: |
252-
cd espresso
253-
./scripts/prepare-allocs.sh
194+
name: deployment-artifacts
254195

255196
- name: Create l2-config directory
256197
run: |
@@ -293,6 +234,7 @@ jobs:
293234
TARGETARCH=amd64
294235
295236
build-op-batcher:
237+
needs: prepare-deployment
296238
runs-on: ubuntu-latest
297239
permissions:
298240
contents: read
@@ -301,65 +243,77 @@ jobs:
301243
- name: Checkout
302244
uses: actions/checkout@v4
303245

304-
- name: Install just
305-
uses: extractions/setup-just@v2
306-
307-
- name: Install Rust
308-
uses: actions-rs/toolchain@v1
309-
with:
310-
toolchain: stable
311-
override: true
312-
313-
- name: Install Foundry
314-
uses: foundry-rs/foundry-toolchain@v1
246+
- name: Download deployment artifacts
247+
uses: actions/download-artifact@v4
315248
with:
316-
version: nightly
249+
name: deployment-artifacts
317250

318-
- name: Install dasel
251+
- name: Copy config for op-batcher
319252
run: |
320-
curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
321-
sudo mv /tmp/dasel /usr/local/bin/dasel
322-
sudo chmod +x /usr/local/bin/dasel
253+
mkdir -p packages/contracts-bedrock/lib/superchain-registry/ops/testdata/monorepo
254+
# Copy any required config files here, or create placeholder
255+
echo "Config prepared for op-batcher"
323256
324-
- name: Check for package.json
325-
id: check-package
326-
run: |
327-
if [ -f "package.json" ]; then
328-
echo "has-package=true" >> $GITHUB_OUTPUT
329-
else
330-
echo "has-package=false" >> $GITHUB_OUTPUT
331-
fi
332-
333-
- name: Setup Node.js
334-
if: steps.check-package.outputs.has-package == 'true'
335-
uses: actions/setup-node@v4
257+
- name: Login to GitHub Container Registry
258+
uses: docker/login-action@v3
336259
with:
337-
node-version: '18'
338-
cache: 'npm'
260+
registry: ${{ env.REGISTRY }}
261+
username: ${{ github.actor }}
262+
password: ${{ secrets.GITHUB_TOKEN }}
263+
264+
- name: Extract metadata
265+
id: meta
266+
uses: docker/metadata-action@v5
267+
with:
268+
images: ${{ env.IMAGE_PREFIX }}/op-batcher
269+
tags: |
270+
type=ref,event=branch
271+
type=ref,event=pr
272+
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
273+
type=raw,value=latest,enable={{is_default_branch}}
274+
type=raw,value=pr-${{ github.event.number }},enable=${{ github.event_name == 'pull_request' }}
339275
340-
- name: Install dependencies
341-
if: steps.check-package.outputs.has-package == 'true'
342-
run: npm ci
276+
- name: Build and push OP Batcher
277+
uses: docker/build-push-action@v5
278+
with:
279+
context: .
280+
file: espresso/docker/op-stack/Dockerfile
281+
target: op-batcher-target
282+
platforms: linux/amd64
283+
push: true
284+
tags: ${{ steps.meta.outputs.tags }}
285+
labels: ${{ steps.meta.outputs.labels }}
286+
build-args: |
287+
TARGET_BASE_IMAGE=alpine:3.22
288+
TARGETOS=linux
289+
TARGETARCH=amd64
343290
344-
- name: Build op-deployer
345-
run: |
346-
cd op-deployer
347-
just
348-
echo "$(pwd)/bin" >> $GITHUB_PATH
291+
build-op-proposer:
292+
needs: prepare-deployment
293+
runs-on: ubuntu-latest
294+
permissions:
295+
contents: read
296+
packages: write
297+
steps:
298+
- name: Checkout
299+
uses: actions/checkout@v4
349300

350-
- name: Compile contracts
351-
run: just compile-contracts
301+
- name: Download deployment artifacts
302+
uses: actions/download-artifact@v4
303+
with:
304+
name: deployment-artifacts
352305

353-
- name: Prepare allocations
306+
- name: Verify deployment files are present
354307
run: |
355-
cd espresso
356-
./scripts/prepare-allocs.sh
308+
echo "=== Verifying downloaded files ==="
309+
ls -la espresso/deployment/ || echo "No deployment directory"
310+
ls -la espresso/deployment/deployer/ || echo "No deployer directory"
311+
ls -la packages/contracts-bedrock/ || echo "No contracts-bedrock directory"
357312
358-
- name: Copy config for op-batcher
313+
- name: Copy config for op-proposer
359314
run: |
360315
mkdir -p packages/contracts-bedrock/lib/superchain-registry/ops/testdata/monorepo
361-
# Copy any required config files here, or create placeholder
362-
echo "Config prepared for op-batcher"
316+
echo "Config prepared for op-proposer"
363317
364318
- name: Login to GitHub Container Registry
365319
uses: docker/login-action@v3
@@ -372,20 +326,20 @@ jobs:
372326
id: meta
373327
uses: docker/metadata-action@v5
374328
with:
375-
images: ${{ env.IMAGE_PREFIX }}/op-batcher
329+
images: ${{ env.IMAGE_PREFIX }}/op-proposer
376330
tags: |
377331
type=ref,event=branch
378332
type=ref,event=pr
379333
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
380334
type=raw,value=latest,enable={{is_default_branch}}
381335
type=raw,value=pr-${{ github.event.number }},enable=${{ github.event_name == 'pull_request' }}
382336
383-
- name: Build and push OP Batcher
337+
- name: Build and push OP Proposer
384338
uses: docker/build-push-action@v5
385339
with:
386340
context: .
387341
file: espresso/docker/op-stack/Dockerfile
388-
target: op-batcher-target
342+
target: op-proposer-target
389343
platforms: linux/amd64
390344
push: true
391345
tags: ${{ steps.meta.outputs.tags }}

espresso/docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,12 @@ services:
311311
target: op-proposer-target
312312
image: op-proposer:espresso
313313
depends_on:
314-
op-node-sequencer:
315-
condition: service_started
316314
l2-rollup:
317315
condition: service_completed_successfully
316+
op-node-sequencer:
317+
condition: service_started
318+
op-batcher:
319+
condition: service_started
318320
environment:
319321
OP_PROPOSER_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT}
320322
OP_PROPOSER_ROLLUP_RPC: http://op-node-sequencer:${ROLLUP_PORT}

espresso/docker/l1-geth/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ COPY --from=builder /go/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
8383
# Create data and templates directories
8484
RUN mkdir -p /data /templates
8585

86-
# Include the initialization scripts for the L1 services.
86+
# Include the deployment artifacts and the initialization scripts for the L1 services.
8787
COPY espresso/docker/l1-geth/beacon-config.yaml /templates/
8888
COPY espresso/docker/l1-geth/devnet-genesis-template.json /templates/
8989
COPY espresso/docker/l1-geth/mnemonics.yaml /templates/
9090
COPY espresso/docker/l1-geth/l1-geth-init.sh /l1-geth-init.sh
91+
COPY espresso/deployment/ /deployment/
9192

9293
# Run the initialization script.
9394
RUN chmod +x /l1-geth-init.sh

0 commit comments

Comments
 (0)