Repository navigation
fix(node): gate listeners on blacklist sync - #1275
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Warning Review limit reached
Next review available in: 16 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 (2)
WalkthroughThe ContentBlacklist contract address is now required during configuration resolution. The blacklist watcher reports initial synchronization status through a one-shot channel, and runtime startup delays ALPN listener registration until synchronization succeeds. ChangesContentBlacklist startup synchronization
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant NodeRuntime
participant BlacklistWatcher
participant ReadinessGate
participant QUICRouter
NodeRuntime->>BlacklistWatcher: start initial replay and re-scope
BlacklistWatcher-->>ReadinessGate: report success or failure
alt synchronization succeeds
ReadinessGate->>QUICRouter: construct and register ALPN listeners
else synchronization fails
ReadinessGate-->>NodeRuntime: return startup error
end
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 |
Coverage reportTotal: 81.73% (was 81.51%, ▲ +0.22%) — 49172/60161 lines
History
|
Review: gate listeners on blacklist syncSecurity-motivated change with genuinely good test coverage. The core idea — no paid-delivery ALPN may accept before the mandatory What looks good
1. The gate defers more than the ALPN listeners (main concern)
Startup already blocks on a bounded, retrying Suggestion: keep the metrics/admin binds and bootstrap ahead of the gate and gate only 2. First transient backoff at startup is fatal — intended?
If "fail closed = exit, let the supervisor restart" is the deliberate choice, worth a one-line comment saying so. If you'd rather tolerate transient blips while still failing closed, resolve the gate on 3. Needs a non-trivial rebase (
|
… bring-up The initial blacklist-sync gate was awaited before the DHT bootstrap, the metrics listener bind, the admin listener bind, and the "node runtime ready" banner. A slow or failed initial ContentBlacklist replay therefore took down observability and the local admin control surface as well as the paid-delivery listeners — regressing the #1109 intent that the metrics/admin binds and the startup banner come up independent of chain RPC, and blinding operators exactly when they would want to see why a node is not serving. Move the gate to just after the startup banner, immediately before the serve loop, so it covers only the Router (Probe/Client/DHT/gossip ALPNs). The watcher is still spawned near the top of bring-up, so its initial replay now runs concurrently with bootstrap, the metrics/admin binds, and every background task, and is often already complete by the time control reaches the gate. The security invariant is unchanged: no ALPN accepts a connection before the first global + operator-scope replay/scope pass succeeds, and a failed initial sync still fails startup closed. No behavior change to the gate helper or the watcher; the block is relocated. Validated: cargo build, clippy -D warnings, fmt --check, and cargo test -p decdn-node --lib (647 passed). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01PpNWr8dWZ1tk3rkV3WmKzM
…r-blacklist-sync # Conflicts: # crates/node/src/blacklist_watcher.rs # crates/node/src/runtime/mod.rs
…gate; tidy merge Follow-ups from the post-merge review of the #1171 reconciliation: - Add initial_clean_replay_signals_ready: asserts a clean first replay drives on_established -> signal(Ok) through the real blacklist_watcher::spawn wiring, so a hook swap or mis-cloned InitialSyncGate can't wedge listeners closed while the failure-path test stays green. - Add listener_fails_closed_when_watcher_drops_readiness: the gate must treat a dropped readiness sender (watcher aborted before signaling) as a hard failure. - Move `let mut tasks = JoinSet::new()` back to its first use; the blacklist watcher spawns via its own WatcherHandle, not into the JoinSet. - Correct the router-gate comment: a *failed* initial sync exits the process (it does not keep observability up); only a still-pending sync does. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Summary
ContentBlacklistcontract address during paid-delivery node config resolutionImpact
Nodes can no longer accept paid-delivery traffic before local blacklist compliance is established. Missing configuration or an unavailable initial sync now produces a startup error instead of running without local protection.
Validation
cargo test -p decdn-common --lib(402 passed)cargo test -p decdn-node --lib(647 passed)cargo clippy -p decdn-common -p decdn-node --all-targets -- -D warningscargo fmt --all -- --checkgit diff --checkcargo-nextest,cargo-deny, andpre-commitwere not installed in the validation environment. No dependency changes are included.Closes #1171
Summary by CodeRabbit
New Features
Bug Fixes