igneum/infra/cloud-devnet/experiments/collect.sh
igneum-labs 8255839d9e Cloud devnet: two Singapore partitions and the hash-rate steps on the 12-node network, results and bench-log entry
partition.sh adapted to private-network mode: the cut sits on the region's gateway (INPUT, OUTPUT and FORWARD
against the far gateways' public IPs over 26611 and the DNAT ports 27001:27099), since a per-node port-26611 rule
leaves the DNAT links up. It now records the locks per side at cut, during, at heal and after convergence, the
first lock after the heal from the journals, and the heal time as each minority node's first chain removal of 5+
blocks (the sink-count criterion is tip churn on a healthy network). hop.sh and partition.sh hold the Mac awake
with caffeinate; analyze.py gains a 10-s hop series (difficulty, block count, 1- and 2-min rates, threads) and an
overshoot table; collect.sh writes hop-series.tsv and hop.md and gzips the journals.

Results 2026-10-04: partition 1 (window still filling) reorg 431/496 on the minority, 2 on the majority, healed in
10 and 14 s; partition 2 (locks active): minority locked nothing during the cut, majority locked every interval at
66.8% to 84.5% of total, 0 conflicting locks over 107 indices, healed in 11 and 15 s, first lock after heal 13 s.
Hash-rate steps x1.42, x0.70, x0.75, x1.32: difficulty overshoots x1.67, x0.66, x0.53, x1.60, settle 751 s,
never in 900 s, 241 s, 646 s. Failures stated in summary.md: the Mac hibernated during the hop (phase 2 ran 94
min), the first partition could not see locks, the script's heal and first-lock figures were artefacts (fixed),
and another agent's v2 rollout restarted every node during the second heal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-04 14:39:54 +00:00

44 lines
2.9 KiB
Bash
Executable file

#!/usr/bin/env bash
# Pull logs and RPC samples from every node into results/<date>/nodes/<name>/ and write summary.md plus a
# bench-log entry template (results/<date>/bench-log-entry.md). APPEND_BENCH_LOG=1 also appends that entry to
# docs/bench-log.md (the log is append-only; edit the numbers in the entry file first if a run looked odd).
# ./experiments/collect.sh [date] default today (UTC)
. "$(dirname "$0")/../lib/common.sh"
require_nodes
out="$(results_dir_for "${1:-}")"; mkdir -p "$out/nodes"
log "collecting into $out"
cp "$NODES_FILE" "$out/nodes.tsv"
[ -f "$BIN_DIR/version.txt" ] && cp "$BIN_DIR/version.txt" "$BIN_DIR/src.stamp" "$out/" 2>/dev/null
while IFS=$'\t' read -r -u 3 name idx reg ip access pub port; do
(
d="$out/nodes/$name"; mkdir -p "$d"
nssh "$ip" "journalctl -u igneumd --no-pager -o short-iso --since -24h | tail -c 30000000" > "$d/igneumd.log" 2>/dev/null
gzip -9 -f "$d/igneumd.log" # 8 MB per node per 4 h uncompressed; results/ is committed, so the journal is kept gzipped (zcat / zgrep)
nssh "$ip" "journalctl -u igneum-miner --no-pager -o short-iso --since -24h | tail -c 5000000" > "$d/miner.log" 2>/dev/null
for f in blocks chain samples; do nscp "$SSH_USER@$ip:/var/log/igneum/$f.tsv" "$d/$f.tsv" 2>/dev/null || true; done
nssh "$ip" "chronyc tracking 2>/dev/null; echo; free -m; echo; df -h / | tail -1; echo; cat /etc/igneum/node.env" > "$d/host.txt" 2>/dev/null
for m in getInfo getBlockDagInfo getConnectedPeerInfo getFinalityWeights; do
nssh "$ip" "python3 /opt/igneum/bin/wrpc.py call $m" > "$d/$m.json" 2>/dev/null || true
done
nssh "$ip" "python3 /opt/igneum/bin/wrpc.py call getFinalityCheckpoints '{\"last\": 50}'" > "$d/getFinalityCheckpoints.json" 2>/dev/null || true
printf '[%s] %s blocks lines, %s chain lines, %s samples\n' "$name" "$(grep -c . "$d/blocks.tsv" 2>/dev/null || echo 0)" "$(grep -c . "$d/chain.tsv" 2>/dev/null || echo 0)" "$(grep -c . "$d/samples.tsv" 2>/dev/null || echo 0)"
) &
while [ "$(jobs -r | wc -l)" -ge 10 ]; do sleep 1; done
done 3< "$NODES_FILE"
wait
if [ -f "$out/hop.log" ]; then
python3 "$HERE/experiments/analyze.py" hop-series "$out" "$NODES_FILE" > "$out/hop-series.tsv"
python3 "$HERE/experiments/analyze.py" hop "$out" > "$out/hop.md"
log "wrote $out/hop-series.tsv ($(grep -c . "$out/hop-series.tsv") rows at 10 s) and hop.md"
fi
python3 "$HERE/experiments/analyze.py" summary "$out" "$NODES_FILE" | tee "$out/summary.md"
python3 "$HERE/experiments/analyze.py" bench-entry "$out" "$NODES_FILE" > "$out/bench-log-entry.md"
log "wrote $out/summary.md and $out/bench-log-entry.md"
if [ "${APPEND_BENCH_LOG:-0}" = 1 ]; then
{ printf '\n'; cat "$out/bench-log-entry.md"; } >> "$REPO/docs/bench-log.md"
log "appended the entry to docs/bench-log.md (review it before committing)"
else
log "APPEND_BENCH_LOG=1 appends the entry to docs/bench-log.md"
fi