Skip to content

Commit b07c4bd

Browse files
committed
chore: decouple Go build
1 parent 2b9f2a6 commit b07c4bd

File tree

6 files changed

+87
-69
lines changed

6 files changed

+87
-69
lines changed
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
## This workflow runs on PRs to `main` to confirm that all Docker images will build successfully. It does not actually push the images to the registry.
2-
## It does not actually publish the images anywhere.
3-
#
4-
#name: Publish Service Images (Dry Run)
5-
#
6-
#on:
7-
# pull_request:
8-
# branches: [main]
9-
#
10-
#permissions:
11-
# contents: read
12-
# id-token: write
13-
# packages: write
14-
#
15-
#jobs:
16-
# docker:
17-
# uses: ./.github/workflows/publish-images.yaml
18-
# with:
19-
# dry_run: true
20-
# runner_label: shared-large-01
21-
# service: "" # all services
22-
# secrets: inherit
1+
# This workflow runs on PRs to `main` to confirm that all Docker images will build successfully. It does not actually push the images to the registry.
2+
# It does not actually publish the images anywhere.
3+
4+
name: Publish Service Images (Dry Run)
5+
6+
on:
7+
pull_request:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
id-token: write
13+
packages: write
14+
15+
jobs:
16+
docker:
17+
uses: ./.github/workflows/publish-images.yaml
18+
with:
19+
dry_run: true
20+
runner_label: shared-large-01
21+
service: "" # all services
22+
secrets: inherit

Cargo.lock

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ members = [
2020
"test-framework",
2121
]
2222

