You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Formal verification of unsafe code and critical invariants using
Kani, a Rust model checker
backed by CBMC.
Overview
100 proof harnesses across 4 workspace crates verify memory safety,
bounds correctness, and algorithmic invariants for the most
safety-critical data structures. All proofs are gated behind
#[cfg(kani)] and add zero overhead outside verification.
Proof Distribution
Crate
Proofs
Files
Properties Verified
gossip-stdx
74
8
Bitset invariants, byte-slab safety, timing wheel safety, ring buffer bounds, SPSC ring bounds, inline vec bounds, atomic dedup correctness
scanner-engine
15
3
Node pool allocation safety, hit pool lifecycle, scratch memory bounds
scanner-scheduler
9
4
Archive format detection, runtime chunk arithmetic, budget stack depth, tar zero-block detection
scanner-git
2
2
DAG counter underflow, shard partitioning invariants
DAG remaining_out / dag_remaining counters never underflow
Running Locally
# Verify a single crate
cargo kani --package gossip-stdx --features kani
# Verify all crates (run sequentially — each crate is independent)
cargo kani --package gossip-stdx --features kani
cargo kani --package scanner-engine --features kani
cargo kani --package scanner-scheduler --features kani
cargo kani --package scanner-git --features kani
CI
Kani runs on the nightly schedule (02:00 UTC) and can be triggered
manually via workflow_dispatch. Each crate runs as a separate step
so failures are isolated. See .github/workflows/ci.yml, job kani.
Adding New Proofs
Add the proof in the relevant source file under a #[cfg(kani)] module.
Annotate with #[kani::proof] and #[kani::unwind(N)] where N
bounds loop iterations (keep small to avoid solver timeouts).
Ensure the crate's Cargo.toml has kani = [] under [features]
and 'cfg(kani)' in the check-cfg lint allowlist.
Run cargo kani --package <crate> --features kani locally to verify.
Related Verification Infrastructure
Tool
Scope
CI Job
Schedule
Kani
Bounded model checking (100 proofs)
kani
Nightly
Miri
Undefined behavior detection
miri
Nightly
Loom
Exhaustive concurrency testing in gossip-stdx and scanner-scheduler