Skip to content

Comparing committee scenarios

Two scripts test the committee. consensus_smoke.sh checks its behaviour for free; consensus_compare.sh measures what it costs against a baseline, under real load. This page shows how to run both and how to read the report.

You will learn / You need

You will learn: what each script does and spends, the scenarios of the comparison, the structure of summary.md and what to look for in each section. You need: the committee page, cargo, python3 and curl. The smoke script also needs Docker, or a COMETBFT_BIN, to obtain CometBFT. The compare script needs Docker, a working bridge setup and gas.

Smoke test: no stack, no gas

consensus_smoke.sh runs the committee locally against real CometBFT and a mock executor, with no Docker stack, no IOTA node and no gas. It posts synthetic events, checks the outcome and exits non-zero on failure, so each Byzantine preset has an end-to-end test.

cd stealth_name_service/backend
./consensus_smoke.sh all
./consensus_smoke.sh 4 1 0 equivocate 15   # nodes, byzantine, faulty, strategy, events

all runs seven configurations in turn:

Arguments Case What the script checks
4 0 0 forge 10 Honest committee Every event is delivered exactly once
4 1 0 forge 15 Honest majority rejects every forgery Nothing the committee never observed is delivered
4 1 0 censor 10 Censored events still commit Every event is delivered
4 1 0 delay 10 Delayed proposals still commit Every event is delivered
4 1 0 equivocate 15 Duplicate-vote evidence is committed At least one piece of misbehaviour evidence is committed
4 3 0 forge 6 Past the bound: forged events commit At least one forged event is delivered
4 0 2 forge 6 Past the bound: the committee stalls Nothing is delivered

Within the BFT bound (faulty plus Byzantine at most ⌊(n−1)/3⌋) the script also checks that every delivery carries a valid CONSENSUS_DELIVERY_KEY signature and that a retry of an already committed event is answered duplicate. Past the bound, other runs only report. The mock executor answers 403 to a bad signature, as event_handler does. Arguments, defaults and the environment variables (SMOKE_PORT, SMOKE_MOCK_PORT, COMETBFT_BIN) are in consensus_smoke.sh.

Comparison under load

consensus_compare.sh deploys each scenario in turn with ./deploy.sh bridge, runs the same loadtest workload from the host (agent/payloads/bridge_request.json), waits until every request has a destination row, keeps that run's CSVs, and builds the report at the end.

Spends gas

Every request is a source transaction, a destination transaction and, with BRIDGE_PROTOCOL_PHASES=3, an acknowledgement. The script prints the total and asks before starting; --yes skips the question. .env is edited per scenario and always restored, also on Ctrl-C; the original is kept as env.original in the output directory.

cd stealth_name_service/backend
./consensus_compare.sh --agents 50 --requests 2          # pilot, about 100 requests per scenario
./consensus_compare.sh --scenarios baseline,honest       # a subset
./consensus_compare.sh --report results/consensus_compare_<timestamp>   # redo the summary only

Without flags it runs 1000 agents times 5 requests per scenario. --agents, --requests, --interval, --reps, --scenarios, --max-wait, --out, --yes and --report are listed in consensus_compare.sh. EVENT_HANDLER_MODE must be bridge in .env, and CONSENSUS_DELIVERY_KEY must be set for every scenario but the baseline.

Scenarios

All scenarios except the baseline use a 7-validator committee. Everything else (timeouts, phases, gas, batch size) comes from .env unchanged and is recorded in params.txt.

Scenario Committee settings
baseline CONSENSUS_ENABLED=false
honest 0 faulty, 0 Byzantine
faulty2 2 faulty (crash-stop)
byz2_forge 2 Byzantine, forge
byz2_censor 2 Byzantine, censor
byz2_delay 2 Byzantine, delay
byz2_equivocate 2 Byzantine, equivocate
honest_commit200 0 faulty, 0 Byzantine, CONSENSUS_TIMEOUT_COMMIT_MS=200

With 7 validators, f = ⌊(7−1)/3⌋ = 2, so every Byzantine and faulty scenario is exactly at the bound.

What a run leaves behind

results/consensus_compare_<timestamp>/
    summary.md  summary.csv  scenarios.txt  params.txt  env.original
    <scenario>/rep<N>/   merged_results.csv  run.json  bridge_results.csv  loadtest.log
                         deploy.log  event_handler.log  consensus_env.txt
                         (committee on:)  committee_status.json  committee.log

Reading summary.md

summary.md is built by report in stealth_name_service/backend/consensus_compare.py. Every figure covers only the rows of that run's own successful source digests. This is the shape of a real report, from a run of four scenarios. The numbers are an example of the format, not a result to rely on.

# Consensus comparison

<details><summary>Run parameters</summary> … params.txt … </details>

## Overview

| Scenario | Committee | Completed | Committee blocks | Events per block (mean / max) | Unsafe commits | Evidence |
|---|---|--:|--:|--:|--:|--:|
| **baseline** | off | 24997/24997 (100%) | – | – | – | – |
| **honest** | 7 nodes, commit 150 ms | 24997/24997 (100%) | 237 | 105 / 163 | 0 | 0 |

## End-to-end latency
| Scenario | Median | Mean | p90 | p99 | With ack (median) |
| **honest** | 1.04 s (+13%) | 1.33 s (+14%) | 2.39 s (+10%) | 2.82 s (+8%) | – |

## Where the time goes
| Scenario | Detection | Ingest | Ordering | Delivery | Relayer | Chain | End-to-end |

## Committee ordering
| Scenario | Median | p90 | Max |

## Throughput
| Scenario | Offered (achieved by loadtest) | Completed at destination |
Section How to read it
Run parameters The settings that were the same for every scenario. Check BATCH_SIZE, BRIDGE_PROTOCOL_PHASES and the timeouts before comparing two reports.
Banners A note when there is no baseline (percentages are omitted), and a warning when three phases were configured but some completed requests have no acknowledgement.
Overview Completed should be 100%. Unsafe commits counts rows with consensus_observed false; within the bound it is 0. Evidence comes from committee_status.json and is above 0 for byz2_equivocate. Committee blocks is marked with a warning below 20: too few blocks make the statistics thin.
End-to-end latency total_bridge_time_seconds, source event to destination confirmation. The percentage is the change against baseline. The last column adds the acknowledgement.
Where the time goes Six consecutive stages. Ingest, Ordering and Delivery exist only with the committee, so their sum is the committee's cost. Detection, Relayer and Chain should match the baseline. Medians do not add up exactly.
Committee ordering Median, p90 and max of consensus_latency_ms. The tail is where Byzantine and crashed nodes show up.
Throughput The offered rate comes from run.json; completed requests per second is measured at the destination. Far below saturation it reflects tail latency, not capacity.

Each section's columns and the summary.csv layout are in CSV schemas.

Check it worked

  • ./consensus_smoke.sh all ends with All smoke runs passed.
  • A compare run ends with Results: results/consensus_compare_<timestamp> and the directory holds summary.md.
  • In summary.md every scenario has 100% Completed and Unsafe commits is 0.

Next