chore: rename node env vars and circuits scripts

This commit is contained in:
andrussal 2026-01-22 05:57:59 +01:00
parent 50ec0e9506
commit 015c884f9a
33 changed files with 301 additions and 198 deletions

14
Cargo.lock generated
View File

@ -1729,9 +1729,9 @@ checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
[[package]]
name = "fixed"
version = "1.29.0"
version = "1.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707070ccf8c4173548210893a0186e29c266901b71ed20cd9e2ca0193dfe95c3"
checksum = "c566da967934c6c7ee0458a9773de9b2a685bd2ce26a3b28ddfc740e640182f5"
dependencies = [
"az",
"bytemuck",
@ -5039,12 +5039,12 @@ dependencies = [
[[package]]
name = "netlink-sys"
version = "0.8.7"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23"
checksum = "cd6c30ed10fa69cc491d491b85cc971f6bdeb8e7367b7cde2ee6cc878d583fae"
dependencies = [
"bytes",
"futures",
"futures-util",
"libc",
"log",
"tokio",
@ -5708,9 +5708,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.105"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
dependencies = [
"unicode-ident",
]

View File

@ -15,7 +15,7 @@ resolver = "2"
[workspace.package]
categories = []
description = "Logos testing framework workspace (split out from nomos-node)"
description = "Logos testing framework workspace (split out from logos-blockchain-node)"
edition = "2024"
keywords = ["framework", "nomos", "testing"]
license = "MIT OR Apache-2.0"

View File

@ -150,7 +150,7 @@ This project is part of the Logos blockchain implementation.
- **Documentation**: https://logos-blockchain.github.io/logos-blockchain-testing/
- **Logos Project**: https://github.com/logos-co
- **Logos Node (repo: nomos-node)**: https://github.com/logos-co/nomos-node
- **Logos Node (repo: logos-blockchain-node)**: https://github.com/logos-co/logos-blockchain-node
## Support

View File

@ -18,10 +18,6 @@ const CHAOS_MAX_DELAY_SECS: u64 = 180;
const CHAOS_COOLDOWN_SECS: u64 = 240;
const CHAOS_DELAY_HEADROOM_SECS: u64 = 1;
// DA Testing Constants
const DA_CHANNEL_RATE: u64 = 1;
const DA_BLOB_RATE: u64 = 1;
#[tokio::main]
async fn main() {
runner_examples::defaults::init_node_log_dir_defaults(DeployerKind::Compose);
@ -79,7 +75,6 @@ async fn run_compose_case(
let mut plan = scenario
.wallets(TOTAL_WALLETS)
.transactions_with(|txs| txs.rate(MIXED_TXS_PER_BLOCK).users(TRANSACTION_WALLETS))
.da_with(|da| da.channel_rate(DA_CHANNEL_RATE).blob_rate(DA_BLOB_RATE))
.with_run_duration(run_duration)
.expect_consensus_liveness()
.build()?;

View File

@ -12,7 +12,6 @@ use tracing::{info, warn};
const MIXED_TXS_PER_BLOCK: u64 = 2;
const TOTAL_WALLETS: usize = 200;
const TRANSACTION_WALLETS: usize = 50;
const DA_BLOB_RATE: u64 = 1;
#[tokio::main]
async fn main() {
@ -43,7 +42,6 @@ async fn run_k8s_case(validators: usize, executors: usize, run_duration: Duratio
.with_capabilities(ObservabilityCapability::default())
.wallets(TOTAL_WALLETS)
.transactions_with(|txs| txs.rate(MIXED_TXS_PER_BLOCK).users(TRANSACTION_WALLETS))
.da_with(|da| da.blob_rate(DA_BLOB_RATE).headroom_percent(0))
.with_run_duration(run_duration)
.expect_consensus_liveness();

View File

@ -9,7 +9,6 @@ use tracing::{info, warn};
const MIXED_TXS_PER_BLOCK: u64 = 5;
const TOTAL_WALLETS: usize = 1000;
const TRANSACTION_WALLETS: usize = 500;
const DA_BLOB_RATE: u64 = 3;
const SMOKE_RUN_SECS_MAX: u64 = 30;
#[tokio::main]
@ -57,7 +56,6 @@ async fn run_local_case(validators: usize, executors: usize, run_duration: Durat
} else {
scenario
.transactions_with(|txs| txs.rate(MIXED_TXS_PER_BLOCK).users(TRANSACTION_WALLETS))
.da_with(|da| da.blob_rate(DA_BLOB_RATE))
.expect_consensus_liveness()
};

View File

@ -1,3 +1,3 @@
pub const DEFAULT_VALIDATORS: usize = 1;
pub const DEFAULT_EXECUTORS: usize = 1;
pub const DEFAULT_VALIDATORS: usize = 2;
pub const DEFAULT_EXECUTORS: usize = 0;
pub const DEFAULT_RUN_SECS: u64 = 60;

View File

@ -11,5 +11,5 @@ NOMOS_KZG_FILE="kzgrs_test_params"
NOMOS_KZG_CONTAINER_PATH="/kzgrs_test_params/kzgrs_test_params"
# Host-side circuit bundle locations used by helper scripts.
NOMOS_CIRCUITS_HOST_DIR_REL=".tmp/nomos-circuits-host"
NOMOS_CIRCUITS_LINUX_DIR_REL=".tmp/nomos-circuits-linux"
NOMOS_CIRCUITS_HOST_DIR_REL=".tmp/logos-blockchain-circuits-host"
NOMOS_CIRCUITS_LINUX_DIR_REL=".tmp/logos-blockchain-circuits-linux"

View File

@ -264,10 +264,10 @@ build_bundle::maybe_run_linux_build_in_docker() {
-e NOMOS_NODE_REV="${NOMOS_NODE_REV}" \
-e NOMOS_NODE_PATH="${node_path_env}" \
-e NOMOS_BUNDLE_DOCKER_PLATFORM="${DOCKER_PLATFORM}" \
-e NOMOS_CIRCUITS="/workspace/.tmp/nomos-circuits-linux" \
-e LOGOS_BLOCKCHAIN_CIRCUITS="/workspace/.tmp/nomos-circuits-linux" \
-e STACK_DIR="/workspace/.tmp/nomos-circuits-linux" \
-e HOST_DIR="/workspace/.tmp/nomos-circuits-linux" \
-e NOMOS_CIRCUITS="/workspace/.tmp/logos-blockchain-circuits-linux" \
-e LOGOS_BLOCKCHAIN_CIRCUITS="/workspace/.tmp/logos-blockchain-circuits-linux" \
-e STACK_DIR="/workspace/.tmp/logos-blockchain-circuits-linux" \
-e HOST_DIR="/workspace/.tmp/logos-blockchain-circuits-linux" \
-e NOMOS_EXTRA_FEATURES="${NOMOS_EXTRA_FEATURES:-}" \
-e BUNDLE_IN_CONTAINER=1 \
-e CARGO_HOME=/workspace/.tmp/cargo-linux \
@ -286,10 +286,10 @@ build_bundle::maybe_run_linux_build_in_docker() {
build_bundle::prepare_circuits() {
echo "==> Preparing circuits (version ${VERSION})"
if [ "${PLATFORM}" = "host" ]; then
CIRCUITS_DIR="${ROOT_DIR}/.tmp/nomos-circuits-host"
CIRCUITS_DIR="${ROOT_DIR}/.tmp/logos-blockchain-circuits-host"
NODE_TARGET="${ROOT_DIR}/.tmp/logos-blockchain-node-host-target"
else
CIRCUITS_DIR="${ROOT_DIR}/.tmp/nomos-circuits-linux"
CIRCUITS_DIR="${ROOT_DIR}/.tmp/logos-blockchain-circuits-linux"
# When building Linux bundles in Docker, avoid reusing the same target dir
# across different container architectures (e.g. linux/arm64 vs linux/amd64),
# as the native-host `target/debug` layout would otherwise get mixed.

View File

@ -187,6 +187,17 @@ build_test_image::docker_build() {
[ -f "${BASE_DOCKERFILE_PATH}" ] || build_test_image::fail "Base Dockerfile not found: ${BASE_DOCKERFILE_PATH}"
local host_platform=""
local target_platform=""
case "$(uname -m)" in
x86_64) host_platform="linux/amd64" ;;
arm64|aarch64) host_platform="linux/arm64" ;;
esac
case "${CIRCUITS_PLATFORM}" in
linux-x86_64) target_platform="linux/amd64" ;;
linux-aarch64) target_platform="linux/arm64" ;;
esac
local -a base_build_args=(
-f "${BASE_DOCKERFILE_PATH}"
-t "${BASE_IMAGE_TAG}"
@ -199,6 +210,10 @@ build_test_image::docker_build() {
if [ -n "${CIRCUITS_OVERRIDE}" ]; then
base_build_args+=(--build-arg "CIRCUITS_OVERRIDE=${CIRCUITS_OVERRIDE}")
fi
if [ -n "${host_platform}" ] && [ -n "${target_platform}" ] && [ "${host_platform}" != "${target_platform}" ]; then
base_build_args+=(--platform "${target_platform}")
base_build_args+=(--build-arg "RAPIDSNARK_FORCE_REBUILD=1")
fi
printf "Running:"
printf " %q" docker build "${base_build_args[@]}"
@ -211,6 +226,9 @@ build_test_image::docker_build() {
--build-arg "BASE_IMAGE=${BASE_IMAGE_TAG}"
"${ROOT_DIR}"
)
if [ -n "${host_platform}" ] && [ -n "${target_platform}" ] && [ "${host_platform}" != "${target_platform}" ]; then
final_build_args+=(--platform "${target_platform}")
fi
printf "Running:"
printf " %q" docker build "${final_build_args[@]}"

View File

@ -101,12 +101,12 @@ cargo_toml = root / "Cargo.toml"
txt = cargo_toml.read_text()
txt = txt.replace("\\n", "\n")
txt = re.sub(
r'(?ms)^\[patch\."https://github\.com/logos-co/logos-blockchain-node"\].*?(?=^\[|\Z)',
r'(?ms)^\[patch\."https://github\.com/logos-co/nomos-node"\].*?(?=^\[|\Z)',
"",
txt,
)
txt = re.sub(
r'(git = "https://github\.com/logos-co/logos-blockchain-node\.git", rev = ")[^"]+(")',
r'(git = "https://github\.com/logos-co/nomos-node\.git", rev = ")[^"]+(")',
r"\g<1>" + rev + r"\2",
txt,
)
@ -213,7 +213,7 @@ cargo_toml = root / "Cargo.toml"
txt = cargo_toml.read_text()
txt = txt.replace("\\n", "\n")
txt = re.sub(
r'(?ms)^\[patch\."https://github\.com/logos-co/logos-blockchain-node"\].*?(?=^\[|\Z)',
r'(?ms)^\[patch\."https://github\.com/logos-co/nomos-node"\].*?(?=^\[|\Z)',
"",
txt,
)

View File

@ -97,7 +97,7 @@ checks::print_kzg_params() {
if [ -f "${host_kzg_path}" ]; then
checks::ok "KZG params file exists"
else
checks::warn "KZG params file missing (DA workloads will fail); run: scripts/run/run-examples.sh <mode> (auto) or scripts/setup/setup-nomos-circuits.sh"
checks::warn "KZG params file missing (DA workloads will fail); run: scripts/run/run-examples.sh <mode> (auto) or scripts/setup/setup-logos-blockchain-circuits.sh"
fi
}

View File

@ -436,8 +436,8 @@ run_examples::prepare_bundles() {
HOST_TAR="${ROOT_DIR}/.tmp/nomos-binaries-host-${VERSION}.tar.gz"
LINUX_TAR="${ROOT_DIR}/.tmp/nomos-binaries-linux-${VERSION}.tar.gz"
if [ -n "${NOMOS_NODE_BIN:-}" ] && [ -x "${NOMOS_NODE_BIN}" ] && [ -n "${NOMOS_EXECUTOR_BIN:-}" ] && [ -x "${NOMOS_EXECUTOR_BIN}" ]; then
echo "==> Using pre-specified host binaries (NOMOS_NODE_BIN/NOMOS_EXECUTOR_BIN); skipping tarball restore"
if [ -n "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_NODE_BIN}" ] && [ -n "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN}" ]; then
echo "==> Using pre-specified host binaries (LOGOS_BLOCKCHAIN_NODE_BIN/LOGOS_BLOCKCHAIN_EXECUTOR_BIN); skipping tarball restore"
return 0
fi
@ -508,7 +508,7 @@ run_examples::validate_restored_bundle() {
common::die "KZG params missing at ${KZG_HOST_PATH}; ensure the tarball contains circuits."
fi
if [ "${MODE}" = "host" ] && ! { [ -n "${NOMOS_NODE_BIN:-}" ] && [ -x "${NOMOS_NODE_BIN:-}" ] && [ -n "${NOMOS_EXECUTOR_BIN:-}" ] && [ -x "${NOMOS_EXECUTOR_BIN:-}" ]; }; then
if [ "${MODE}" = "host" ] && ! { [ -n "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -n "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" ]; }; then
local tar_node tar_exec
tar_node="${RESTORED_BIN_DIR:-${ROOT_DIR}/testing-framework/assets/stack/bin}/logos-blockchain-node"
tar_exec="${RESTORED_BIN_DIR:-${ROOT_DIR}/testing-framework/assets/stack/bin}/logos-blockchain-executor"
@ -519,9 +519,9 @@ run_examples::validate_restored_bundle() {
"Restored executables do not match host architecture; provide a host-compatible binaries tarball."
echo "==> Using restored host binaries from tarball"
NOMOS_NODE_BIN="${tar_node}"
NOMOS_EXECUTOR_BIN="${tar_exec}"
export NOMOS_NODE_BIN NOMOS_EXECUTOR_BIN
LOGOS_BLOCKCHAIN_NODE_BIN="${tar_node}"
LOGOS_BLOCKCHAIN_EXECUTOR_BIN="${tar_exec}"
export LOGOS_BLOCKCHAIN_NODE_BIN LOGOS_BLOCKCHAIN_EXECUTOR_BIN
fi
}
@ -546,12 +546,26 @@ run_examples::ensure_compose_circuits_platform_default() {
arch="$(uname -m)"
case "${arch}" in
x86_64) COMPOSE_CIRCUITS_PLATFORM="linux-x86_64" ;;
arm64|aarch64) COMPOSE_CIRCUITS_PLATFORM="linux-aarch64" ;;
arm64|aarch64) COMPOSE_CIRCUITS_PLATFORM="linux-x86_64" ;;
*) COMPOSE_CIRCUITS_PLATFORM="linux-x86_64" ;;
esac
export COMPOSE_CIRCUITS_PLATFORM
}
run_examples::maybe_set_docker_platform() {
if [ "${MODE}" != "compose" ] || [ -n "${DOCKER_DEFAULT_PLATFORM:-}" ]; then
return 0
fi
case "${COMPOSE_CIRCUITS_PLATFORM:-}" in
linux-x86_64) DOCKER_DEFAULT_PLATFORM="linux/amd64" ;;
linux-aarch64) DOCKER_DEFAULT_PLATFORM="linux/arm64" ;;
*) return 0 ;;
esac
export DOCKER_DEFAULT_PLATFORM
}
run_examples::run() {
local kzg_path
kzg_path="$(run_examples::kzg_path_for_mode)"
@ -575,9 +589,9 @@ run_examples::run() {
NOMOS_TESTNET_IMAGE="${IMAGE}" \
NOMOS_CIRCUITS="${HOST_BUNDLE_PATH}" \
LOGOS_BLOCKCHAIN_CIRCUITS="${HOST_BUNDLE_PATH}" \
NOMOS_KZGRS_PARAMS_PATH="${kzg_path}" \
NOMOS_NODE_BIN="${NOMOS_NODE_BIN:-}" \
NOMOS_EXECUTOR_BIN="${NOMOS_EXECUTOR_BIN:-}" \
LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH="${kzg_path}" \
LOGOS_BLOCKCHAIN_NODE_BIN="${LOGOS_BLOCKCHAIN_NODE_BIN:-}" \
LOGOS_BLOCKCHAIN_EXECUTOR_BIN="${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" \
COMPOSE_CIRCUITS_PLATFORM="${COMPOSE_CIRCUITS_PLATFORM:-}" \
cargo run -p runner-examples --bin "${BIN}"
}
@ -593,10 +607,11 @@ run_examples::main() {
SETUP_OUT="$(common::tmpfile nomos-setup-output.XXXXXX)"
run_examples::ensure_compose_circuits_platform_default
run_examples::maybe_set_docker_platform
run_examples::maybe_rebuild_image
run_examples::maybe_restore_host_after_image
run_examples::validate_restored_bundle
run_examples::ensure_compose_circuits_platform_default
run_examples::run
}

View File

@ -25,8 +25,8 @@ witness generators).
Env overrides:
STACK_DIR Where to place the Linux bundle (default: testing-framework/assets/stack/kzgrs_test_params)
HOST_DIR Where to place the host bundle (default: .tmp/nomos-circuits-host)
LINUX_STAGE_DIR Optional staging dir for the Linux bundle (default: .tmp/nomos-circuits-linux)
HOST_DIR Where to place the host bundle (default: .tmp/logos-blockchain-circuits-host)
LINUX_STAGE_DIR Optional staging dir for the Linux bundle (default: .tmp/logos-blockchain-circuits-linux)
NOMOS_CIRCUITS_PLATFORM Force host platform (e.g., macos-aarch64)
NOMOS_CIRCUITS_REBUILD_RAPIDSNARK Set to 1 to force rebuild (host bundle only)
EOF
@ -76,7 +76,7 @@ setup_circuits_stack::fetch_bundle() {
if ! NOMOS_CIRCUITS_PLATFORM="${platform}" \
NOMOS_CIRCUITS_REBUILD_RAPIDSNARK="${rebuild}" \
"${ROOT_DIR}/scripts/setup/setup-nomos-circuits.sh" "${VERSION}" "${temp_dest}"; then
"${ROOT_DIR}/scripts/setup/setup-logos-blockchain-circuits.sh" "${VERSION}" "${temp_dest}"; then
rm -rf "${temp_dest}"
return 1
fi
@ -89,7 +89,7 @@ setup_circuits_stack::fetch_bundle() {
setup_circuits_stack::fetch_kzg_params() {
local dest_dir="$1"
local dest_file="${dest_dir}/${KZG_FILE}"
local url="${RAW_GITHUB_BASE_URL}/logos-co/logos-blockchain-node/${NOMOS_NODE_REV}/${DEFAULT_KZG_PARAMS_RELPATH}"
local url="${RAW_GITHUB_BASE_URL}/logos-co/nomos-node/${NOMOS_NODE_REV}/${DEFAULT_KZG_PARAMS_RELPATH}"
echo "Fetching KZG parameters from ${url}"
curl -fsSL "${url}" -o "${dest_file}"
@ -106,8 +106,8 @@ setup_circuits_stack::load_env() {
KZG_DIR_REL="${NOMOS_KZG_DIR_REL:-${DEFAULT_KZG_DIR_REL}}"
KZG_FILE="${NOMOS_KZG_FILE:-${DEFAULT_KZG_FILE}}"
HOST_DIR_REL_DEFAULT="${NOMOS_CIRCUITS_HOST_DIR_REL:-.tmp/nomos-circuits-host}"
LINUX_DIR_REL_DEFAULT="${NOMOS_CIRCUITS_LINUX_DIR_REL:-.tmp/nomos-circuits-linux}"
HOST_DIR_REL_DEFAULT="${NOMOS_CIRCUITS_HOST_DIR_REL:-.tmp/logos-blockchain-circuits-host}"
LINUX_DIR_REL_DEFAULT="${NOMOS_CIRCUITS_LINUX_DIR_REL:-.tmp/logos-blockchain-circuits-linux}"
VERSION="${VERSION:-${DEFAULT_CIRCUITS_VERSION}}"
STACK_DIR="${STACK_DIR:-${ROOT_DIR}/${KZG_DIR_REL}}"

View File

@ -7,16 +7,16 @@ fi
# Setup script for logos-blockchain-circuits
#
# Usage: scripts/setup/setup-nomos-circuits.sh [VERSION] [INSTALL_DIR]
# Usage: scripts/setup/setup-logos-blockchain-circuits.sh [VERSION] [INSTALL_DIR]
#
# Arguments:
# VERSION Optional. Version to install (default: v0.3.2)
# INSTALL_DIR Optional. Installation directory (default: $HOME/.logos-blockchain-circuits)
#
# Examples:
# scripts/setup/setup-nomos-circuits.sh
# scripts/setup/setup-nomos-circuits.sh v0.3.2
# scripts/setup/setup-nomos-circuits.sh v0.3.2 /opt/circuits
# scripts/setup/setup-logos-blockchain-circuits.sh
# scripts/setup/setup-logos-blockchain-circuits.sh v0.3.2
# scripts/setup/setup-logos-blockchain-circuits.sh v0.3.2 /opt/circuits
DEFAULT_CIRCUITS_VERSION="v0.3.2"
DEFAULT_INSTALL_DIR="${HOME}/.logos-blockchain-circuits"
@ -88,27 +88,51 @@ check_existing_installation() {
download_release() {
local platform="$1"
local artifact="logos-blockchain-circuits-${VERSION}-${platform}.tar.gz"
local url="https://github.com/${REPO}/releases/download/${VERSION}/${artifact}"
local artifact=""
local url=""
local temp_dir
temp_dir="$(mktemp -d)"
print_info "Downloading logos-blockchain-circuits ${VERSION} for ${platform}..."
print_info "URL: ${url}"
for attempt in 1 2; do
artifact="logos-blockchain-circuits-${VERSION}-${platform}.tar.gz"
url="https://github.com/${REPO}/releases/download/${VERSION}/${artifact}"
local curl_cmd="curl -L"
if [ -n "${GITHUB_TOKEN:-}" ]; then
curl_cmd="$curl_cmd --header 'authorization: Bearer ${GITHUB_TOKEN}'"
fi
curl_cmd="$curl_cmd -o ${temp_dir}/${artifact} ${url}"
print_info "Downloading logos-blockchain-circuits ${VERSION} for ${platform}..."
print_info "URL: ${url}"
local curl_cmd="curl -L"
if [ -n "${GITHUB_TOKEN:-}" ]; then
curl_cmd="$curl_cmd --header 'authorization: Bearer ${GITHUB_TOKEN}'"
fi
curl_cmd="$curl_cmd -o ${temp_dir}/${artifact} ${url}"
if eval "${curl_cmd}"; then
if tar -tzf "${temp_dir}/${artifact}" >/dev/null 2>&1; then
break
fi
if [ "${platform}" = "linux-aarch64" ] || [ "${platform}" = "linux-arm64" ]; then
print_warning "Downloaded artifact is not a valid tar.gz; falling back to linux-x86_64"
rm -f "${temp_dir}/${artifact}"
platform="linux-x86_64"
continue
fi
print_error "Downloaded artifact is not a valid tar.gz for ${platform}"
rm -rf "${temp_dir}"
exit 1
fi
if [ "${attempt}" -eq 1 ] && { [ "${platform}" = "linux-aarch64" ] || [ "${platform}" = "linux-arm64" ]; }; then
print_warning "No linux-aarch64 assets found; falling back to linux-x86_64"
platform="linux-x86_64"
continue
fi
if ! eval "${curl_cmd}"; then
print_error "Failed to download release artifact"
print_error "Please check that version ${VERSION} exists for platform ${platform}"
print_error "Available releases: https://github.com/${REPO}/releases"
rm -rf "${temp_dir}"
exit 1
fi
done
print_success "Download complete"

View File

@ -6,6 +6,7 @@ ARG VERSION
ARG CIRCUITS_OVERRIDE
ARG NOMOS_NODE_REV
ARG CIRCUITS_PLATFORM
ARG RAPIDSNARK_FORCE_REBUILD
# ===========================
# BUILD IMAGE
@ -17,6 +18,7 @@ ARG VERSION
ARG CIRCUITS_OVERRIDE
ARG NOMOS_NODE_REV
ARG CIRCUITS_PLATFORM
ARG RAPIDSNARK_FORCE_REBUILD
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \
@ -28,6 +30,7 @@ COPY . .
# Reduce debug artifact size.
ENV CARGO_PROFILE_DEV_DEBUG=0
ENV NOMOS_NODE_REV=${NOMOS_NODE_REV}
ENV RAPIDSNARK_FORCE_REBUILD=${RAPIDSNARK_FORCE_REBUILD}
# Install dependencies needed for building RocksDB and for circuit tooling.
RUN apt-get update && apt-get install -yq \
@ -39,7 +42,7 @@ RUN chmod +x \
/workspace/testing-framework/assets/stack/scripts/docker/prepare_binaries.sh \
/workspace/testing-framework/assets/stack/scripts/docker/build_cfgsync.sh \
/workspace/scripts/build/build-rapidsnark.sh \
/workspace/scripts/setup/setup-nomos-circuits.sh \
/workspace/scripts/setup/setup-logos-blockchain-circuits.sh \
|| true
RUN /workspace/testing-framework/assets/stack/scripts/docker/prepare_circuits.sh

View File

@ -5,6 +5,8 @@ timeout: 10
# ConsensusConfig related parameters
security_param: 10
active_slot_coeff: 0.9
wallet:
accounts: []
# DaConfig related parameters
subnetwork_size: 2

View File

@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
cargo build --all-features --manifest-path /workspace/testing-framework/tools/cfgsync_tf/Cargo.toml --bins
RUSTFLAGS='--cfg feature="pol-dev-mode"' \
cargo build --all-features --manifest-path /workspace/testing-framework/tools/cfgsync_tf/Cargo.toml --bins
cp /workspace/target/debug/cfgsync-server /workspace/artifacts/cfgsync-server
cp /workspace/target/debug/cfgsync-client /workspace/artifacts/cfgsync-client
rm -rf /workspace/target/debug/incremental

View File

@ -32,7 +32,7 @@ bin_matches_arch() {
}
if have_prebuilt && bin_matches_arch; then
echo "Using prebuilt nomos binaries from testing-framework/assets/stack/bin"
echo "Using prebuilt logos-blockchain binaries from testing-framework/assets/stack/bin"
cp testing-framework/assets/stack/bin/logos-blockchain-node /workspace/artifacts/logos-blockchain-node
cp testing-framework/assets/stack/bin/logos-blockchain-executor /workspace/artifacts/logos-blockchain-executor
cp testing-framework/assets/stack/bin/logos-blockchain-cli /workspace/artifacts/logos-blockchain-cli
@ -40,27 +40,37 @@ if have_prebuilt && bin_matches_arch; then
fi
if have_prebuilt; then
echo "Prebuilt nomos binaries do not match target architecture (${TARGET_ARCH}); rebuilding from source"
echo "Prebuilt logos-blockchain binaries do not match target architecture (${TARGET_ARCH}); rebuilding from source"
else
echo "Prebuilt nomos binaries missing; building from source"
echo "Prebuilt logos-blockchain binaries missing; building from source"
fi
echo "Building nomos binaries from source (rev ${NOMOS_NODE_REV})"
echo "Building logos-blockchain binaries from source (rev ${NOMOS_NODE_REV})"
git clone https://github.com/logos-co/nomos-node.git /tmp/nomos-node
cd /tmp/logos-blockchain-node
cd /tmp/nomos-node
git fetch --depth 1 origin "${NOMOS_NODE_REV}"
git checkout "${NOMOS_NODE_REV}"
git reset --hard
git clean -fdx
# Enable real verification keys when available.
if [ -f "/opt/circuits/zksign/verification_key.json" ] \
|| [ -f "/opt/circuits/pol/verification_key.json" ] \
|| [ -f "/opt/circuits/poq/verification_key.json" ] \
|| [ -f "/opt/circuits/poc/verification_key.json" ]; then
export CARGO_FEATURE_BUILD_VERIFICATION_KEY=1
else
unset CARGO_FEATURE_BUILD_VERIFICATION_KEY
fi
# Enable pol-dev-mode via cfg to let POL_PROOF_DEV_MODE short-circuit proofs in tests.
RUSTFLAGS='--cfg feature="pol-dev-mode"' NOMOS_CIRCUITS=/opt/circuits \
LOGOS_BLOCKCHAIN_CIRCUITS=/opt/circuits \
cargo build --features "testing" \
-p logos-blockchain-node -p logos-blockchain-executor -p logos-blockchain-cli
cp /tmp/logos-blockchain-node/target/debug/logos-blockchain-node /workspace/artifacts/logos-blockchain-node
cp /tmp/logos-blockchain-node/target/debug/logos-blockchain-executor /workspace/artifacts/logos-blockchain-executor
cp /tmp/logos-blockchain-node/target/debug/logos-blockchain-cli /workspace/artifacts/logos-blockchain-cli
cp /tmp/nomos-node/target/debug/logos-blockchain-node /workspace/artifacts/logos-blockchain-node
cp /tmp/nomos-node/target/debug/logos-blockchain-executor /workspace/artifacts/logos-blockchain-executor
cp /tmp/nomos-node/target/debug/logos-blockchain-cli /workspace/artifacts/logos-blockchain-cli
rm -rf /tmp/logos-blockchain-node/target/debug/incremental
rm -rf /tmp/nomos-node/target/debug/incremental

View File

@ -67,7 +67,10 @@ check_linux_exec() {
check_linux_exec /opt/circuits/zksign/witness_generator
check_linux_exec /opt/circuits/pol/witness_generator
if [ -f "/opt/circuits/prover" ]; then
if [ "${RAPIDSNARK_FORCE_REBUILD:-0}" = "1" ]; then
echo "Forcing rapidsnark rebuild for /opt/circuits"
scripts/build/build-rapidsnark.sh /opt/circuits
elif [ -f "/opt/circuits/prover" ]; then
PROVER_INFO="$(file -b /opt/circuits/prover || true)"
case "${TARGET_ARCH}" in
x86_64) EXPECT_ARCH="x86-64" ;;
@ -86,5 +89,5 @@ if [ "${require_linux_execs}" -eq 1 ] || [ ! -f "/opt/circuits/pol/verification_
NOMOS_CIRCUITS_PLATFORM="${CIRCUITS_PLATFORM}" \
NOMOS_CIRCUITS_REBUILD_RAPIDSNARK=1 \
RAPIDSNARK_BUILD_GMP=1 \
scripts/setup/setup-nomos-circuits.sh "${VERSION}" "/opt/circuits"
scripts/setup/setup-logos-blockchain-circuits.sh "${VERSION}" "/opt/circuits"
fi

View File

@ -38,7 +38,7 @@ check_binary_arch() {
}
bin_path="$(bin_for_role "$role")"
check_binary_arch "$bin_path" "nomos-${role}"
check_binary_arch "$bin_path" "logos-blockchain-${role}"
KZG_CONTAINER_PATH="${NOMOS_KZG_CONTAINER_PATH:-/kzgrs_test_params/kzgrs_test_params}"
host_identifier_default="${role}-$(hostname -i)"
@ -48,7 +48,7 @@ export CFG_FILE_PATH="/config.yaml" \
CFG_HOST_IP=$(hostname -i) \
CFG_HOST_KIND="${CFG_HOST_KIND:-$role}" \
CFG_HOST_IDENTIFIER="${CFG_HOST_IDENTIFIER:-$host_identifier_default}" \
NOMOS_KZGRS_PARAMS_PATH="${NOMOS_KZGRS_PARAMS_PATH:-${KZG_CONTAINER_PATH}}" \
LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH="${LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH:-${KZG_CONTAINER_PATH}}" \
NOMOS_TIME_BACKEND="${NOMOS_TIME_BACKEND:-monotonic}" \
LOG_LEVEL="${LOG_LEVEL:-INFO}" \
POL_PROOF_DEV_MODE="${POL_PROOF_DEV_MODE:-true}"

View File

@ -0,0 +1,118 @@
#!/bin/bash
#
# Setup script for logos-blockchain-circuits
#
# Usage: ./setup-logos-blockchain-circuits.sh [VERSION] [INSTALL_DIR]
# VERSION - Optional. Version to install (default: v0.3.1)
# INSTALL_DIR - Optional. Installation directory (default: $HOME/.logos-blockchain-circuits)
#
# Examples:
# ./setup-logos-blockchain-circuits.sh # Install default version to default location
# ./setup-logos-blockchain-circuits.sh v0.2.0 # Install specific version to default location
# ./setup-logos-blockchain-circuits.sh v0.2.0 /opt/circuits # Install to custom location
set -euo pipefail
readonly DEFAULT_CIRCUITS_VERSION="v0.3.1"
readonly DEFAULT_INSTALL_SUBDIR=".logos-blockchain-circuits"
readonly DEFAULT_CIRCUITS_REPO="logos-blockchain/logos-blockchain-circuits"
readonly CURL_RETRY_COUNT=5
readonly CURL_RETRY_DELAY_SECONDS=2
VERSION="${1:-${DEFAULT_CIRCUITS_VERSION}}"
DEFAULT_INSTALL_DIR="${HOME}/${DEFAULT_INSTALL_SUBDIR}"
INSTALL_DIR="${2:-${DEFAULT_INSTALL_DIR}}"
REPO="${DEFAULT_CIRCUITS_REPO}"
detect_platform() {
local os=""
local arch=""
case "$(uname -s)" in
Linux*) os="linux" ;;
Darwin*) os="macos" ;;
MINGW*|MSYS*|CYGWIN*) os="windows" ;;
*) echo "Unsupported operating system: $(uname -s)" >&2; exit 1 ;;
esac
case "$(uname -m)" in
x86_64) arch="x86_64" ;;
aarch64|arm64) arch="aarch64" ;;
*) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;;
esac
echo "${os}-${arch}"
}
download_release() {
local platform="$1"
local artifact=""
local url=""
local temp_dir
temp_dir=$(mktemp -d)
for attempt in 1 2; do
artifact="logos-blockchain-circuits-${VERSION}-${platform}.tar.gz"
url="https://github.com/${REPO}/releases/download/${VERSION}/${artifact}"
echo "Downloading logos-blockchain-circuits ${VERSION} for ${platform}..."
local -a curl_args=(
curl
-fL
--retry "${CURL_RETRY_COUNT}"
--retry-delay "${CURL_RETRY_DELAY_SECONDS}"
)
# `curl` is not guaranteed to support `--retry-all-errors`, so check before using it
# `curl --help` may be abbreviated on some platforms
if (curl --help all 2>/dev/null || curl --help 2>/dev/null) | grep -q -- '--retry-all-errors'; then
curl_args+=(--retry-all-errors)
fi
if [ -n "${GITHUB_TOKEN:-}" ]; then
curl_args+=(-H "Authorization: Bearer ${GITHUB_TOKEN}")
fi
curl_args+=(-o "${temp_dir}/${artifact}" "${url}")
if "${curl_args[@]}"; then
if tar -tzf "${temp_dir}/${artifact}" >/dev/null 2>&1; then
break
fi
if [ "${platform}" = "linux-aarch64" ] || [ "${platform}" = "linux-arm64" ]; then
echo "Downloaded artifact is not a valid tar.gz; falling back to linux-x86_64" >&2
rm -f "${temp_dir}/${artifact}"
platform="linux-x86_64"
continue
fi
echo "Downloaded artifact is not a valid tar.gz for ${platform}" >&2
rm -rf "${temp_dir}"
exit 1
fi
if [ "${attempt}" -eq 1 ] && { [ "${platform}" = "linux-aarch64" ] || [ "${platform}" = "linux-arm64" ]; }; then
echo "No linux-aarch64 assets found; falling back to linux-x86_64" >&2
platform="linux-x86_64"
continue
fi
echo "Failed to download release artifact from ${url}" >&2
rm -rf "${temp_dir}"
exit 1
done
echo "Extracting to ${INSTALL_DIR}..."
rm -rf "${INSTALL_DIR}"
mkdir -p "${INSTALL_DIR}"
if ! tar -xzf "${temp_dir}/${artifact}" -C "${INSTALL_DIR}" --strip-components=1; then
echo "Failed to extract ${artifact}" >&2
rm -rf "${temp_dir}"
exit 1
fi
rm -rf "${temp_dir}"
}
platform=$(detect_platform)
echo "Setting up logos-blockchain-circuits ${VERSION} for ${platform}"
echo "Installing to ${INSTALL_DIR}"
download_release "${platform}"
echo "Installation complete. Circuits installed at: ${INSTALL_DIR}"
echo "If using a custom directory, set LOGOS_BLOCKCHAIN_CIRCUITS=${INSTALL_DIR}"

View File

@ -1,94 +0,0 @@
#!/bin/bash
#
# Setup script for nomos-circuits
#
# Usage: ./setup-nomos-circuits.sh [VERSION] [INSTALL_DIR]
# VERSION - Optional. Version to install (default: v0.3.1)
# INSTALL_DIR - Optional. Installation directory (default: $HOME/.nomos-circuits)
#
# Examples:
# ./setup-nomos-circuits.sh # Install default version to default location
# ./setup-nomos-circuits.sh v0.2.0 # Install specific version to default location
# ./setup-nomos-circuits.sh v0.2.0 /opt/circuits # Install to custom location
set -euo pipefail
readonly DEFAULT_CIRCUITS_VERSION="v0.3.1"
readonly DEFAULT_INSTALL_SUBDIR=".nomos-circuits"
readonly DEFAULT_CIRCUITS_REPO="logos-co/nomos-circuits"
readonly CURL_RETRY_COUNT=5
readonly CURL_RETRY_DELAY_SECONDS=2
VERSION="${1:-${DEFAULT_CIRCUITS_VERSION}}"
DEFAULT_INSTALL_DIR="${HOME}/${DEFAULT_INSTALL_SUBDIR}"
INSTALL_DIR="${2:-${DEFAULT_INSTALL_DIR}}"
REPO="${DEFAULT_CIRCUITS_REPO}"
detect_platform() {
local os=""
local arch=""
case "$(uname -s)" in
Linux*) os="linux" ;;
Darwin*) os="macos" ;;
MINGW*|MSYS*|CYGWIN*) os="windows" ;;
*) echo "Unsupported operating system: $(uname -s)" >&2; exit 1 ;;
esac
case "$(uname -m)" in
x86_64) arch="x86_64" ;;
aarch64|arm64) arch="aarch64" ;;
*) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;;
esac
echo "${os}-${arch}"
}
download_release() {
local platform="$1"
local artifact="nomos-circuits-${VERSION}-${platform}.tar.gz"
local url="https://github.com/${REPO}/releases/download/${VERSION}/${artifact}"
local temp_dir
temp_dir=$(mktemp -d)
echo "Downloading nomos-circuits ${VERSION} for ${platform}..."
local -a curl_args=(
curl
-fL
--retry "${CURL_RETRY_COUNT}"
--retry-delay "${CURL_RETRY_DELAY_SECONDS}"
)
# `curl` is not guaranteed to support `--retry-all-errors`, so check before using it
# `curl --help` may be abbreviated on some platforms
if (curl --help all 2>/dev/null || curl --help 2>/dev/null) | grep -q -- '--retry-all-errors'; then
curl_args+=(--retry-all-errors)
fi
if [ -n "${GITHUB_TOKEN:-}" ]; then
curl_args+=(-H "Authorization: Bearer ${GITHUB_TOKEN}")
fi
curl_args+=(-o "${temp_dir}/${artifact}" "${url}")
if ! "${curl_args[@]}"; then
echo "Failed to download release artifact from ${url}" >&2
rm -rf "${temp_dir}"
exit 1
fi
echo "Extracting to ${INSTALL_DIR}..."
rm -rf "${INSTALL_DIR}"
mkdir -p "${INSTALL_DIR}"
if ! tar -xzf "${temp_dir}/${artifact}" -C "${INSTALL_DIR}" --strip-components=1; then
echo "Failed to extract ${artifact}" >&2
rm -rf "${temp_dir}"
exit 1
fi
rm -rf "${temp_dir}"
}
platform=$(detect_platform)
echo "Setting up nomos-circuits ${VERSION} for ${platform}"
echo "Installing to ${INSTALL_DIR}"
download_release "${platform}"
echo "Installation complete. Circuits installed at: ${INSTALL_DIR}"
echo "If using a custom directory, set NOMOS_CIRCUITS=${INSTALL_DIR}"

