Skip to content

Commit 9fb3982

Browse files
authored
feat: Validator binary crate, Dockerfile, and Debian package (#2053)
1 parent 25da5ba commit 9fb3982

53 files changed

Lines changed: 469 additions & 406 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-docker.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,28 @@ permissions:
1313
jobs:
1414
docker-build:
1515
runs-on: Linux-ARM64-Runner
16+
strategy:
17+
matrix:
18+
include:
19+
- component: node
20+
bin: miden-node
21+
port: 57291
22+
- component: validator
23+
bin: miden-validator
24+
port: 50101
25+
name: Build ${{ matrix.component }}
1626
steps:
1727
- name: Set up Docker Buildx
1828
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
1929

20-
- name: Build and push
30+
- name: Build
2131
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
2232
with:
2333
push: false
24-
file: ./bin/node/Dockerfile
34+
file: ./Dockerfile
35+
build-args: |
36+
BIN=${{ matrix.bin }}
37+
PORT=${{ matrix.port }}
2538
cache-from: type=gha
2639
# Only save cache on push into next
2740
cache-to: ${{ github.event_name == 'push' && github.ref == 'refs/heads/next' && 'type=gha,mode=max' || '' }}

.github/workflows/publish-debian-all.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,34 @@ jobs:
7272
crate: miden-remote-prover
7373
arch: ${{ matrix.arch }}
7474

75+
publish-validator:
76+
name: Publish Validator ${{ matrix.arch }} Debian
77+
permissions:
78+
contents: write
79+
strategy:
80+
matrix:
81+
arch: [amd64, arm64]
82+
runs-on:
83+
labels: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
84+
steps:
85+
- name: Checkout repo
86+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
87+
with:
88+
fetch-depth: 0
89+
persist-credentials: false
90+
- uses: ./.github/actions/install-rocksdb
91+
- uses: ./.github/actions/install-protobuf-compiler
92+
- name: Build and Publish Validator
93+
uses: ./.github/actions/debian
94+
with:
95+
github_token: ${{ secrets.GITHUB_TOKEN }}
96+
gitref: ${{ env.version }}
97+
crate_dir: validator
98+
package: miden-validator
99+
packaging_dir: validator
100+
crate: miden-validator
101+
arch: ${{ matrix.arch }}
102+
75103
publish-network-monitor:
76104
name: Publish Network Monitor ${{ matrix.arch }} Debian
77105
permissions:

.github/workflows/publish-debian.yml

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,15 @@ name: Publish Debian Package
33
on:
44
workflow_dispatch:
55
inputs:
6-
package:
7-
description: "Name of package to publish"
6+
component:
7+
description: "Component to publish"
88
required: true
99
type: choice
10-
options:
11-
- miden-network-monitor
12-
- miden-node
13-
- miden-prover
14-
- miden-prover-proxy
15-
crate_dir:
16-
required: true
17-
description: "Name of crate directory"
18-
type: choice
19-
options:
20-
- network-monitor
21-
- node
22-
- remote-prover
23-
packaging_dir:
24-
required: true
25-
description: "Name of packaging directory"
26-
type: choice
2710
options:
2811
- network-monitor
2912
- node
3013
- prover
31-
- prover-proxy
32-
crate:
33-
description: "Name of the binary crate to publish"
34-
required: true
35-
type: choice
36-
options:
37-
- miden-network-monitor
38-
- miden-node
39-
- miden-remote-prover
14+
- validator
4015
version:
4116
description: "Version to release (E.G. v0.10.0-rc.1, v0.10.0). Corresponding git tag must already exist."
4217
required: true
@@ -47,7 +22,7 @@ permissions:
4722

4823
jobs:
4924
publish:
50-
name: Publish ${{ inputs.package }} ${{ matrix.arch }} Debian
25+
name: Publish ${{ inputs.component }} ${{ matrix.arch }} Debian
5126
permissions:
5227
contents: write
5328
strategy:
@@ -62,6 +37,29 @@ jobs:
6237
fetch-depth: 0
6338
persist-credentials: false
6439

40+
- name: Resolve component inputs
41+
id: resolve
42+
shell: bash
43+
env:
44+
COMPONENT: ${{ inputs.component }}
45+
run: |
46+
package="miden-${COMPONENT}"
47+
packaging_dir="${COMPONENT}"
48+
49+
# prover's binary crate lives in bin/remote-prover and is named miden-remote-prover
50+
if [ "${COMPONENT}" = "prover" ]; then
51+
crate_dir="remote-prover"
52+
crate="miden-remote-prover"
53+
else
54+
crate_dir="${COMPONENT}"
55+
crate="miden-${COMPONENT}"
56+
fi
57+
58+
echo "package=${package}" >> "$GITHUB_OUTPUT"
59+
echo "crate_dir=${crate_dir}" >> "$GITHUB_OUTPUT"
60+
echo "packaging_dir=${packaging_dir}" >> "$GITHUB_OUTPUT"
61+
echo "crate=${crate}" >> "$GITHUB_OUTPUT"
62+
6563
- uses: ./.github/actions/install-rocksdb
6664
- uses: ./.github/actions/install-protobuf-compiler
6765

@@ -70,8 +68,8 @@ jobs:
7068
with:
7169
github_token: ${{ secrets.GITHUB_TOKEN }}
7270
gitref: ${{ inputs.version }}
73-
crate_dir: ${{ inputs.crate_dir }}
74-
package: ${{ inputs.package }}
75-
packaging_dir: ${{ inputs.packaging_dir }}
76-
crate: ${{ inputs.crate }}
71+
crate_dir: ${{ steps.resolve.outputs.crate_dir }}
72+
package: ${{ steps.resolve.outputs.package }}
73+
packaging_dir: ${{ steps.resolve.outputs.packaging_dir }}
74+
crate: ${{ steps.resolve.outputs.crate }}
7775
arch: ${{ matrix.arch }}

.github/workflows/publish-docker.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ jobs:
2828
environment: publish-docker
2929
strategy:
3030
matrix:
31-
component: [node]
31+
include:
32+
- component: node
33+
bin: miden-node
34+
port: 57291
35+
- component: validator
36+
bin: miden-validator
37+
port: 50101
3238
name: Publish ${{ matrix.component }} ${{ inputs.version }}
3339
steps:
3440
- name: Checkout repo
@@ -62,7 +68,10 @@ jobs:
6268
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
6369
with:
6470
push: true
65-
file: ./bin/${{ matrix.component }}/Dockerfile
71+
file: ./Dockerfile
72+
build-args: |
73+
BIN=${{ matrix.bin }}
74+
PORT=${{ matrix.port }}
6675
tags: ${{ env.registry }}/0xmiden/miden-${{ matrix.component }}:${{ env.version }}
6776
cache-from: type=s3,region=${{ secrets.AWS_REGION }},bucket=${{ secrets.AWS_CACHE_BUCKET }},name=miden-${{ matrix.component }}
6877
cache-to: type=s3,region=${{ secrets.AWS_REGION }},bucket=${{ secrets.AWS_CACHE_BUCKET }},name=miden-${{ matrix.component }},mode=max

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Replaced the network monitor's JavaScript dashboard with a server-rendered Maud + HTMX frontend ([#2024](https://github.com/0xMiden/node/pull/2024)).
1919
- [BREAKING] Removed `CheckNullifiers` endpoint ([#2049](https://github.com/0xMiden/node/pull/2049)).
2020
- [BREAKING] `BlockRange.block_to` is now required for all RPC endpoints ([#2056](https://github.com/0xMiden/node/pull/2056)).
21+
- [BREAKING] Removed `miden-node validator` subcommand and created a separate `miden-validator` binary ([#2053](https://github.com/0xMiden/node/pull/2053)).
2122

2223
## v0.14.10 (2026-05-29)
2324

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ members = [
55
"bin/node",
66
"bin/remote-prover",
77
"bin/stress-test",
8+
"bin/validator",
89
"crates/block-producer",
910
"crates/db",
1011
"crates/grpc-error-macro",
@@ -17,7 +18,6 @@ members = [
1718
"crates/store",
1819
"crates/test-macro",
1920
"crates/utils",
20-
"crates/validator",
2121
"proto",
2222
]
2323

@@ -54,8 +54,8 @@ miden-node-rpc = { path = "crates/rpc", version = "0.15" }
5454
miden-node-store = { path = "crates/store", version = "0.15" }
5555
miden-node-test-macro = { path = "crates/test-macro" }
5656
miden-node-utils = { path = "crates/utils", version = "0.15" }
57-
miden-node-validator = { path = "crates/validator", version = "0.15" }
5857
miden-remote-prover-client = { path = "crates/remote-prover-client", version = "0.15" }
58+
miden-validator = { path = "bin/validator", version = "0.15" }
5959
# Temporary workaround until <https://github.com/rust-rocksdb/rust-rocksdb/pull/1029>
6060
# is part of `rocksdb-rust` release
6161
miden-node-rocksdb-cxx-linkage-fix = { path = "crates/rocksdb-cxx-linkage-fix", version = "0.15" }
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ARG BIN
2+
ARG PORT
3+
14
FROM rust:1.93-slim-bookworm AS chef
25
# Install build dependencies. RocksDB is compiled from source by librocksdb-sys.
36
RUN apt-get update && \
@@ -20,12 +23,13 @@ COPY . .
2023
RUN cargo chef prepare --recipe-path recipe.json
2124

2225
FROM chef AS builder
26+
ARG BIN
2327
COPY --from=planner /app/recipe.json recipe.json
2428
# Build dependencies - this is the caching Docker layer!
2529
RUN cargo chef cook --release --recipe-path recipe.json
2630
# Build application
2731
COPY . .
28-
RUN cargo build --release --locked --bin miden-node
32+
RUN cargo build --release --locked --bin ${BIN}
2933

3034
# Base line runtime image with runtime dependencies installed.
3135
FROM debian:bookworm-slim AS runtime-base
@@ -35,7 +39,9 @@ RUN apt-get update && \
3539
&& rm -rf /var/lib/apt/lists/*
3640

3741
FROM runtime-base AS runtime
38-
COPY --from=builder /app/target/release/miden-node /usr/local/bin/miden-node
42+
ARG BIN
43+
ARG PORT
44+
COPY --from=builder /app/target/release/${BIN} /usr/local/bin/${BIN}
3945
LABEL org.opencontainers.image.authors=devops@miden.team \
4046
org.opencontainers.image.url=https://0xMiden.github.io/ \
4147
org.opencontainers.image.documentation=https://github.com/0xMiden/node \
@@ -48,8 +54,7 @@ ARG COMMIT
4854
LABEL org.opencontainers.image.created=$CREATED \
4955
org.opencontainers.image.version=$VERSION \
5056
org.opencontainers.image.revision=$COMMIT
51-
52-
# Expose RPC port
53-
EXPOSE 57291
54-
# Miden node does not spawn sub-processes, so it can be used as the PID1.
55-
CMD ["miden-node"]
57+
EXPOSE ${PORT}
58+
# Use exec to replace the shell so the binary runs as PID 1.
59+
ENV MIDEN_BIN=${BIN}
60+
CMD ["/bin/sh", "-c", "exec /usr/local/bin/$MIDEN_BIN"]

0 commit comments

Comments
 (0)