Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
!/Cargo.toml
!/config.json
!/docker/entrypoint.sh
!/docker/enclave-key.pem
!/docker/cargo-config.toml
!/.env
!/lib
Expand Down
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SP1_BATCH_VK_HASH=4e8ed79204df0fec11c3bacb3c517e0f33783f9626cb2b6e0e1e46b519ae09
SP1_SHASTA_AGGREGATION_VK_HASH=69640eee59d46fae18ecadf92189b4b20b63eb206bf4034d5aaf2bcf68a8b53b

# SGX MRENCLAVE
SGX_MRENCLAVE=cc28d7121684a5141435a4eb660a2f44ad3fdd67c44f0c351e6c1c2d1c043a8f
SGX_MRENCLAVE=72258d3cae0e9901d0efc1f630064f1c44f11950bd25fee0b62ec8df84532da2

# SGXGETH MRENCLAVE
SGXGETH_MRENCLAVE=d8395bb1ae83b13c2a9d8430f09137ec179a424926aee9c0639cda70936305b9
SGXGETH_MRENCLAVE=398be8424f27802b38e6e8d3413bf6a0b187349e68522a218f5bfc00279006ac
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ perf.data.old
.vscode/

log.build.*
docker/enclave-key.pem

# Python
# -----------------------------------------------------------------------------------------
venv/
.venv/

37 changes: 32 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@ RUN ego-go build -o gaiko-ego ./cmd/gaiko

# Sign with our enclave config and private key
COPY gaiko/ego/enclave.json .
COPY docker/enclave-key.pem private.pem
RUN ego sign && ego bundle gaiko-ego gaiko
ARG ENCLAVE_KEY_PUBLIC_SHA256
# CI/local compose builds use a throwaway key; release builds pass a secret and hash.
RUN --mount=type=secret,id=enclave_key,target=/run/secrets/enclave-key.pem \
set -e; \
trap 'rm -f private.pem' EXIT; \
if [ -s /run/secrets/enclave-key.pem ]; then \
if [ -n "${ENCLAVE_KEY_PUBLIC_SHA256}" ]; then \
test "$(openssl rsa -in /run/secrets/enclave-key.pem -pubout 2>/dev/null | openssl sha256 | awk '{print $2}')" = "${ENCLAVE_KEY_PUBLIC_SHA256}"; \
fi; \
cp /run/secrets/enclave-key.pem private.pem; \
else \
test -z "${ENCLAVE_KEY_PUBLIC_SHA256}"; \
openssl genrsa -3 -out private.pem 3072; \
fi; \
ego sign && \
ego bundle gaiko-ego gaiko
RUN ego uniqueid gaiko-ego 2>&1 | tee /tmp/gaiko_uniqueid.log
RUN ego signerid gaiko-ego

Expand Down Expand Up @@ -87,13 +101,26 @@ COPY --from=builder /opt/raiko/host/config/chain_spec_list_devnet.json /etc/raik
COPY --from=builder /opt/raiko/target/release/sgx-guest ./bin/
COPY --from=builder /opt/raiko/target/release/raiko-host ./bin/
COPY --from=builder /opt/raiko/target/release/raiko-setup ./bin/
COPY --from=builder /opt/raiko/docker/enclave-key.pem /root/.config/gramine/enclave-key.pem

ARG EDMM=0
ARG ENCLAVE_KEY_PUBLIC_SHA256
ENV EDMM=${EDMM}
WORKDIR /opt/raiko/bin
RUN gramine-manifest -Dlog_level=error -Ddirect_mode=0 -Darch_libdir=/lib/x86_64-linux-gnu/ ../provers/sgx/config/sgx-guest.local.manifest.template sgx-guest.manifest && \
gramine-sgx-sign --manifest sgx-guest.manifest --output sgx-guest.manifest.sgx && \
RUN --mount=type=secret,id=enclave_key,target=/run/secrets/enclave-key.pem \
set -e; \
enclave_key_path=/tmp/enclave-key.pem; \
trap 'rm -f "$enclave_key_path"' EXIT; \
if [ -s /run/secrets/enclave-key.pem ]; then \
if [ -n "${ENCLAVE_KEY_PUBLIC_SHA256}" ]; then \
test "$(openssl rsa -in /run/secrets/enclave-key.pem -pubout 2>/dev/null | openssl sha256 | awk '{print $2}')" = "${ENCLAVE_KEY_PUBLIC_SHA256}"; \
fi; \
cp /run/secrets/enclave-key.pem "$enclave_key_path"; \
else \
test -z "${ENCLAVE_KEY_PUBLIC_SHA256}"; \
openssl genrsa -3 -out "$enclave_key_path" 3072; \
fi; \
gramine-manifest -Dlog_level=error -Ddirect_mode=0 -Darch_libdir=/lib/x86_64-linux-gnu/ ../provers/sgx/config/sgx-guest.local.manifest.template sgx-guest.manifest && \
gramine-sgx-sign --key "$enclave_key_path" --manifest sgx-guest.manifest --output sgx-guest.manifest.sgx && \
gramine-sgx-sigstruct-view "sgx-guest.sig" 2>&1 | tee /tmp/sgx_sigstruct.log


Expand Down
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ mod tests {
}
}

#[ignore = "default Taiko mainnet spec is Shasta-only"]
#[tokio::test(flavor = "multi_thread")]
async fn test_prove_pacaya_batch_taiko_mainnet() {
env_logger::init();
Expand Down
39 changes: 0 additions & 39 deletions docker/enclave-key.pem

This file was deleted.

2 changes: 1 addition & 1 deletion gaiko
45 changes: 6 additions & 39 deletions host/config/chain_spec_list_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,9 @@
"chain_id": 167000,
"max_spec_id": "SHASTA",
"hard_forks": {
"HEKLA": {
"Block": 0
},
"ONTAKE": {
"Block": 538304
},
"PACAYA": {
"Block": 1166000
},
"SHASTA": {
"Timestamp": 1775135700
},
"CANCUN": "TBD"
}
},
"eip_1559_constants": {
"base_fee_change_denominator": "0x8",
Expand All @@ -179,18 +169,17 @@
"elasticity_multiplier": "0x2"
},
"l1_contract": {
"PACAYA": "0x06a9Ab27c7e2255df1815E6CC0168d7755Feb19a",
"SHASTA": "0x6f21C543a4aF5189eBdb0723827577e1EF57ef1f"
},
"l2_contract": "0x1670000000000000000000000000000000010001",
"rpc": "https://rpc.mainnet.taiko.xyz",
"beacon_rpc": null,
"verifier_address_forks": {
"SHASTA": {
"SGX": "0xa1018Ba2e22139076f91dA2A856B2CAB22d968F6",
"SGX": "0x9D3C595BFf6Ff7D2b2CbdEcF94aD917eB2fCFFd8",
"RISC0": "0x059dAF31F571da48Ab4e74Ae12F64f907681Cd8b",
"SP1": "0x96337327648dcFA22b014009cf10A2D5E2F305f6",
"SGXGETH": "0x08568Df252ecf37D6C3eFD24f6ca3688118697F1"
"SGXGETH": "0x41e79EB4F03aBB5DF8716B759528dc5d8f6a84Ee"
}
},
"genesis_time": 0,
Expand All @@ -202,19 +191,9 @@
"chain_id": 167013,
"max_spec_id": "SHASTA",
"hard_forks": {
"HEKLA": {
"Block": 0
},
"ONTAKE": {
"Block": 0
},
"PACAYA": {
"Block": 0
},
"SHASTA": {
"Timestamp": 1770296400
},
"CANCUN": "TBD"
}
},
"eip_1559_constants": {
"base_fee_change_denominator": "0x8",
Expand All @@ -223,7 +202,6 @@
"elasticity_multiplier": "0x2"
},
"l1_contract": {
"PACAYA": "0xf6eA848c7d7aC83de84db45Ae28EAbf377fe0eF9",
"SHASTA": "0xeF4bB7A442Bd68150A3aa61A6a097B86b91700BF"
},
"l2_contract": "0x1670130000000000000000000000000000010001",
Expand All @@ -246,19 +224,9 @@
"chain_id": 167014,
"max_spec_id": "SHASTA",
"hard_forks": {
"HEKLA": {
"Block": 0
},
"ONTAKE": {
"Block": 0
},
"PACAYA": {
"Block": 0
},
"SHASTA": {
"Timestamp": 1770987600
},
"CANCUN": "TBD"
}
},
"eip_1559_constants": {
"base_fee_change_denominator": "0x8",
Expand All @@ -267,7 +235,6 @@
"elasticity_multiplier": "0x2"
},
"l1_contract": {
"PACAYA": "0x07700C3bC1B0EE3D311E7D642d364242fd537906",
"SHASTA": "0x2C34D466f6f57043B534D9b24DD032e905a95f50"
},
"l2_contract": "0x1670140000000000000000000000000000010001",
Expand All @@ -285,4 +252,4 @@
"seconds_per_slot": 1,
"is_taiko": true
}
]
]
19 changes: 6 additions & 13 deletions host/config/chain_spec_list_devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"RISC0": null
}
},
"genesis_time": 1769395300,
"genesis_time": 1782220308,
"seconds_per_slot": 12,
"is_taiko": false
},
Expand All @@ -50,7 +50,7 @@
"Block": 0
},
"SHASTA": {
"Timestamp": 1769396301
"Timestamp": 0
},
"CANCUN": "TBD"
},
Expand All @@ -61,28 +61,21 @@
"elasticity_multiplier": "0x2"
},
"l1_contract": {
"PACAYA": "0x3b37a799290950fef954dfF547608baC52A12571",
"SHASTA": "0x12100faa7b157e9947340B44409fC7E27EC0ABef"
"SHASTA": "0xb432bbe475e569B2ADef4830Ae43D587932F139C"
},
"l2_contract": "0x1670010000000000000000000000000000010001",
"rpc": "https://rpc.internal.taiko.xyz",
"beacon_rpc": null,
"verifier_address_forks": {
"PACAYA": {
"SGX": "0x9D351F6E72e3095F24dD854c9B8CA69F99A2C538",
"SP1": "0xCb2D625BF8C2187B180646aF4738AF5F1413Fb70",
"RISC0": "0x48940F7ab2C674Aa66C09eDa71614aD704E9d007",
"SGXGETH": "0x6B455442C8C4cAC2e09c40409E8bf7FfcdB1Fc50"
},
"SHASTA": {
"SGX": "0x9D351F6E72e3095F24dD854c9B8CA69F99A2C538",
"SGX": "0x6fF4A33Fe3766D08251247Daab78F7ebEAD7Db72",
"SP1": "0xCb2D625BF8C2187B180646aF4738AF5F1413Fb70",
"RISC0": "0x48940F7ab2C674Aa66C09eDa71614aD704E9d007",
"SGXGETH": "0x6B455442C8C4cAC2e09c40409E8bf7FfcdB1Fc50"
"SGXGETH": "0xb31e61a8b6Fb5A9573dC1a0B328b1BD184dca98E"
}
},
"genesis_time": 0,
"seconds_per_slot": 1,
"is_taiko": true
}
]
]
9 changes: 2 additions & 7 deletions lib/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,9 @@ mod tests {
let taiko_mainnet_spec = SupportedChainSpecs::default()
.get_chain_spec(&Network::TaikoMainnet.to_string())
.unwrap();
assert_eq!(taiko_mainnet_spec.active_fork(0, 0).unwrap(), SpecId::HEKLA);
assert_eq!(
taiko_mainnet_spec.active_fork(538303, 0).unwrap(),
SpecId::HEKLA
);
assert_eq!(
taiko_mainnet_spec.active_fork(538304, 0).unwrap(),
SpecId::ONTAKE
taiko_mainnet_spec.active_fork(0, 1_775_135_700).unwrap(),
SpecId::SHASTA
);
}

