-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
294 lines (240 loc) · 11.3 KB
/
justfile
File metadata and controls
294 lines (240 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# Dugite task runner. Install: https://github.com/casey/just
#
# Recipes are grouped: build & dev, run a network, local devnet, soak,
# monitoring, validation, mithril, dev/release. Run `just` (or `just --list`)
# to see them all.
set shell := ["bash", "-cu"]
set positional-arguments := true
# Show the recipe list.
default:
@just --list --unsorted
# ─── Build & dev ─────────────────────────────────────────────────────────────
# Release build of every workspace target.
build:
cargo build --release --all-targets
# Run all workspace tests under nextest (matches CI).
test:
cargo nextest run --workspace
# Run doc tests (nextest can't, so this stays cargo test).
test-doc:
cargo test --doc
# Lint with clippy; warnings are errors.
clippy:
cargo clippy --all-targets -- -D warnings
# Apply rustfmt across the workspace.
fmt:
cargo fmt --all
# Verify rustfmt is clean (CI gate).
fmt-check:
cargo fmt --all -- --check
# Full CI gate: fmt-check, clippy, build, test, doc-test.
check: fmt-check clippy build test test-doc
# ─── Run a network ───────────────────────────────────────────────────────────
# Run dugite as a block producer on a given network (mainnet|preview|preprod).
run-bp network:
./scripts/run/bp-{{network}}.sh
# Run dugite as a relay on a given network (mainnet|preview|preprod).
run-relay network:
./scripts/run/relay-{{network}}.sh
# Import a Mithril snapshot to seed the database. NETWORK ∈ preview|preprod|mainnet.
mithril-import network:
./scripts/mithril/import.sh {{network}}
# ─── Local devnet (testnet/local-devnet) ─────────────────────────────────────
# First-time setup: render configs, generate keys, fetch reference binaries.
devnet-setup:
./testnet/local-devnet/setup.sh
# Start dugite-bp, dugite-relay, and cardano-node-bp on the loopback testnet.
devnet-run:
./testnet/local-devnet/run.sh
# Run the 30-minute local-devnet soak.
devnet-soak:
./testnet/local-devnet/soak.sh
# Validate evidence captured by the last devnet run/soak.
devnet-verify:
#!/usr/bin/env bash
set -euo pipefail
cd testnet/local-devnet
latest=$(ls -t evidence 2>/dev/null | head -1)
[ -z "$latest" ] && { echo "No evidence directories found in testnet/local-devnet/evidence/"; exit 1; }
./verify.sh "evidence/$latest"
# Stop all local-devnet processes.
devnet-stop:
./testnet/local-devnet/stop.sh
# Generate a release report from the most recent evidence directory.
# Usage: just devnet-report [TAG]
devnet-report TAG="":
#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT="$(pwd)"
cd testnet/local-devnet
latest=$(ls -t evidence 2>/dev/null | head -1)
[ -z "$latest" ] && { echo "No evidence directories found in testnet/local-devnet/evidence/"; exit 1; }
tag_flag=""
[ -n "{{TAG}}" ] && tag_flag="--tag {{TAG}}"
mkdir -p "$REPO_ROOT/reports/devnet-validate"
"$REPO_ROOT/.claude/skills/devnet-validate/scripts/generate-release-report.sh" \
--preset standard \
$tag_flag \
--output-dir "$REPO_ROOT/reports/devnet-validate" \
"evidence/$latest"
echo "Report written to reports/devnet-validate/"
# Run smoke devnet-validate (single boot, ~5 min). PR gate for core crates.
devnet-validate-smoke:
#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT="$(pwd)"
cd testnet/local-devnet
./setup.sh
./run.sh
trap './stop.sh 2>/dev/null || true' EXIT
# Wait for relay socket
for i in $(seq 1 30); do
sleep 2
[ -S "/tmp/ld-$(id -u)/relay.sock" ] && break
done
# Wait for 3+ blocks
for i in $(seq 1 30); do
sleep 3
B=$(cardano-cli query tip --testnet-magic 42 --socket-path "/tmp/ld-$(id -u)/relay.sock" 2>/dev/null | jq -r '.block // 0' || echo 0)
[ "$B" -ge 3 ] && break
done
# Smoke = tx-zoo correctness + log-level predicate only.
# verify.sh's tip-parity / tx-inclusion predicates require sustained soak
# evidence and live in the standard/extended presets.
EVD="evidence/smoke-$(date -u +%Y%m%dT%H%M%SZ)"
mkdir -p "$EVD"
EVIDENCE_DIR="$EVD" ./tx-zoo/run-all.sh 01-bookkeeping 02-native-scripts 08-negative
EVIDENCE_DIR="$EVD" ./perf/log-level-predicate.sh
./stop.sh 2>/dev/null || true
"$REPO_ROOT/.claude/skills/devnet-validate/scripts/generate-release-report.sh" \
--preset smoke \
--output-dir "$REPO_ROOT/reports/devnet-validate" \
"$EVD"
echo "Smoke report written to reports/devnet-validate/"
# Run extended devnet-validate (~75 min). Used for release tagging.
devnet-validate-extended:
#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT="$(pwd)"
cd testnet/local-devnet
ROUND_DIRS=()
for ROUND in 1 2 3; do
EVD="evidence/round${ROUND}-$(date -u +%Y%m%dT%H%M%SZ)"
mkdir -p "$EVD"
./setup.sh
./run.sh &
DEVNET_PID=$!
trap 'kill $DEVNET_PID 2>/dev/null; ./stop.sh 2>/dev/null || true' RETURN
for i in $(seq 1 30); do sleep 2; [ -S "/tmp/ld-$(id -u)/relay.sock" ] && break; done
for i in $(seq 1 30); do
sleep 3
B=$(cardano-cli query tip --testnet-magic 42 --socket-path "/tmp/ld-$(id -u)/relay.sock" 2>/dev/null | jq -r '.block // 0' || echo 0)
[ "$B" -ge 5 ] && break
done
EVIDENCE_DIR="$EVD" ./tx-zoo/run-all.sh
EVIDENCE_DIR="$EVD" ./sync/bulk-sync-throughput.sh
EVIDENCE_DIR="$EVD" ./perf/resource-health.sh
EVIDENCE_DIR="$EVD" ./perf/log-level-predicate.sh
EVIDENCE_DIR="$EVD" ./perf/determinism-feasibility.sh
[ "$ROUND" -eq 2 ] && {
sleep 300 # extra wait for epoch boundary
EVIDENCE_DIR="$EVD" ./tx-zoo/run-all.sh 10-gov-lifecycle
}
./verify.sh "$EVD"
./stop.sh 2>/dev/null || true
ROUND_DIRS+=("$EVD")
done
"$REPO_ROOT/.claude/skills/devnet-validate/scripts/generate-release-report.sh" \
--preset extended \
--output-dir "$REPO_ROOT/reports/devnet-validate" \
"${ROUND_DIRS[@]}"
echo "Extended report written to reports/devnet-validate/"
# ─── Preview Sandstone soak (BP-pair + bare-BP) ──────────────────────────────
# Launch the 6h orchestrated soak (Haskell relay + dugite BP).
soak-6h:
./scripts/soak/run-6h.sh
# Launch the 6h orchestrated soak using a bare BP (no local Haskell relay).
soak-bare-bp:
./scripts/soak/run-bare-bp.sh
# Show progress of a running 6h soak.
soak-status:
./scripts/soak/status-6h.sh
# ─── Monitoring (Prometheus + Grafana) ───────────────────────────────────────
# Start the local Prometheus + Grafana stack (Docker).
monitor-start:
./scripts/monitoring/start.sh
# Stop the monitoring stack.
monitor-stop:
./scripts/monitoring/start.sh stop
# Show monitoring container status.
monitor-status:
./scripts/monitoring/start.sh status
# Tail the dugite Prometheus endpoint (port defaults to 12798).
watch-metrics port="12798":
./scripts/monitoring/watch-metrics.sh {{port}}
# ─── Validation rigs ─────────────────────────────────────────────────────────
# N2C compatibility suite: run dugite-cli queries against both nodes and diff.
compat-n2c *args="":
./scripts/validation/n2c-compat-test.sh {{args}}
# Leader-schedule N2C compatibility test.
compat-leader *args="":
./scripts/validation/leader-schedule-compat.sh {{args}}
# Submit N self-to-self transactions on preview (default 100).
submit-txs n="100":
N={{n}} ./scripts/validation/submit-txs.sh
# Mempool stress: spam dugite with txs.
stress-test:
./scripts/validation/stress-test.sh
# Relay-fetch stress (long-running chain prefetch).
stress-relay:
./scripts/validation/relay-stress-test.sh
# Benchmark sweep over pipeline depths.
benchmark-pipeline:
./scripts/validation/benchmark-pipeline-depth.sh
# ─── Dual-decode validation (M5 pallas-removal infrastructure) ───────────────
# Local smoke run: serialization tests with DUGITE_DUAL_DECODE=panic (mirrors the PR CI job).
dual-decode-smoke:
DUGITE_DUAL_DECODE=panic \
cargo nextest run \
-p dugite-serialization \
--features dugite-serialization/pallas-shadow-decode \
--no-fail-fast
# Run the dual-decode soak on NETWORK (preview|preprod|mainnet|devnet).
# Pass MAX_BLOCKS as second arg to limit blocks applied (0 = unlimited).
# Accepts extra flags: --with-mithril
dual-decode-soak NETWORK="preview" MAX_BLOCKS="0" *FLAGS="":
./scripts/validation/dual-decode-soak.sh {{NETWORK}} {{MAX_BLOCKS}} {{FLAGS}}
# Summarise mismatch artefacts in DIR (default ./dual_decode_mismatches/).
# Exits 0 if clean, 1 if mismatches present.
dual-decode-report DIR="./dual_decode_mismatches":
python3 ./scripts/validation/dual-decode-report.py {{DIR}}
# ─── Upstream conformance corpus ─────────────────────────────────────────────
# Download all upstream conformance fixture areas from the pinned dugite release.
# See tests/conformance/upstream/manifest.toml for the release tag.
download-upstream-fixtures:
cargo xtask download-upstream-fixtures
# Download a single upstream conformance fixture area.
download-upstream-fixtures-area AREA:
cargo xtask download-upstream-fixtures --area {{AREA}}
# Run the full upstream conformance test suite (all areas, REQUIRE mode).
test-upstream:
DUGITE_REQUIRE_UPSTREAM=1 cargo nextest run -p dugite-uplc --features upstream-conformance --test conformance
DUGITE_REQUIRE_UPSTREAM=1 cargo nextest run -p dugite-conformance --features upstream-conformance --test upstream_tests
# Run the regeneration pipeline locally (produces tarballs in target/conformance-corpus/).
regenerate-corpus-local:
bash scripts/regenerate-conformance-corpus/regenerate.sh --local
# ─── UPLC conformance ────────────────────────────────────────────────────────
# Run the UPLC conformance test suite (requires the corpus to have been fetched).
# Uses the unified fixture root (tests/conformance/upstream/fixtures/plutus/).
uplc-conformance:
cargo nextest run -p dugite-uplc --features upstream-conformance --test conformance
# ─── Dev / release ───────────────────────────────────────────────────────────
# Regenerate docs/src/reference/third-party-licenses.md.
licenses:
python3 ./scripts/dev/generate-licenses.py > docs/src/reference/third-party-licenses.md
# Prune stale worktree branches.
clean-worktrees:
./scripts/dev/cleanup-worktree-branches.sh
# Query the connected dugite-node socket for tip info.
query-tip *args="":
./scripts/dev/query-tip.sh {{args}}