Skip to content
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
16 changes: 8 additions & 8 deletions .github/workflows/contracts-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,27 @@ jobs:
echo "manifest=$MANIFEST" >> "$GITHUB_OUTPUT"

# ── immutable per-sha release ───────────────────────────────────
- name: Release contracts-${{ steps.sha.outputs.short }}
- name: Release ${{ steps.sha.outputs.short }}
uses: softprops/action-gh-release@v2
with:
tag_name: contracts-${{ steps.sha.outputs.short }}
name: Contracts @ ${{ steps.sha.outputs.short }}
tag_name: ${{ steps.sha.outputs.short }}
name: Proofbridge-Contracts @ ${{ steps.sha.outputs.short }}
body: |
Bundled WASMs, EVM artifacts, and deposit VK built from `${{ github.sha }}`.

Consumed by `scripts/docker-local/up.sh` (defaults to `contracts-latest`;
pin this tag by exporting `CONTRACTS_BUNDLE_TAG=contracts-${{ steps.sha.outputs.short }}`).
Consumed by `scripts/docker-local/up.sh` (defaults to `latest`;
pin this tag by exporting `CONTRACTS_BUNDLE_TAG=${{ steps.sha.outputs.short }}`).
files: |
${{ steps.bundle.outputs.tarball }}
${{ steps.bundle.outputs.manifest }}
make_latest: "false"

# ── rolling pointer for docker-local ────────────────────────────
- name: Update contracts-latest
- name: Update latest
uses: softprops/action-gh-release@v2
with:
tag_name: contracts-latest
name: Contracts (latest main)
tag_name: latest
name: Proofbridge-Contracts
body: |
Rolling pointer to the most recent contracts build from `main`.
Current commit: ${{ github.sha }}
Expand Down
6 changes: 3 additions & 3 deletions scripts/docker-local/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ DEV_EVM_ADDRESS=
# local quickstart.
DEV_STELLAR_ADDRESS=

# Pin a specific contracts build (immutable per-sha release). Defaults to
# `contracts-latest` if unset.
# CONTRACTS_BUNDLE_TAG=contracts-abc1234
# Pin a specific contracts build (immutable per-sha release — the tag is
# the short commit sha). Defaults to `latest` if unset.
# CONTRACTS_BUNDLE_TAG=abc1234
2 changes: 1 addition & 1 deletion scripts/docker-local/Dockerfile.deployer
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Only the runtime deploy toolkit is baked in (stellar CLI + node + pnpm).
# Contract artifacts (WASMs, EVM ABIs, deposit VK) are NOT built here — they
# are pulled by `up.sh` from the `contracts-latest` GitHub Release and
# are pulled by `up.sh` from the Proofbridge-Contracts `latest` GitHub Release and
# bind-mounted into the container at the paths deploy.ts expects.
#
# Image build is ~1 min on a cold cache; rebuilds happen only when
Expand Down
18 changes: 9 additions & 9 deletions scripts/docker-local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ relayer DB with chains/tokens/routes, and runs `backend-relayer` on
- `curl` (used by `up.sh` to fetch the contracts bundle)

No rust / foundry / nargo / stellar CLI needed on the host — contract
artifacts are downloaded from the public `contracts-latest` GitHub Release
artifacts are downloaded from the public Proofbridge-Contracts `latest` GitHub Release
and bind-mounted into the deployer container.

## Usage
Expand Down Expand Up @@ -57,16 +57,16 @@ Leaving either variable unset skips that chain. Reruns are idempotent:

### Pinning a specific build

`up.sh` defaults to the rolling `contracts-latest` tag, which is updated
by `.github/workflows/contracts-release.yml` on every push to `main`.
To pin a specific commit's artifacts:
`up.sh` defaults to the rolling `latest` tag on the Proofbridge-Contracts
release, which is updated by `.github/workflows/contracts-release.yml` on
every push to `main`. To pin a specific commit's artifacts:

```bash
CONTRACTS_BUNDLE_TAG=contracts-<short-sha> bash scripts/docker-local/up.sh
CONTRACTS_BUNDLE_TAG=<short-sha> bash scripts/docker-local/up.sh
```

Every `main` build also publishes an immutable `contracts-<short-sha>`
release, so bisecting regressions is cheap.
Every `main` build also publishes an immutable `<short-sha>` release,
so bisecting regressions is cheap.

### Iterating on contracts locally