Expand Down
58 changes: 57 additions & 1 deletion script/publish-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,67 @@ case "$proof_type" in
esac

echo "Build and push $image_name:$tag..."
docker buildx build . \
build_secret_args=()
tmp_enclave_key_path=""
cleanup_tmp_enclave_key() {
if [[ -n "$tmp_enclave_key_path" ]]; then
rm -f "$tmp_enclave_key_path"
fi
}
trap cleanup_tmp_enclave_key EXIT

if [ "$proof_type" = "0" ] || [ "$proof_type" = "tee" ]; then
if [[ -n "${GCP_ENCLAVE_KEY_SECRET:-}" ]]; then
if ! command -v gcloud >/dev/null 2>&1; then
echo "❌ gcloud is required when GCP_ENCLAVE_KEY_SECRET is set."
exit 1
fi

tmp_enclave_key_path="$(mktemp)"
gcloud_secret_version="${GCP_ENCLAVE_KEY_VERSION:-latest}"
gcloud_secret_args=(
secrets versions access "$gcloud_secret_version"
--secret "$GCP_ENCLAVE_KEY_SECRET"
--out-file "$tmp_enclave_key_path"
)
if [[ -n "${GCP_ENCLAVE_KEY_PROJECT:-}" ]]; then
gcloud_secret_args+=(--project "$GCP_ENCLAVE_KEY_PROJECT")
fi

echo "Fetching enclave signing key from GCP Secret Manager: $GCP_ENCLAVE_KEY_SECRET version $gcloud_secret_version"
case "$-" in
*x*) xtrace_was_on=1 ;;
*) xtrace_was_on=0 ;;
esac
set +x
gcloud "${gcloud_secret_args[@]}"
if [[ "$xtrace_was_on" = "1" ]]; then
set -x
fi
chmod 0600 "$tmp_enclave_key_path"
enclave_key_path="$tmp_enclave_key_path"
else
enclave_key_path="${ENCLAVE_KEY_PATH:-docker/enclave-key.pem}"
fi

if [ ! -s "$enclave_key_path" ]; then
echo "❌ Missing enclave signing key: $enclave_key_path"
echo "Set GCP_ENCLAVE_KEY_SECRET=<secret-name>, ENCLAVE_KEY_PATH=/path/to/enclave-key.pem, or provide docker/enclave-key.pem locally."
exit 1
fi
enclave_key_public_sha256="$(openssl rsa -in "$enclave_key_path" -pubout 2>/dev/null | openssl sha256 | awk '{print $2}')"
build_secret_args=(
--secret "id=enclave_key,src=$enclave_key_path"
--build-arg "ENCLAVE_KEY_PUBLIC_SHA256=$enclave_key_public_sha256"
)
fi

DOCKER_BUILDKIT=1 docker buildx build . \
-f $target_dockerfile \
--load \
--platform linux/amd64 \
-t $image_name:latest \
"${build_secret_args[@]}" \
$build_flags \
--build-arg TARGETPLATFORM=linux/amd64 \
--progress=plain \
Expand Down
Loading