Repository navigation
refactor(adr-001): trim probe machinery (cache evidence retention, outbound rate-limit, two-phase early-exit) - #1200
Conversation
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (4)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Code Review
This pull request simplifies the probe response collection mechanism by removing the complex two-phase wait and adaptive early-exit logic. Instead, candidates are probed concurrently with a single, unified timeout of 500ms, which is reflected in both the architecture decision records (ADRs) and the node implementation (where PROBE_TIMEOUT is reduced from 5 seconds to 500 milliseconds). Additionally, the probe cache structure is optimized by removing the full ProbeResponse from the cached entries, reducing its memory footprint. There are no review comments to address, and we have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Contracts coverageLine coverage: 88.71% (2452/2764 lines) |
Gas snapshotNo gas changes vs base. |
There was a problem hiding this comment.
Pull request overview
Updates the probe-related design documentation (ADR 001 and cross-references) to remove over-specified probe machinery and align the implementation with a simplified “flat concurrent probe with ~500ms cutoff” model in the node origin selection path.
Changes:
- Simplifies ADR 001’s probe cache and probe collection specs (drops evidence-retention + outbound probe rate-limit + two-phase early-exit).
- Updates ADR 005 and ADR 015 text to match the new single 500ms concurrent probe collection window.
- Reduces the node-origin per-candidate probe timeout from 5s to 500ms.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/node/src/node_origin.rs | Lowers per-candidate probe timeout to 500ms to bound concurrent probe collection time. |
| adr/001-network.md | Trims probe cache/evidence language, removes outbound rate-limit clause, and collapses collection to a single 500ms timeout. |
| adr/005-protocol.md | Updates discovery/probing flow description to match concurrent probing with a 500ms collection timeout. |
| adr/015-zero-rtt.md | Adjusts narrative references to the probe collection window to remove outdated parameter names and align with the 500ms cutoff. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Per-candidate probe timeout. Because candidates are probed concurrently, this | ||
| /// also bounds the whole probe-collection phase. Short relative to the pull | ||
| /// timeout — a probe is a single unpaid round trip, so a slow candidate is | ||
| /// dropped quickly rather than burning the caller's miss-latency budget on it. | ||
| /// The 500ms ceiling accommodates inter-continental RTTs (London↔Sydney | ||
| /// ~250–300ms). | ||
| const PROBE_TIMEOUT: Duration = Duration::from_millis(500); |
| A short-lived LRU cache holds `hash → Vec<(NodeId, rate_per_mb, rtt)>` entries, TTL 15 seconds, max 1024 entries. Each hash entry retains at most 10 responses (top 10 by selection score). Approximate memory: 1,024 × 10 × ~100 bytes ≈ 1 MB. On a cache miss the requester checks the probe cache first; if a valid entry exists, it skips DHT lookup and goes straight to selection. On probe cache hit, if the selected provider no longer has the blob (evicted — rare with eviction holds), try the next-best cached provider; if all fail, run a fresh DHT lookup + probe. **Observability:** track `EvictedSinceProbe` response rate; sustained >1% may indicate eviction hold failures ([ADR 005](005-protocol.md#probe-triggered-eviction-hold)). | ||
|
|
||
| **Probe cache TTL is 15 seconds** — half the 30-second slashing evidence window from [ADR 005](005-protocol.md#adr-005-wire-protocol). Probe cache TTL (15s) < `probe_hold_duration` (35s), so any cached probe response used for a stream is within both the slashing window and the eviction hold period. | ||
| **Probe cache TTL is 15 seconds** — half the 30-second slashing evidence window from [ADR 005](005-protocol.md#adr-005-wire-protocol). Probe cache TTL (15s) < `probe_hold_duration` (35s), so any stream opened from a cached entry falls within both the slashing window and the eviction hold period. |
Coverage reportTotal: 80.30% (was 80.30%, ● 0.00%) — 45267/56372 lines
History
|
Drop the probe-cache slashing-evidence retention clause (the positive and negative caches stay), remove the outbound probe rate-limit clause (the inbound three-layer limiter already bounds probe cost), and replace the two-phase early-exit collection window with a flat concurrent probe cut off at a 500ms timeout. The node-origin probe timeout drops from 5s to 500ms to match. Co-Authored-By: Claude Opus 4.8 <[email protected]>
6bc6cd2 to
e4abb54
Compare
Frame the probe-cache TTL around keeping cache-driven streams inside the slashable window rather than around evidence storage, and describe the probe timeout budget as connection setup plus one round trip, noting that warm/0-RTT connections fit the 500ms ceiling. Co-Authored-By: Claude Opus 4.8 <[email protected]>
ReviewOverview. Trims three over-specified pieces from ADR 001's probe section (cache no longer retains signed Verified
One substantive risk — cold inter-continental first probe vs. the 500ms ceiling. The 500ms budget covers connection setup plus the probe round trip. A cold connection to a distant, previously-uncontacted peer costs a 1-RTT QUIC/TLS handshake (~275ms London↔Sydney) followed by the probe request/response (~another ~275ms) ≈ ~550ms, which exceeds This may well be acceptable-by-design (the ADR explicitly accepts dropping slow candidates, and the same node will usually have other, closer candidates), but worth confirming: is it intended that the first probe to a cold distant peer can time out and be scored Unreachable? If not, options are a slightly higher ceiling (e.g. 600–750ms) or not scoring a timeout as Unreachable when the connection was cold. Minor. The PR body says "17 insertions, 20 deletions"; GitHub reports 18/21 (same net −3). Cosmetic. Overall LGTM as a docs+const trim — the only thing I'd want a maintainer's read on is the cold-first-probe timeout behavior above. |
Trims three over-specified pieces from ADR 001's probe section: the probe cache no longer needs to hoard signed
ProbeResponsebytes for slashing evidence (a client challenges within the 15s TTL and the evidence lands on-chain), the redundant outbound 3-batches/sec clause is gone (the inbound three-layer limiter already bounds probe cost), and the two-phase rolling-median early-exit collection window collapses to a flat concurrent probe cut off at 500ms. The one paired code change drops the node-origin per-candidate probe timeout from 5s to 500ms; since candidates are probed concurrently, that const already bounds the whole collection phase. Dangling cross-references in ADR 005 and ADR 015 are fixed to match.Closes #1157
Closes #1159
Closes #1160
Net: 17 insertions, 20 deletions (-3).
🤖 Generated with Claude Code