Expand Down Expand Up @@ -132,7 +132,7 @@ URLs above.
(anvil + stellar are ephemeral), written to a docker volume, and read
by the relayer at start. `down -r` clears it; plain `down` keeps it.
- To refresh artifacts without touching containers: delete `.artifacts/`
and re-run `up.sh`, or set `CONTRACTS_BUNDLE_TAG=contracts-latest`
explicitly to force a download.
and re-run `up.sh`, or set `CONTRACTS_BUNDLE_TAG=latest` explicitly
to force a download.
- The relayer image reuses `apps/backend-relayer/Dockerfile` — the same
one the CI e2e and production builds use.
5 changes: 3 additions & 2 deletions scripts/docker-local/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ services:
DEV_STELLAR_ADDRESS: ${DEV_STELLAR_ADDRESS:-}
volumes:
- shared:/shared
# Contract artifacts are pulled by up.sh from the `contracts-latest`
# GitHub Release (or built locally with `up.sh --local`) and extracted
# Contract artifacts are pulled by up.sh from the Proofbridge-Contracts
# `latest` GitHub Release (or built locally with `up.sh --local`) and
# extracted
# into ./.artifacts. deploy.ts reads from these paths verbatim.
- ./.artifacts/contracts/stellar/target/wasm32v1-none/release:/repo/contracts/stellar/target/wasm32v1-none/release:ro
- ./.artifacts/contracts/evm/out:/repo/contracts/evm/out:ro
Expand Down
9 changes: 7 additions & 2 deletions scripts/docker-local/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ done
log "stellar RPC healthy."

log "waiting for anvil at $EVM_RPC_URL…"
# Slim deployer image has no `cast` — talk to anvil via raw JSON-RPC.
# Compose already gates us on `anvil: service_healthy`, so this is a
# sanity check more than a real wait loop.
for i in $(seq 1 30); do
if cast block-number --rpc-url "$EVM_RPC_URL" >/dev/null 2>&1; then
if curl -sf -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
"$EVM_RPC_URL" 2>/dev/null | grep -q '"result":"0x'; then
break
fi
sleep 2
Expand Down Expand Up @@ -74,7 +79,7 @@ log "wrote admin secret → $ADMIN_SECRET_PATH"
# ── deploy contracts ─────────────────────────────────────────────────
#
# WASMs, EVM artifacts, and the deposit VK are bind-mounted in from
# $ROOT_DIR (populated by up.sh from the contracts-latest GitHub Release,
# $ROOT_DIR (populated by up.sh from the Proofbridge-Contracts `latest` GitHub Release,
# or from the repo's locally-built tree via `up.sh --local`). Sanity-check
# their presence before running deploy so missing artifacts fail fast.

Expand Down
10 changes: 5 additions & 5 deletions scripts/docker-local/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set -euo pipefail
# Relayer is exposed at http://localhost:2005 on success.
#
# Contract artifacts (Stellar WASMs, EVM ABIs, deposit VK) are pulled from
# the public `contracts-latest` GitHub Release by default — no host
# toolchain required. Override with:
# CONTRACTS_BUNDLE_TAG=contracts-<sha> pin a specific build
# the public Proofbridge-Contracts `latest` GitHub Release by default — no
# host toolchain required. Override with:
# CONTRACTS_BUNDLE_TAG=<short-sha> pin a specific build
# up.sh --local use the repo's locally-built tree
# (skips download; assumes you ran
# `stellar contract build`, `forge
Expand All @@ -29,7 +29,7 @@ if [[ -f "$SCRIPT_DIR/.env" ]]; then
fi

GH_REPO="${CONTRACTS_BUNDLE_REPO:-Explore-Beyond-Innovations/ProofBridge}"
BUNDLE_TAG="${CONTRACTS_BUNDLE_TAG:-contracts-latest}"
BUNDLE_TAG="${CONTRACTS_BUNDLE_TAG:-latest}"

USE_LOCAL=0
for arg in "$@"; do
Expand Down Expand Up @@ -90,7 +90,7 @@ download_bundle() {
echo "[up.sh] downloading $BUNDLE_TAG from $GH_REPO…"
if ! curl -fsSL "$url" -o "$tmp/bundle.tgz"; then
echo "[up.sh] failed to fetch $url" >&2
echo "[up.sh] (is the tag published? try \`CONTRACTS_BUNDLE_TAG=contracts-latest\` or \`--local\`)" >&2
echo "[up.sh] (is the tag published? try \`CONTRACTS_BUNDLE_TAG=latest\` or \`--local\`)" >&2
exit 1
fi

Expand Down
Loading