-
Notifications
You must be signed in to change notification settings - Fork 0
Wire the QUIC transport into a real mesh, and make attestation a signature #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4594dbe
core: expose relay reasoning and the attester set
copyleftdev 382b61b
runtime: wire the QUIC transport into the mesh
copyleftdev 2fd2fca
cli: multi-concern analysis mesh as real processes
copyleftdev 95bb289
film: narrated walkthrough of a recorded run
copyleftdev 47e0f9a
core: make attestation a signature rather than a name
copyleftdev 90d45b4
runtime: authenticate the channel, and let the mesh heal
copyleftdev 69bb694
runtime: discover reachable addresses, and coordinate a simultaneous …
copyleftdev 7e72d13
runtime: fix three faults found by testing against real NATs
copyleftdev 90fd0dd
harden against review, and make the proof continuous
copyleftdev fc235b0
ci: build the workspace warning-free
copyleftdev e4d6f32
verify: deterministic simulation, bounded mutation, and a real conver…
copyleftdev 7fd24f6
verify: model check the gossip spec, bounded
copyleftdev a2bc184
test: cover the mesh behaviour that only manual runs had checked
copyleftdev 4cd046e
fix: authenticate a peer before believing what it says about us
copyleftdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Mutation testing scope. | ||
| # | ||
| # Deliberately narrow. cargo-mutants rebuilds and reruns the suite for every | ||
| # mutant, so cost scales with (mutants x suite time) and an unscoped run over | ||
| # this workspace is hours of full-core load. The question worth paying for is | ||
| # "do the tests actually catch a broken protocol", so only protocol code is | ||
| # mutated. Demo, film and CLI plumbing are excluded: mutating them measures the | ||
| # demo's test coverage, which nobody is relying on. | ||
|
|
||
| examine_globs = [ | ||
| "smesh-core/src/signal.rs", | ||
| "smesh-core/src/identity.rs", | ||
| "smesh-core/src/node.rs", | ||
| "smesh-runtime/src/mesh.rs", | ||
| "smesh-runtime/src/journal.rs", | ||
| ] | ||
|
|
||
| exclude_globs = [ | ||
| "smesh-cli/**", | ||
| "smesh-bounty/**", | ||
| "smesh-agent/**", | ||
| "film/**", | ||
| "reference/**", | ||
| "**/benches/**", | ||
| ] | ||
|
|
||
| # Mutants inside a test are not interesting. `Debug` bodies are cosmetic, and | ||
| # mutating them only ever reports that nobody asserts on debug output. | ||
| exclude_re = [ | ||
| "mod tests", | ||
| "impl Default", | ||
| "impl std::fmt::Debug", | ||
| ] | ||
|
|
||
| # Known unkillable: this crate has `#[cfg(unix)]` / `#[cfg(not(unix))]` pairs | ||
| # for filesystem permissions. Mutating the branch that is not compiled on this | ||
| # platform can never be caught, and cargo-mutants cannot tell the two apart by | ||
| # name. Treat a survivor in `write_private` or `reject_if_world_readable` as a | ||
| # platform artifact rather than a coverage gap. | ||
|
|
||
| # A mutant that makes the code hang must not hold a slot forever. Multiplier | ||
| # over the measured baseline run. | ||
| timeout_multiplier = 4.0 | ||
| minimum_test_timeout = 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| # Read-only by default: nothing here needs to write to the repository, and a | ||
| # workflow that cannot push cannot be turned into one that does. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUSTFLAGS: -D warnings | ||
|
|
||
| jobs: | ||
| test: | ||
| name: test and lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt, clippy | ||
|
|
||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Format | ||
| # Scoped to the crates this workflow is responsible for. The older CLI | ||
| # modules predate it and are not reformatted as a side effect of CI. | ||
| run: cargo fmt -p smesh-core -p smesh-runtime -- --check | ||
|
|
||
| - name: Clippy | ||
| run: | | ||
| cargo clippy -p smesh-core --lib -- -D warnings | ||
| cargo clippy -p smesh-runtime --lib --tests -- -D warnings | ||
|
|
||
| - name: Test | ||
| run: cargo test --workspace | ||
|
|
||
| - name: Test again | ||
| # The mesh tests start real QUIC endpoints on real sockets and depend on | ||
| # timing. Running twice catches the flake that only shows up sometimes, | ||
| # which is the kind this suite is most likely to grow. | ||
| run: cargo test --workspace | ||
|
|
||
| demo: | ||
| name: analysis run end to end | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Build | ||
| run: cargo build --bin smesh | ||
|
|
||
| - name: Orchestrate five real processes and validate the journal | ||
| run: | | ||
| ./target/debug/smesh orchestrate --out runs/ci | tee /tmp/run.log | ||
|
|
||
| # The demo's whole claim is that the mesh separates cause from | ||
| # symptom from noise. Assert it rather than eyeballing the output. | ||
| grep -q "checkout-api CONSENSUS" /tmp/run.log \ | ||
| || { echo "::error::root cause did not reach consensus"; exit 1; } | ||
| grep -q "payments-api no consensus (3/4" /tmp/run.log \ | ||
| || { echo "::error::downstream casualty was miscounted"; exit 1; } | ||
| grep -q "journal is internally consistent and safe to replay" /tmp/run.log \ | ||
| || { echo "::error::journal validation failed"; exit 1; } | ||
|
|
||
| - name: Upload the recorded run | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: analysis-run | ||
| path: runs/ci/ | ||
| retention-days: 7 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| name: Deep verification | ||
|
|
||
| # Deliberately not on every push. These layers are expensive, and a slow | ||
| # required check is one people learn to ignore. They run nightly and on demand, | ||
| # and they report rather than block. | ||
| on: | ||
| schedule: | ||
| - cron: "0 4 * * *" | ||
| workflow_dispatch: | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| inputs: | ||
| dst_seeds: | ||
| description: "Simulation seeds to sweep" | ||
| default: "2000" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: deep-verification | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| simulation: | ||
| name: deterministic simulation soak | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Sweep seeds | ||
| # Every seed is a different delivery order, delay pattern and set of | ||
| # relay coin flips. A failure names the seed, which is the whole point: | ||
| # it reproduces exactly rather than being described. | ||
| env: | ||
| SMESH_DST_SEEDS: ${{ inputs.dst_seeds || '2000' }} | ||
| run: cargo test -p smesh-core --test dst --release | ||
|
|
||
| model: | ||
| name: model checking | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: "21" | ||
|
|
||
| - name: Check the gossip spec | ||
| # Two workers and a 2GB heap, not "auto". TLC will take every core and | ||
| # grow until the kernel stops it, and this model is small enough that | ||
| # needing more would mean the model is wrong. | ||
| env: | ||
| VERIFY_JOBS: "2" | ||
| TLC_HEAP: "2g" | ||
| VERIFY_TIMEOUT: "600" | ||
| run: ./verify/tla.sh | ||
|
|
||
| mutation: | ||
| name: mutation testing | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Install cargo-mutants | ||
| run: cargo install cargo-mutants --locked | ||
|
|
||
| - name: Mutate the protocol | ||
| # Scope is in .cargo/mutants.toml: protocol crates only. Two jobs, not | ||
| # one per core — the runner has two, and oversubscribing a rebuild-per- | ||
| # mutant workload makes it slower, not faster. | ||
| run: cargo mutants --jobs 2 --no-shuffle --output target/mutants | ||
| continue-on-error: true | ||
|
|
||
| - name: Report survivors | ||
| if: always() | ||
| run: | | ||
| python3 - <<'PY' | ||
| import json, pathlib, sys | ||
| p = pathlib.Path("target/mutants/mutants.out/outcomes.json") | ||
| if not p.exists(): | ||
| print("no outcomes produced"); sys.exit(0) | ||
| d = json.loads(p.read_text()) | ||
| missed = [o for o in d["outcomes"] if o.get("summary") == "MissedMutant"] | ||
| print(f"{len(d['outcomes'])} mutants, {len(missed)} survived\n") | ||
| for o in missed: | ||
| m = o["scenario"]["Mutant"] | ||
| print(f" survived: {m['file']}:{m['function']['function_name']}") | ||
| print("\nA survivor means the tests would not notice that change.") | ||
| print("Known artifact: cfg(not(unix)) branches cannot run on this platform.") | ||
| PY | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: mutation-outcomes | ||
| path: target/mutants/mutants.out/outcomes.json | ||
| retention-days: 14 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.