Skip to content

Broker test battery + drop unmaintained deps (bincode, rustls-pemfile) - #22

Merged
mack42 merged 2 commits into
mainfrom
feat/test-harness-and-dep-hardening
Jul 10, 2026
Merged

Broker test battery + drop unmaintained deps (bincode, rustls-pemfile)#22
mack42 merged 2 commits into
mainfrom
feat/test-harness-and-dep-hardening

Conversation

@mack42

@mack42 mack42 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Two things, bundled into one PR:

  1. Drop two unmaintained crates flagged by cargo audit / cargo deny.
  2. Add a re-runnable broker test battery (not wired into CI) so the broker
    gets the same checks build-over-build ahead of a crates.io release.

1. Dependency hardening

bincode → in-house serde_binCloses #20

bincode (RUSTSEC-2025-0141) was the broker's serializer for Raft state and
fabric RPCs. Replaced with ramqp-broker/src/serde_bin.rs: a full serde
Serializer/Deserializer using bincode 1.x's wire model (LE fixint, u64
lengths, u32 enum-variant indices, structs-as-seq, non-self-describing), which
round-trips openraft's generic types (Entry, Vote, SnapshotMeta, LogId,
StoredMembership) unchanged. ~30 call sites swapped; crate removed.

rustls-pemfilerustls-pki-types PEM — Closes #21

rustls-pemfile (RUSTSEC-2025-0134) loaded the client's TLS certs/keys. Replaced
with the PEM support built into rustls-pki-types — already a dependency via
rustls, and the crate that owns the CertificateDer/PrivateKeyDer types.
No public API change; crate removed.

Both advisories now clear; cargo audit reports only the unrelated, dev-only
crossbeam-epoch (RUSTSEC-2026-0204, via criterion).

2. Broker test battery (ramqp-broker/scripts/)

Each stage sources lib.sh (logging, pass/fail tally, brokerd spawn/teardown,
port + RSS helpers) and writes artifacts to a gitignored out/<timestamp>/.
Run with scripts/run-all.sh (or --quick).

Stage Proves
gates fmt · clippy -D · check · doc · audit · deny
suite full suite, both feature sets, flake-repeat loop
soak RSS-flat + no throughput decay under connection churn
chaos rolling kill -9 cluster failover, zero-accepted-loss + durable crash recovery
interop ramqp & fe2o3-amqp clients × ramqp-broker / RabbitMQ / Artemis
robust live under flood / slow-loris / malformed-frame waves
fuzz cargo-fuzz on decode_frame and Value

bench.sh (perf-vs-baseline) and cov.sh (coverage) are manual and never gate.
Load/chaos/robustness drivers that bash can't express are example bins
(examples/{loadgen,chaos,recover,robust}.rs) so cargo check --all-targets
keeps them compiling; fuzz targets live in ramqp-core/fuzz as their own
workspace so the main build never pulls libfuzzer.

Validation

  • 121/121 broker suite green (all features); serde_bin has 6 unit tests + the fabric Raft round-trip test.
  • Multi-process chaos: zero accepted-message loss across a real SIGKILL leader failover; 800 durable messages survive kill -9 + cold start — all Raft log/snapshot serialization now rides serde_bin.
  • TLS tests pass (incl. the private-CA PEM path).
  • cargo fmt --check clean; cargo clippy --all-targets --all-features -D warnings clean.

Caveat

This changes the on-disk Raft log/snapshot encoding (bincode→serde_bin). The
broker is unreleased, so no migration is needed, but an existing dev --data-dir
must be recreated. The durable /durable/* redb store is unaffected.

Not included (separate follow-ups)

  • crossbeam-epoch RUSTSEC-2026-0204 (dev-only; cargo update -p crossbeam-epoch).
  • A deny.toml for the licenses gate (Unicode-3.0 allowance).

Versions

ramqp 0.8.0 → 0.8.1, ramqp-broker 0.8.26 → 0.8.28.

mack42 added 2 commits July 10, 2026 07:36
Drop two crates flagged by cargo-audit / cargo-deny as unmaintained.

bincode (RUSTSEC-2025-0141) — the broker's cluster layer serialized Raft
state and fabric RPCs with bincode. It now uses a new in-house `serde_bin`
module: a full serde Serializer/Deserializer implementing bincode 1.x's wire
model (little-endian fixint, u64 length prefixes, u32 enum-variant indices,
structs-as-seq, non-self-describing), which round-trips openraft's generic
types (Entry, Vote, SnapshotMeta, LogId, StoredMembership) unchanged. Verified
by serde_bin unit tests, the fabric round-trip test, the full broker suite
(121/121), and multi-process chaos (leader-kill failover with zero accepted
loss + durable crash recovery). On-disk Raft log/snapshot encoding changes;
the broker is unreleased so no migration is needed. (#20)

rustls-pemfile (RUSTSEC-2025-0134) — the client's TLS PEM loading now uses the
PEM support built into rustls-pki-types (already a dependency, and the crate
that owns the CertificateDer/PrivateKeyDer types). No public API change. (#21)

ramqp 0.8.0 -> 0.8.1, ramqp-broker 0.8.26 -> 0.8.27.
Add a consistent, scriptable battery under ramqp-broker/scripts/ so the broker
gets the same checks build over build ahead of a crates.io release. Not wired
into CI; run by hand or via run-all.sh. Each stage sources lib.sh (logging,
pass/fail tally, brokerd spawn/teardown, port + RSS helpers) and writes
artifacts to a gitignored out/<timestamp>/.

Stages: static gates; the full suite under a flake-repeat loop; a soak/leak
detector (RSS-flat + no-throughput-decay under connection churn); chaos
(rolling kill -9 of cluster nodes with a zero-accepted-loss verifier, plus
durable crash recovery); an interop matrix (ramqp and fe2o3-amqp clients x
ramqp-broker / RabbitMQ / Artemis); robustness floods; and cargo-fuzz on the
wire decoders. bench.sh (perf-vs-baseline) and cov.sh (coverage) are manual and
never gate.

Load/chaos/robustness drivers that bash cannot express live as example bins
(examples/{loadgen,chaos,recover,robust}.rs) so cargo check --all-targets keeps
them compiling. Fuzz targets (decode_frame, Value) live in ramqp-core/fuzz as
their own workspace, so the main build never pulls libfuzzer.

ramqp-broker 0.8.27 -> 0.8.28.
@mack42
mack42 merged commit 7b05caf into main Jul 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant