Repository navigation
feat(chunk): add a get-or-closer request - #44
mickvandijke wants to merge 1 commit into
Conversation
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.
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`. Part of V2-1358. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69a031b to
0c6ae27
Compare
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 and release in this order:
This PR is rebased onto main (5.0.1). ant-node#249 and ant-client#221 pin it by git rev, so it must be released before they merge.
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.End to end through ant-node and ant-client, as listed in those PRs.
Dev testnet comparison against main, 2026-10-27, after the review fixes. Two 60-node DigitalOcean fleets with the same layout:
Three runs:
ant-testnet/state/comparisons/v2-1358-review-fixes-{vs-main,swapped,swapped-matched}-60m-1027/README.md.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