Repository navigation
fix(node): refuse an expiring capability before registering its lane - #3016
Merged
Merged
Conversation
Capability intake splits into verify_capability and register_grant. The funding gates verify the grant, run the closing-pool gate and the grant's expiry-margin gate, and only then register its lane, so a refused request leaves no lane in the live map or the pool store. A closing pool still answers Unfunded to a requester that presents a verified grant. The wrong-owner capability warn and the admit-path getPool and getAuthorization fault warns pass through WarnThrottle. Refs #2770 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 8 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
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 #2770. Covers §2's first checkbox and §4.
§2: refuse before registering
intake_capabilitysplits intoverify_capability(decode, recover, compare to the pool owner; returns the grant'sLaneState) andregister_grant(records it).funding_gatesnow runs:provenis a verified grant or a lane already held, so a fresh requester with a valid grant still hearsUnfunded, as beforeCapabilityExpired(the same refusal it got before)A request on an existing lane whose expiry clears the margin is still served, even if it presents an older expiring grant.
The deposit gate (
remaining − Magainst the request's aligned span) still runs after registration. It lives in the two callers (admit_on_first_proof, the pull-through tier indispatch.rs) with request-specific spans, so moving registration behind it means threading a pending grant through both callers and the "one lane read" invariant. That is left out of this PR.New test:
an_expiring_capability_is_refused_before_its_lane_registersdrivesfunding_gateswith an inside-margin grant (refused, no live lane, nothing in the pool store), then a past-margin grant (admitted, lane recorded).§4: throttle peer-triggerable warns
warn!→ newwrong_owner_warn: WarnThrottleon the handler (each event still counts ondecdn_capability_intake_dropped_total{reason="wrong_owner"}).getPoolandgetAuthorizationfaultwarn!s → one sharedread_fault_warnonResolvingPoolView(one remedy: the endpoint; each fault counts ondecdn_rpc_requests_total).adr/appendix-observability.md§ Peer-triggered warnings lists the new lines.Not covered here: the zero-amount sealed-voucher
warn!invoucher.rsthat §4 also names.Checks
cargo nextest run -p decdn-node: 1626 passed (1 flaky retry inproof_wait::stream_frames_count_stream_data_and_not_keep_alives, unrelated)cargo clippy --workspace --all-targets --all-features: clean🤖 Generated with Claude Code