Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7dcb25b
refactor(client, common, stm): switching from rug to num-integer
turmelclem Feb 10, 2026
41b212f
feature(ci): statically build aggregator, signer and client in github ci
turmelclem Feb 11, 2026
8d7212f
refactor(client-cli, ci): remove ../ from assets variable for automat…
turmelclem Feb 13, 2026
e2d1f1d
feature(ci): add a step in the CI verifying binaries build are static
turmelclem Feb 16, 2026
29e8d06
refactor(aggregator, signer, ci): remove jemallicator from default fe…
turmelclem Feb 16, 2026
4fa7d3c
feature(ci): add a step in the CI verifying binaries build are static…
turmelclem Feb 16, 2026
d6ce3ce
feature(hydra): statically build aggregator, client and signer in Hydra
turmelclem Feb 18, 2026
b76339b
feat(nix): build static versions of the aggregator, signer and client
jpraynaud Feb 27, 2026
00d54a5
feat: remove reqwest default features
jpraynaud Feb 27, 2026
e9ce46f
refactor(ci): move static build checks in a dedicated github action a…
turmelclem Mar 3, 2026
66d2a3d
refactor(ci): handle build target path for the build-upload-mithril-a…
turmelclem Mar 3, 2026
4bb1f22
refactor(ci): add a step moving binaries in a same root folder to avo…
turmelclem Mar 4, 2026
5778deb
refactor(ci): move static build check inside build-upload-mithril-art…
turmelclem Mar 4, 2026
4fe502c
refactor(ci): use runner.os instead of distribution os from input matrix
turmelclem Mar 4, 2026
8c71544
feature(nix): only build aggregator, signer and client-cli statically…
turmelclem Mar 4, 2026
3d1d6ff
feature(client, nix): make feature TLS mandatory for client library c…
turmelclem Mar 5, 2026
e82ae2d
refactor(aggregator, signer, ci, nix): make Jemmallocator a default d…
turmelclem Mar 6, 2026
b7f9559
chore: upgrade dockerfile devian version to debian 13
turmelclem Mar 6, 2026
d539ddf
feature(aggregator, signer): add Mimalloc has Jemalloc replacement fo…
turmelclem Mar 10, 2026
ad437b2
docs: remove mentions of glibc
turmelclem Mar 10, 2026
5e9cfbc
refactor(relay): download adduser dependency for docker image
turmelclem Mar 13, 2026
17d661f
refactor(chore): check glibc version only with dynamic binary after d…
turmelclem Mar 13, 2026
d83c57b
refactor(client-cli): switch default allocator to Jemalloc (Linux) or…
turmelclem Mar 13, 2026
18833bd
refactor(client): update documentation about TLS usage
turmelclem Mar 16, 2026
d42f47a
refactor(ci): check for all binaries static instead of just the client
turmelclem Mar 16, 2026
820b1e9
refactor(chore): improve static binaries check verification in instal…
turmelclem Mar 16, 2026
b79ee82
refactor(cargo.lock): downgrading yamux version because of a vulnerab…
turmelclem Mar 16, 2026
daec30d
refactor(ci, flake): avoid pkgs redefinition
turmelclem Mar 16, 2026
d598dec
fix(ci): flakiness in decentralized e2e test
jpraynaud Mar 17, 2026
d51ff3d
refactor(ci, aggregator): rework CI build using '--bins -p' instead o…
turmelclem Mar 18, 2026
7cd8f24
refactor(ci): simplify toolchain installation
turmelclem Mar 18, 2026
92852e7
refactor(ci, relay, client): fix some wording and ordering features
turmelclem Mar 18, 2026
f594f4f
refactor(ci): split static binaries verification in three steps based…
turmelclem Mar 18, 2026
ee96cd5
refactor(ci, hydra): remove docheck=false to trigger unit tests
turmelclem Mar 18, 2026
48efe75
refactor(ci): rework binaries dependencies check on windows with a li…
turmelclem Mar 18, 2026
344c62a
refactor(examples): specify rustls-tls feature inside mithril-client …
turmelclem Mar 19, 2026
f22cbfc
refactor(signer, relay, end-to-end) set rustls-tls has default feature
turmelclem Mar 19, 2026
38a1fb8
docs: update CHANGELOG
turmelclem Mar 19, 2026
e028b52
chore: upgrade crate versions and `mithril-test-lab/mithril-devnet/VE…
turmelclem Mar 18, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ inputs:
common-build-args:
description: Arguments that will be passed to both bin & lib 'cargo build'
required: false
binaries-to-check-static:
description: Comma-separated list of binaries to check for static builds (e.g., mithril-client,mithril-aggregator). Leave empty to skip static build checks.
required: false
default: ""
binaries-build-target:
description: Build target directory name (e.g., x86_64-unknown-linux-musl). Leave empty for default target/release
required: false
default: ""

runs:
using: "composite"
steps:
Expand All @@ -18,6 +27,16 @@ runs:
shell: bash
run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Resolve build target path
id: build-path
shell: bash
run: |
if [ -z "${{ inputs.binaries-build-target }}" ]; then
echo "path=target/release" >> $GITHUB_OUTPUT
else
echo "path=target/${{ inputs.binaries-build-target }}/release" >> $GITHUB_OUTPUT
fi

- name: Set up Python
uses: actions/setup-python@v6
with:
Expand All @@ -38,19 +57,32 @@ runs:
# Build only the libraries for the crates that are published to crates.io
run: cargo build --lib --release ${{ inputs.libraries-build-args }} ${{ inputs.common-build-args }}

- name: Verification of static compilation
uses: ./.github/workflows/actions/check-static-binaries
with:
binaries: ${{ inputs.binaries-to-check-static }}
target-path: ${{ steps.build-path.outputs.path }}

- name: Move binaries before upload
shell: bash
# Put all binaries in a single folder to avoid upload-artifact action keeping the least common ancestor as the root directory
run: |
mkdir -p binaries
cp target/release/libmithril_stm.* binaries/ || true
cp target/release/libmithril_client.* binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-aggregator binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-aggregator.exe binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-client binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-client.exe binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-signer binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-signer.exe binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-relay binaries/ || true
cp ${{ steps.build-path.outputs.path }}/mithril-relay.exe binaries/ || true

- name: Publish Mithril Distribution (${{ runner.os }}-${{ runner.arch }})
uses: actions/upload-artifact@v5
with:
name: mithril-distribution-${{ runner.os }}-${{ runner.arch }}
path: |
target/release/libmithril_stm.*
target/release/libmithril_client.*
target/release/mithril-aggregator
target/release/mithril-aggregator.exe
target/release/mithril-client
target/release/mithril-client.exe
target/release/mithril-signer
target/release/mithril-signer.exe
target/release/mithril-relay
target/release/mithril-relay.exe
binaries/*
if-no-files-found: error
193 changes: 193 additions & 0 deletions .github/workflows/actions/check-static-binaries/action.yml
Comment thread
turmelclem marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
name: check-static-binaries
description: Verify that binaries are statically linked (cross-platform support)

inputs:
binaries:
description: "Comma-separated list of binary names to check"
required: true
target-path:
description: "Path to the directory containing the binaries"
required: true
default: "target/release"

runs:
using: composite
steps:
- name: Check Linux static binaries
if: runner.os == 'Linux'
shell: pwsh
run: |
$BINARIES = "${{ inputs.binaries }}"
$TARGET_PATH = "${{ inputs.target-path }}"

foreach ($bin in $BINARIES -split ",") {
$bin = $bin.Trim()
$BIN_PATH = "$TARGET_PATH/$bin"

Write-Host "Checking $bin is statically linked..."

if (-Not (Test-Path $BIN_PATH)) {
Write-Host "❌ Binary not found at $BIN_PATH"
exit 1
}

$output = & readelf -d $BIN_PATH 2>$null | Select-String NEEDED
if ($output) {
Write-Host "❌ $bin is NOT static (has dynamic dependencies)"
exit 1
}
Write-Host "✅ $bin is fully static"
}

Write-Host "🎉 All binaries are static!"
exit 0

- name: Check macOS static binaries
if: runner.os == 'macOS'
shell: pwsh
run: |
$BINARIES = "${{ inputs.binaries }}"
$TARGET_PATH = "${{ inputs.target-path }}"

$MACOS_ALLOWED_DEPS = @(
"/System/Library/Frameworks/Security.framework",
"/System/Library/Frameworks/SystemConfiguration.framework",
"/System/Library/Frameworks/CoreFoundation.framework",
"/usr/lib/libiconv",
"/usr/lib/libSystem"
)

function IsMacosAllowed {
param([string]$dep)
foreach ($allowed in $MACOS_ALLOWED_DEPS) {
if ($dep -like "$allowed*") {
return $true
}
}
return $false
}

foreach ($bin in $BINARIES -split ",") {
$bin = $bin.Trim()
$BIN_PATH = "$TARGET_PATH/$bin"

Write-Host "Checking $bin is statically linked..."

if (-Not (Test-Path $BIN_PATH)) {
Write-Host "❌ Binary not found at $BIN_PATH"
exit 1
}

$disallowed_deps = @()
$otool_output = & otool -L $BIN_PATH 2>$null | Select-Object -Skip 1

foreach ($line in $otool_output) {
$dep = ($line -split '\s+')[0]

if ([string]::IsNullOrWhiteSpace($dep) -or $dep -like "@*") {
continue
}

if (-Not (IsMacosAllowed $dep)) {
$disallowed_deps += $dep
}
}

if ($disallowed_deps.Count -gt 0) {
Write-Host "❌ $bin has disallowed dynamic dependencies:"
foreach ($dep in $disallowed_deps) {
Write-Host " - $dep"
}
exit 1
}
Write-Host "✅ $bin is fully static (or has only whitelisted system dependencies)"
}

Write-Host "🎉 All binaries are static!"
exit 0

- name: Check Windows static binaries
if: runner.os == 'Windows'
shell: bash
run: |
set -euo pipefail

BINARIES="${{ inputs.binaries }}"
TARGET_PATH="${{ inputs.target-path }}"

WHITELIST=(
"KERNEL32.dll"
"ntdll.dll"
"bcryptprimitives.dll"
"advapi32.dll"
"secur32.dll"
"ws2_32.dll"
"crypt32.dll"
"bcrypt.dll"
"api-ms-win-core-synch-l1-2-0.dll"
"userenv.dll"
"VCRUNTIME140.dll"
"api-ms-win-crt-math-l1-1-0.dll"
"api-ms-win-crt-string-l1-1-0.dll"
"api-ms-win-crt-heap-l1-1-0.dll"
"api-ms-win-crt-stdio-l1-1-0.dll"
"api-ms-win-crt-runtime-l1-1-0.dll"
"api-ms-win-crt-locale-l1-1-0.dll"
)

check_binary() {
local bin="$1"
local path="$TARGET_PATH/${bin}.exe"

echo "Checking $bin is statically linked..."

if [[ ! -f "$path" ]]; then
echo "❌ Binary not found at $path"
exit 1
fi

DLLS=$(objdump -p "$path" | grep "DLL Name" | awk '{print $3}' || true)

echo "Detected DLLs:"
echo "$DLLS"

local non_whitelisted=()

while IFS= read -r dll; do
[[ -z "$dll" ]] && continue

local allowed=false
for w in "${WHITELIST[@]}"; do
if [[ "${dll^^}" == "${w^^}" ]]; then
allowed=true
break
fi
done

if [[ "$allowed" == false ]]; then
non_whitelisted+=("$dll")
fi
done <<< "$DLLS"

if [[ ${#non_whitelisted[@]} -eq 0 ]]; then
echo "✅ $bin is fully static (or has only whitelisted system dependencies)"
else
echo "❌ $bin is NOT static"
echo "Unexpected DLLs:"
for dll in "${non_whitelisted[@]}"; do
echo " - $dll"
done
exit 1
fi

echo
}

IFS=',' read -ra BIN_ARRAY <<< "$BINARIES"

for raw in "${BIN_ARRAY[@]}"; do
bin="$(echo "$raw" | xargs)" # trim
check_binary "$bin"
done

echo "🎉 All binaries are static!"
3 changes: 0 additions & 3 deletions .github/workflows/actions/prepare-distribution/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ runs:

⁽\*⁾⚠️ Linux arm64 builds are provided on a best-effort basis and are not officially supported.

### Linux Requirements
The Linux binaries target \`glibc\`: to run them or install the \`.deb\` packages you must have \`glibc\` version \`2.35+\` installed.
Compatible systems include, but are not limited to, \`Ubuntu 22.04+\` or \`Debian 12+\` (Bookworm)).
EOF

- name: Fetch the latest version of the unstable tag
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/actions/toolchain-and-cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: toolchain-and-cache
description: Install the stable cargo toolchain, the given cargo tools, and try to restore cache
inputs:
targets:
description: Comma-separated list of rust target triples to install for this toolchain
required: false
cache-version:
description: Version of the current cache
required: false
Expand All @@ -20,6 +23,7 @@ runs:
with:
toolchain: stable
components: clippy, rustfmt
targets: ${{ inputs.targets }}

- name: Rust Cache
uses: Swatinem/rust-cache@v2
Expand Down
Loading
Loading