View File

@ -223,17 +223,30 @@ pub(crate) fn testing_http_config(
}
pub(crate) fn wallet_settings(config: &GeneralConfig) -> WalletServiceSettings {
WalletServiceSettings {
known_keys: {
let mut keys = HashSet::from_iter([config.consensus_config.leader_config.pk]);
keys.extend(
config
.consensus_config
.wallet_accounts
.iter()
.map(crate::topology::configs::wallet::WalletAccount::public_key),
);
keys
},
}
wallet_settings_with_leader(config, true)
}
pub(crate) fn wallet_settings_for_executor(config: &GeneralConfig) -> WalletServiceSettings {
wallet_settings_with_leader(config, false)
}
fn wallet_settings_with_leader(
config: &GeneralConfig,
include_leader: bool,
) -> WalletServiceSettings {
let mut keys = HashSet::new();
if include_leader {
keys.insert(config.consensus_config.leader_config.pk);
}
keys.extend(
config
.consensus_config
.wallet_accounts
.iter()
.map(crate::topology::configs::wallet::WalletAccount::public_key),
);
WalletServiceSettings { known_keys: keys }
}

View File

@ -20,7 +20,7 @@ use crate::{
common::{
cryptarchia_config, cryptarchia_deployment, da_sampling_config, da_verifier_config,
http_config, mempool_config, mempool_deployment, testing_http_config, time_config,
time_deployment, tracing_settings, wallet_settings,
time_deployment, tracing_settings, wallet_settings_for_executor,
},
},
timeouts,
@ -63,7 +63,7 @@ pub fn create_executor_config(config: GeneralConfig) -> ExecutorConfig {
time: time_config(&config),
mempool: mempool_config(),
sdp: SdpSettings { declaration: None },
wallet: wallet_settings(&config),
wallet: wallet_settings_for_executor(&config),
key_management: config.kms_config.clone(),
testing_http: testing_http_config(&config),
}

