Repository navigation
feat(scallion): circuit handshake, relay table with limits, threat model (refs #386) - #494
Merged
Merged
Conversation
…at model (#386) Next slice of the Scallion transport. Still an in-process state machine: no socket, not wired into the node, not reviewed, not a working VPN. Both client modes keep reporting "not ready". - scallion_handshake: relay descriptors signed by the relay's libp2p identity (Noise key, roles, exit ports, expiry). Circuits can only be built from a VerifiedRelay, which only verify() produces. - Per-hop Noise_NK_25519_ChaChaPoly_SHA256 via snow (already in the lockfile through libp2p-noise): relay authenticated, client anonymous to it, ephemeral-ephemeral keys for forward secrecy. Prologue binds the relay peer id and the link id. - Telescoped three-hop build with a separate random circuit id per link: each hop learns its previous and next peer only. - Explicit sequence numbers with a 64-wide sliding replay window; a cell that fails authentication does not advance it. Teardown from either end, extend failure and retry. - 18 unit tests on a simulated three-relay network. - docs: scallion-threat-model.md (draft v0.1), scallion-handshake.md (wire formats, rules, limits, what it does not do); frames doc points at the successor; README index; /scallion page row and spec links. Refs #386. Co-Authored-By: Claude Fable 5.2 <[email protected]>
ThreatCrush Security Scan26 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 20 | LOW: 4
Snippets are redacted; ThreatCrush never prints matched credential material. |
This was referenced Nov 25, 2026
#386) Holds every circuit one relay carries and enforces what a relay needs before it can face the network. Still a pure state machine: no socket, no clock, not wired into the node, not reviewed, not a working VPN. - per-peer and total circuit caps; Create rate limit per peer (a refused Create costs no handshake) - idle timeout (destroy toward both sides) and a shorter extend timeout (client gets ExtendFailed, the circuit survives and can retry) - link ids unique per peer in both directions; an Extend that would reuse one fails - a cell that fails authentication does not refresh the idle timer - peer_disconnected tears down every circuit through that peer - 10 unit tests on a three-table network; docs: "Relay limits" section, threat model row updated Refs #386. Co-Authored-By: Claude Fable 5.2 <[email protected]>
ralyodio
added a commit
that referenced
this pull request
Nov 25, 2026
…ke and relay table (#494), stale app error fix scripts/bump-version.sh 0.3.113, plus the workspace crate versions in Cargo.lock. Co-Authored-By: Claude Fable 5.2 <[email protected]>
ralyodio
added a commit
that referenced
this pull request
Nov 25, 2026
…again; bump v0.3.113 (#498) * fix(apps): clear the "stopped for disk" error once the app runs again (#394) stop_for_disk records why a node stopped an app in Local.error, which is persisted and returned by /apps/v1/apps. Nothing ever cleared it, so after the disk recovered and the app restarted the status API kept saying "stopped at ...: this node's docker disk is down to 18 GiB free" next to healthy: true. Seen live on gateway.c0mpute.com on 2026-11-25: four apps up and answering 200, all four still carrying the error from the previous evening. Clear it when the container starts successfully as primary. Refs #394 (product surface must reflect verified live state). Co-Authored-By: Claude Fable 5.2 <[email protected]> * bump v0.3.113: apps owned by the account key (#495), Scallion handshake and relay table (#494), stale app error fix scripts/bump-version.sh 0.3.113, plus the workspace crate versions in Cargo.lock. Co-Authored-By: Claude Fable 5.2 <[email protected]> --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #386 (does not close it).
What this is
The next slice of the Scallion transport, in the order the issue lists: the threat model, signed peer capabilities, and an authenticated three-hop circuit handshake with forward secrecy.
Still not a working VPN.
scallion_handshakeis a pure state machine: it opens no socket, is not wired into the node, carries no user traffic and has had no independent review.c0mpute scallion doctorkeeps reporting both modes as not ready, and nothing here changes that.What it adds
VerifiedRelay, and onlySignedRelayDescriptor::verifyproduces one. This closes the "unauthenticated relay key" gapscallion-frames.mdcalls out.Noise_NK_25519_ChaChaPoly_SHA256throughsnow, the Noise implementation libp2p already uses (same version as the lockfile already held, so the lock gains one dependency line and no new crate). The relay is authenticated, the client stays anonymous to it, and traffic keys come from an ephemeral-ephemeral exchange, so a relay key stolen later does not open recorded traffic. No hand-rolled key agreement.Docs
docs/protocol/scallion-threat-model.md(draft v0.1): goals, non-goals, adversaries with the state of each answer, and the weaknesses of this design that we already know (cell size reveals hop position, no padding, no rekeying, no streams, unauthenticated link-level destroy, no descriptor distribution or revocation).docs/protocol/scallion-handshake.md: wire formats, acceptance rules, limits, and what it does not do.scallion-frames.mdpoints at the successor; README index; the/scallionpage gains a row and two spec links, worded as built and tested but not wired or reviewed.Relay table (second commit)
scallion_relay::RelayTableholds every circuit one relay carries: per-peer and total circuit caps, aCreaterate limit per peer, an idle timeout and a shorter extend timeout, link ids unique per peer in both directions, no idle refresh from cells that fail authentication, and teardown of every circuit through a peer that disconnected. Same shape as the handshake: a state machine that takes the peer id and the time as parameters. 10 tests.Tests
cargo test -p c0mpute-net scallion_handshake --locked: 46 passed on vienna across allscallion_modules (18 handshake, 10 relay table). A simulated three-relay network covers a full build and data both ways, that the guard never sees the exit's id or the payload and the exit never sees the guard's, distinct link ids, descriptor tampering/expiry/wrong signer/bad content, a relay holding the wrong key, a handshake aimed at another peer id, replayed/tampered/reordered cells, path rules, extend refusals, extend failure and retry, teardown both ways, key separation between circuits, and malformed link messages.Still open on #386
Carrying link messages over real libp2p streams with limits and timeouts; a stream layer and an exit enforcing
ExitPolicy; the loopback SOCKS5 client; live path measurement;scallion start/status/stop; multi-node and leak tests; independent review.🤖 Generated with Claude Code