Repository navigation
feat(chunk): add a get-or-closer request - #44
mickvandijke wants to merge 2 commits into
Conversation
Kademlia's FIND_VALUE for chunks (ant-node ADR-0020). A node that holds the chunk answers `Found` with it; one that does not answers `Closer` with its closest known peers. The peers travel as an opaque payload that saorsa-core encodes and checks as a FIND_NODE answer, so the peer format stays versioned in one place. The new variants are appended after every existing one, so older discriminants keep their wire values; a test now pins them. A node built before this request drops it without a reply, so nodes that answer it announce `get-or-closer/1` in their user agent and clients check for it with `advertises_get_or_closer`. The crate takes the 3.1.0 release as its baseline so the ant-node and ant-client branches can build against it. Part of V2-1358. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Takes the rc-2026.10.1 release baseline (saorsa-core 0.29.0). The get-or-closer variants are unaffected: 4.0.0 adds no message variants, so they keep wire values 14 and 15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dirvine
left a comment
There was a problem hiding this comment.
Code approval at the reviewed head
No introduced blocking defect found in this PR. Appended wire variants, pinned discriminants and exact capability-token matching are consistent with the linked implementations. The peers field is deliberately opaque; its existing 5 MiB outer envelope is not a substitute for the inner decoder bound.
Linked stack is NOT approved to ship: saorsa-core#173 needs its decoder size guard, and downstream pins must follow. Preserve dependency-order publication and revalidate CI before merge.
Reviewed commit: 69a031bacd106100376f1914718bfbd44bb1e955.
Review method: six substantive seats across the linked set, including a completed z-ai/glm-5.2 API review recovered from a worker that timed out after saving its response; coordinator source checks and local execution. Initial functional/security/test seats recommended approval. The coordinator probe, independent adjudicator, API seat and replacement concurrency/release seats corroborate the missing decoder bound. This is not unanimous approval. The API seat recommended client approval with concerns; the coordinator withholds it because the exact client pin still exposes the defect.
Local verification (macOS, rustc 1.96.0): core closer-peers 3 passed and DHT-manager regression 143 passed; protocol all-features 108 passed; node get-or-closer unit tests 3 passed and real-transport E2E 1 passed; client kad_read unit tests 10 passed and real-transport E2E 1 passed. Formatting passed in all four repositories. No production/testnet deployment or merge performed. Draft git pins were verified with cargo metadata --locked; this is not published dependency closure. ADR-0020 remains Proposed.
dirvine
left a comment
There was a problem hiding this comment.
Re-review — no change at reviewed head
Head is unchanged at 69a031ba; the first-round APPROVE still stands. Nothing new in this delta.
Verdict
APPROVE (unchanged). CI all green at this head (format, clippy, tests ubuntu/macos/no-default-features, docs, wasm, security, publish dry-run).
Panel: GLM 5.3 seat billing-failed (402) — this seat is 2/3 reviewed (GLM unavailable), Qwen 3.8 + DS4 concur.
Adds a get-or-closer request, Kademlia's FIND_VALUE for chunks (ADR-0020). A node that holds the chunk answers
Foundwith it; one that does not answersCloserwith its closest known peers.ChunkMessageBody::{GetOrCloserRequest, GetOrCloserResponse}carryChunkGetOrCloserRequestandChunkGetOrCloserResponse(Found|Closer|Error). They are appended after every existing variant, so older discriminants keep their wire values; a new test pins them.Closercarries an opaque payload. saorsa-core encodes it and checks it as a FIND_NODE answer (feat(dht): expose lookup steps for caller-driven lookups saorsa-core#173), so the peer format is versioned in one place.GET_OR_CLOSER_AGENT_TOKEN(get-or-closer/1) andadvertises_get_or_closer: a node built before this request drops it without a reply, so clients send it only to peers whose user agent carries the token.Stack, merge in this order:
Linear issue
Closes V2-1358
Risk tier
Compatibility
ChunkMessageBodyvariants, appended at indices 14 and 15. Existing messages are unchanged.get-or-closer/1in their user agent, and clients only send the request to peers that do.ChunkMessageBodyis#[non_exhaustive].Semver impact
Test evidence
cargo test --all-features: 108 passed. New tests cover:GetRequest(2),PointerGetRequest(12) and the new variants (14, 15)cargo clippy --all-targets --all-features -- -D warnings: clean.New dependency
none
ADR
ADR-0020: Kademlia-style chunk GET: return the chunk or closer peers. Measurements are in the ant-client investigation.
Mitigation / rollback
Inert until nodes answer and clients send the request; revert the commit.
🤖 Generated with Claude Code