tools/harness: IGNEUM_HARNESS_BASE_PORT and IGNEUM_HARNESS_TMP move the test network's ports and data directory so two agents can run it at once; the u64 sentinel round-trip in overrideParams is fixed with the BigInt reviver from tools/finality-attacks (ledger F25); s6 records rss_start, rss_delta and cache_builds per load and reports per-load growth (the old row subtracted one baseline taken before all three loads, which is how the mempool flood was read as +270 MB); s7 counts "PoW cache built" lines beside every RSS sample; --live-only skips the s7 simulator part. docs/bench-log.md: the 4 October 2026 (night) entry: the floods' growth was one 256 MiB PoW cache per epoch roll (the engine kept a cache per (epoch, day) pair, KEEP 4), measured before and after the fork fix (fork branch fud-memory, 796f758d): submit load +263/+257 MB with 1/1 builds before, +9/+2 MB with 0/0 after; block flood 302 to 1,085 MB with 3/3 builds before, 300 to 315 MB with 0/0 after. Result JSON under docs/benchmarks/memory-floods-2026-10-04/. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
6.6 KiB
Igneum consensus attack harness
Plays the standard consensus-attack catalogue against a private test network of our own Igneum nodes, with a pass
criterion per scenario taken from the spec and a measured result for each. This is robustness and conformance
testing of our own devnet software, the practice upstream Kaspa (simpa, testing/integration) and the Ethereum
clients follow.
What it is built on
- The in-process network simulator from rusty-kaspa (
kaspa_utils::sim, the enginesimpauses): one realConsensusper node in virtual time. The harness adds hash-share miners, a withholder, timestamp policies, a cut-and-heal topology and reorg records. Source:vendor/igneum-node-harness/igneum/harness-sim. - Real
igneumdprocesses on127.0.0.1, driven over wRPC JSON, for the live scenarios (5, 6, 7 Part B). - A p2p probe that speaks the fork's own protocol (handshake,
InvRelayBlock,RequestRelayBlocks,Block) to deliver malformed blocks on the wire. Source:vendor/igneum-node-harness/igneum/p2p-probe.
All nodes run with skip_proof_of_work (the harness never hashes), so the harness controls each miner's hash share
exactly. Every other consensus rule (timestamps, DAA, GHOSTDAG, merge depth, mass, coinbase) runs unchanged, so
the harness exercises the ordering layer, not a weakened copy of it.
Ports and isolation
The test network uses 127.0.0.1 ports 27200 and up and data under /tmp/igneum-harness. It never touches the
live devnet (gRPC 26610, P2P 26611, observer 26640/26641/28640), the PC node at 192.168.68.67, or any port other
agents use (up to 27199). IGNEUM_HARNESS_BASE_PORT=29500 IGNEUM_HARNESS_TMP=/tmp/my-harness moves the ports (node
i takes base + 10i, proxies base + 900 + i) and the data and results directories, so two agents can run the
harness at once (4 October 2026). Loopback peers are never gossiped (components/addressmanager/src/lib.rs), so no link
forms that a scenario did not ask for. Everything the harness starts is stopped at the end, including on SIGINT.
Build
The harness binaries live in the harness worktree of the node fork:
cd vendor/igneum-node/ && git worktree add -b harness ../igneum-node-harness HEAD # once
cd ../igneum-node-harness
CARGO_TARGET_DIR=target nice -n 19 ~/.cargo/bin/cargo build --release -j 4 \
-p kaspad -p igneum-miner --features kaspad/igneum-pow
CARGO_TARGET_DIR=target nice -n 19 ~/.cargo/bin/cargo build --release -j 4 \
-p igneum-p2p-probe -p igneum-harness-sim
This produces target/release/igneumd, igneum-miner, igneum-p2p-probe and igneum-harness-sim. The run
scripts find them there; override with IGNEUMD, IGNEUM_P2P_PROBE, IGNEUM_HARNESS_SIM.
Run
node tools/harness/run.mjs # the full catalogue, priority order 5,2,1,3,6,4,7
node tools/harness/run.mjs s5 s2 --quick # named scenarios, short durations
node tools/harness/run.mjs --no-bench-log # do not append to docs/bench-log.md
node tools/harness/scenarios/s1-withhold.mjs --quick # one scenario on its own
node tools/harness/run.mjs s7 --quick --live-only # s7 Part B only (the vmine flood against real nodes; no simulator binary needed)
node tools/harness/run.mjs s3 s4 --fast-time # the 60x fast-time profile (infra/fast-time): merge depth 60 s, so the
# partition and eclipse cuts are 10, 30 and 62 s instead of 600, 1,800 and
# 3,700; nodes and the simulator come from vendor/igneum-node/target-integration
Each run appends one dated entry to docs/bench-log.md with a row per scenario (criterion, measured result, pass
or fail), writes full JSON per scenario under /tmp/igneum-harness/results and /tmp/igneum-harness/sim, and
leaves the test network stopped. Exit code is non-zero if any scenario failed.
The catalogue
| # | Scenario | Where | Criterion (spec) |
|---|---|---|---|
| 1 | Withheld-block mining (10, 25, 33, 45% share, release every 5 and 20) | sim | spec 02 2.1: attacker blue-block share within 2 sigma of hash share over 2,000 blocks; reorg depth distribution recorded |
| 2 | Timestamp manipulation: past-median and future-time edges; a 33% miner stretching inside the rules | live + sim | spec 02 2.3: rejected exactly at the boundary; block-rate drift of the controller measured |
| 3 | Partition and heal (2, 10, 30 min, plus one beyond merge depth) | sim | spec 02 2.1: one chain after the merge-depth rule; reorg depth and time to heal recorded |
| 4 | Eclipse of one node (victim fed a slower side chain) | sim | spec 02 2.1: rejoins the honest chain on reconnection within the merge-depth bound |
| 5 | Malformed and boundary inputs on every p2p message and RPC method the fork touches | live + p2p | fork-divergence header and RPC rows; ledger M15: rejected without a crash or a cache build |
| 6 | Resource exhaustion (50x template, submit and mempool floods from one peer) | live | honest template p95 under 200 ms, node under its memory bound; numbers recorded |
| 7 | Fast-miner flood (50x joins at once, the devnet event) | live + sim | node stays responsive; controller trajectory recorded for the difficulty branch |
Scenario 5 overlaps the r3-fixes branch (ledger M15): that branch runs the cheap checks before the lottery
engine, caps cache builds and bans the peer. On this node branch (HEAD, d62708a8, before r3-fixes) the engine
keeps three caches, so a stream of bogus past-day headers can still force a build; scenario 5 records whether any
case built a 256 MiB cache, which is the quantity r3-fixes drives to zero.
Stubs (finality and difficulty-controller branches)
Finality and the difficulty controller live on their own branches. Their scenarios are stubs here, with criteria
written and a one-line plan for running them once the branch is merged into the harness worktree. See
scenarios/stubs.mjs. In short: 1b (withhold vs vote weight), 3b (partition vs lock revocation, ledger F16), 4b
(eclipse vs presence window, ledger F2), 2b (timestamp stretch on the dual-lane controller), 7b (the 50x flood on
the dual-lane controller, against the kaspa-sampled baseline this harness records).
Files
run.mjsscenario runner and bench-log writer.scenarios/s1..s7one file per scenario; each exportsrun({ quick })and runs standalone.scenarios/stubs.mjsthe finality and controller stubs.lib/net.mjsnode processes, topology, TCP proxy for a cuttable link, cleanup.lib/rpc.mjswRPC JSON client.lib/miner.mjsvirtual miner and latency probe.lib/address.mjsdevnet address encoder.lib/sim.mjsrunsigneum-harness-sim.lib/report.mjsresults and bench-log entry.