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
1 change: 1 addition & 0 deletions .github/workflows/dkg-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ jobs:
CI: "true"
NODES: "4"
THRESHOLD: "3"
EXPECT_VALIDATORS: "1"
PLUTO_NODES: ${{ matrix.pluto_nodes }}
CHARON_NODES: ${{ matrix.charon_nodes }}
CHARON_BIN: ${{ github.workspace }}/bin/charon
Expand Down
14 changes: 11 additions & 3 deletions scripts/dkg-runner/ci/verify-output-semantic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
# verify-output-semantic.sh — semantic checks for DKG runner output.
#
# Env:
# WORK_DIR scratch directory used by run.sh (default: /tmp/dkg-run)
# NODES total node count (default: 4)
# THRESHOLD expected threshold (default: 3)
# WORK_DIR scratch directory used by run.sh (default: /tmp/dkg-run)
# NODES total node count (default: 4)
# THRESHOLD expected threshold (default: 3)
# EXPECT_VALIDATORS expected distributed validator count (default: 1)
#
# Checks:
# - every node lock is JSON-identical
# - lock operator count, threshold, validator count are consistent
# - distributed validator count equals EXPECT_VALIDATORS (default: exactly one)
# - every validator has one public share per node
# - validator pubkey matches deposit data and builder registration pubkeys
# - every node keystore pubkey set matches that node's public shares
Expand All @@ -20,6 +22,7 @@ set -euo pipefail
WORK_DIR="${WORK_DIR:-/tmp/dkg-run}"
NODES="${NODES:-4}"
THRESHOLD="${THRESHOLD:-3}"
EXPECT_VALIDATORS="${EXPECT_VALIDATORS:-1}"
OUTPUT_DIR="${WORK_DIR}/output"
TMP_DIR="${WORK_DIR}/semantic-verify"

Expand Down Expand Up @@ -120,6 +123,11 @@ declared_validators="$(jq -r '(.cluster_definition // .definition).num_validator
|| fail "distributed validator count mismatch: got ${validator_count}, definition says ${declared_validators}"
(( validator_count > 0 )) || fail "validator count must be greater than zero"

# A ceremony creates exactly one validator by default; override
# EXPECT_VALIDATORS for multi-validator runs.
[[ "${validator_count}" == "${EXPECT_VALIDATORS}" ]] \
|| fail "validator count ${validator_count} != expected ${EXPECT_VALIDATORS}"

# Lock hash and aggregate signature must have valid byte lengths.
lock_hash="$(jq -r "${norm_hex_jq}"'(.lock_hash // empty) | normhex' "${LOCK}")"
[[ -n "${lock_hash}" ]] || fail "missing lock_hash"
Expand Down
4 changes: 3 additions & 1 deletion scripts/dkg-runner/start-nodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ DEF_FILE="${WORK_DIR}/cluster-definition.json"
PID_FILE="${WORK_DIR}/pids"

# ── Pre-flight ───────────────────────────────────────────────────────────────
require_bin "charon" "${CHARON_BIN}" || exit 1
if (( CHARON_NODES > 0 )); then
require_bin "charon" "${CHARON_BIN}" || exit 1
fi
if (( PLUTO_NODES > 0 )); then
require_bin "pluto" "${PLUTO_BIN}" || exit 1
fi
Expand Down
Loading