23-
# Default members are the services that are built by default when running `cargo build` (leveraged by docker build to build less crates)
23+
# Default members are the services that are built by default when running `cargo build` (leveraged by docker build to build fewer crates)
2424
default-members = [
2525
"synd-batch-sequencer",
2626
"synd-chain-ingestor",

Dockerfile

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Global build arguments
22
ARG BUILD_PROFILE=release
3-
ARG FEATURES="rocksdb"
3+
ARG FEATURES="rocksdb"
4+
#ARG PACKAGE
45

56
# Stage 1: Base image with Rust
67
FROM rust:slim-bookworm AS builder
@@ -19,23 +20,29 @@ RUN --mount=type=cache,target=/var/cache/apt \
1920
FROM builder AS build
2021
COPY . .
2122

22-
# Install SP1 toolchain using official installer
23-
RUN curl -L https://sp1up.succinct.xyz | bash
24-
ENV PATH="/root/.sp1/bin:${PATH}"
25-
RUN sp1up
26-
27-
# Verify SP1 installation (optional)
28-
RUN cargo prove --version && \
29-
rustup toolchain list | grep succinct
30-
31-
# Build SP1 ELF program
32-
RUN cd synd-withdrawals/synd-tee-attestation-zk-proofs/sp1/program && \
33-
cargo prove build && \
34-
cd /app
23+
## Install SP1 toolchain using official installer
24+
#RUN curl -L https://sp1up.succinct.xyz | bash
25+
#ENV PATH="/root/.sp1/bin:${PATH}"
26+
#RUN sp1up
27+
#
28+
## Verify SP1 installation (optional)
29+
#RUN cargo prove --version && \
30+
# rustup toolchain list | grep succinct
31+
#
32+
## Build SP1 ELF program
33+
#RUN cd synd-withdrawals/synd-tee-attestation-zk-proofs/sp1/program && \
34+
# cargo prove build && \
35+
# cd /app
36+
37+
# TODO look at `withdrawals-test` feature flag to put ZK deps behind
3538

3639
# Perform cargo build with cached Cargo and target directories
3740
RUN --mount=type=cache,target=/usr/local/cargo,from=rust:slim-bookworm,source=/usr/local/cargo \
38-
cargo build --profile ${BUILD_PROFILE} --features "${FEATURES}" --locked
41+
cargo build --package synd-batch-sequencer --profile ${BUILD_PROFILE} --locked && \
42+
cargo build --package synd-chain-ingestor --profile ${BUILD_PROFILE} --locked && \
43+
cargo build --package synd-maestro --profile ${BUILD_PROFILE} --locked && \
44+
cargo build --package synd-mchain --profile ${BUILD_PROFILE} --features "${FEATURES}" --locked && \
45+
cargo build --package synd-translator --profile ${BUILD_PROFILE} --locked
3946

4047
# --- Go build stage for synd-proposer ---
4148
FROM ghcr.io/syndicateprotocol/syndicate-appchains/node-builder AS nitro
@@ -57,16 +64,16 @@ FROM synd-proposer-build AS synd-proposer-test
5764
WORKDIR /synd-proposer
5865
RUN go test ./...
5966

60-
# Stage 3: Optional Foundry install
61-
FROM debian:bookworm-slim AS foundry
62-
RUN apt-get update && \
63-
apt-get install -y --no-install-recommends \
64-
curl \
65-
git \
66-
ca-certificates && \
67-
curl -L https://foundry.paradigm.xyz | bash && \
68-
~/.foundry/bin/foundryup && \
69-
rm -rf /var/lib/apt/lists/*
67+
## Stage 3: Optional Foundry install
68+
#FROM debian:bookworm-slim AS foundry
69+
#RUN apt-get update && \
70+
# apt-get install -y --no-install-recommends \
71+
# curl \
72+
# git \
73+
# ca-certificates && \
74+
# curl -L https://foundry.paradigm.xyz | bash && \
75+
# ~/.foundry/bin/foundryup && \
76+
# rm -rf /var/lib/apt/lists/*
7077

7178
# Stage 3: Runtime images
7279

@@ -81,8 +88,8 @@ FROM gcr.io/distroless/cc AS runtime-base
8188
FROM runtime-base AS synd-translator
8289
ARG BUILD_PROFILE
8390
COPY --from=build /app/target/${BUILD_PROFILE}/synd-translator /usr/local/bin/synd-translator
84-
COPY --from=foundry /root/.foundry /root/.foundry
85-
ENV PATH="/root/.foundry/bin:${PATH}"
91+
#COPY --from=foundry /root/.foundry /root/.foundry
92+
#ENV PATH="/root/.foundry/bin:${PATH}"
8693
ENTRYPOINT ["/usr/local/bin/synd-translator"]
8794
EXPOSE 8545 8546
8895
LABEL service=synd-translator
@@ -125,8 +132,8 @@ FROM ubuntu:22.04 AS synd-translator-debug
125132
ARG BUILD_PROFILE
126133
RUN apt-get update && apt-get install -y heaptrack libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
127134
COPY --from=build /app/target/${BUILD_PROFILE}/synd-translator /usr/local/bin/synd-translator
128-
COPY --from=foundry /root/.foundry /root/.foundry
129-
ENV PATH="/root/.foundry/bin:${PATH}"
135+
#COPY --from=foundry /root/.foundry /root/.foundry
136+
#ENV PATH="/root/.foundry/bin:${PATH}"
130137
ENTRYPOINT ["/usr/local/bin/synd-translator"]
131138
EXPOSE 8545 8546
132139
LABEL service=synd-translator

shared/test-utils/Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ rust-version.workspace = true
99
version.workspace = true
1010

1111
[dependencies]
12-
alloy = { workspace = true, features = ["node-bindings", "providers", "rpc-types-anvil"] }
13-
contract-bindings = { workspace = true }
14-
eyre = { workspace = true }
15-
redis = { workspace = true, features = ["tokio-comp"] }
16-
serde = { workspace = true }
17-
serde_json = { workspace = true }
18-
shared = { workspace = true }
19-
synd-mchain = { workspace = true }
20-
synd-tee-attestation-zk-proofs-submitter = { workspace = true }
21-
tokio = { workspace = true, features = ["fs", "process", "rt-multi-thread"] }
22-
tracing = { workspace = true }
12+
alloy = { workspace = true, features = ["node-bindings", "providers", "rpc-types-anvil"] }
13+
contract-bindings = { workspace = true }
14+
eyre = { workspace = true }
15+
jsonrpsee = { workspace = true }
16+
redis = { workspace = true, features = ["tokio-comp"] }
17+
serde = { workspace = true }
18+
serde_json = { workspace = true }
19+
shared = { workspace = true }
20+
synd-mchain = { workspace = true }
21+
tokio = { workspace = true, features = ["fs", "process", "rt-multi-thread"] }
22+
tracing = { workspace = true }

shared/test-utils/src/docker.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ use alloy::{
1414
transports::http::Client,
1515
};
1616
use eyre::Result;
17+
use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder};
1718
use redis::aio::ConnectionManager;
1819
use std::{
1920
env,
2021
future::Future,
22+
io::Error,
2123
process::{ExitStatus, Stdio},
2224
time::Duration,
2325
};
2426
use synd_mchain::client::MProvider;
25-
use synd_tee_attestation_zk_proofs_submitter::{self, get_signer_public_key};
2627
use tokio::{
2728
io::{AsyncBufReadExt as _, BufReader},
2829
process::{Child, Command},
@@ -416,3 +417,12 @@ pub async fn launch_enclave_server() -> Result<(E2EProcess, String, Address)> {
416417

417418
Ok((docker, enclave_rpc_url, signer_address))
418419
}
420+
421+
/// Gets the public key from the TEE, no attestation. Used for testing only
422+
pub async fn get_signer_public_key(enclave_rpc_url: String) -> eyre::Result<String> {
423+
let client = HttpClientBuilder::default()
424+
.request_timeout(Duration::from_secs(10))
425+
.build(enclave_rpc_url)?;
426+
427+
Ok(client.request::<String, [(); 0]>("enclave_signerPublicKey", []).await?)
428+
}

0 commit comments

Comments
 (0)