View File

@ -80,7 +80,7 @@ fn resolve_global_params_path() -> String {
warn!(
?err,
path = %params_path.display(),
"falling back to non-canonical KZG params path; set NOMOS_KZGRS_PARAMS_PATH to override"
"falling back to non-canonical KZG params path; set LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH to override"
);
params_path.to_string_lossy().to_string()
}

View File

@ -35,8 +35,8 @@ impl KzgMode {
pub struct KzgParamsSpec {
pub mode: KzgMode,
/// Value written into node configs (cfgsync `global_params_path`) and,
/// where applicable, exported as `NOMOS_KZGRS_PARAMS_PATH` for node
/// processes.
/// where applicable, exported as `LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH` for
/// node processes.
pub node_params_path: String,
/// Host directory that must exist when running in `HostPath` mode.
pub host_params_dir: Option<PathBuf>,

View File

@ -26,7 +26,7 @@ const BIN_PATH: &str = "target/debug/logos-blockchain-executor";
fn binary_path() -> PathBuf {
let cfg = BinaryConfig {
env_var: "NOMOS_EXECUTOR_BIN",
env_var: "LOGOS_BLOCKCHAIN_EXECUTOR_BIN",
binary_name: "logos-blockchain-executor",
fallback_path: BIN_PATH,
shared_bin_subpath: "../assets/stack/bin/logos-blockchain-executor",

View File

@ -22,7 +22,7 @@ const BIN_PATH: &str = "target/debug/logos-blockchain-node";
fn binary_path() -> PathBuf {
let cfg = BinaryConfig {
env_var: "NOMOS_NODE_BIN",
env_var: "LOGOS_BLOCKCHAIN_NODE_BIN",
binary_name: "logos-blockchain-node",
fallback_path: BIN_PATH,
shared_bin_subpath: "../assets/stack/bin/logos-blockchain-node",

View File

@ -192,7 +192,7 @@ fn base_environment(cfgsync_port: u16, use_kzg_mount: bool) -> Vec<EnvEntry> {
EnvEntry::new("RUST_LOG", rust_log),
EnvEntry::new("NOMOS_LOG_LEVEL", nomos_log_level),
EnvEntry::new("NOMOS_TIME_BACKEND", time_backend),
EnvEntry::new("NOMOS_KZGRS_PARAMS_PATH", kzg_path),
EnvEntry::new("LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH", kzg_path),
EnvEntry::new(
"CFG_SERVER_ADDR",
format!("http://host.docker.internal:{cfgsync_port}"),

View File

@ -33,7 +33,7 @@ spec:
value: http://{{ include "nomos-runner.fullname" $root }}-cfgsync:{{ $root.Values.cfgsync.port }}
- name: NOMOS_TIME_BACKEND
value: {{ $root.Values.timeBackend | default "monotonic" | quote }}
- name: NOMOS_KZGRS_PARAMS_PATH
- name: LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH
value: '{{ if eq $root.Values.kzg.mode "inImage" }}{{ $root.Values.kzg.inImageParamsPath }}{{ else }}{{ $root.Values.kzg.hostPathParamsPath }}{{ end }}'
{{- range $key, $value := $node.env }}
- name: {{ $key }}

View File

@ -33,7 +33,7 @@ spec:
value: http://{{ include "nomos-runner.fullname" $root }}-cfgsync:{{ $root.Values.cfgsync.port }}
- name: NOMOS_TIME_BACKEND
value: {{ $root.Values.timeBackend | default "monotonic" | quote }}
- name: NOMOS_KZGRS_PARAMS_PATH
- name: LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH
value: '{{ if eq $root.Values.kzg.mode "inImage" }}{{ $root.Values.kzg.inImageParamsPath }}{{ else }}{{ $root.Values.kzg.hostPathParamsPath }}{{ end }}'
{{- range $key, $value := $node.env }}
- name: {{ $key }}

View File

@ -89,7 +89,7 @@ pub fn nomos_time_backend() -> Option<String> {
#[must_use]
pub fn nomos_kzgrs_params_path() -> Option<String> {
env::var("NOMOS_KZGRS_PARAMS_PATH").ok()
env::var("LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH").ok()
}
#[must_use]