Skip to content

fix(node): refuse an expiring capability before registering its lane - #3016

Merged
alpergundogdu merged 1 commit into
mainfrom
claude/2770-admission-lane-order-c74d07
Nov 27, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
claude/2770-admission-lane-order-c74d07

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Refs #2770. Covers §2's first checkbox and §4.

§2: refuse before registering

intake_capability splits into verify_capability (decode, recover, compare to the pool owner; returns the grant's LaneState) and register_grant (records it). funding_gates now runs:

  1. signer authorization, funder deny (unchanged)
  2. capability verification
  3. closing pool: proven is a verified grant or a lane already held, so a fresh requester with a valid grant still hears Unfunded, as before
  4. the grant's expiry margin: a grant inside it registers no lane
  5. lane registration, then the single lane read
  6. the lane's expiry margin, as before; with no lane, an expiring grant refuses CapabilityExpired (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 − M against the request's aligned span) still runs after registration. It lives in the two callers (admit_on_first_proof, the pull-through tier in dispatch.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_registers drives funding_gates with 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

  • Wrong-owner capability warn! → new wrong_owner_warn: WarnThrottle on the handler (each event still counts on decdn_capability_intake_dropped_total{reason="wrong_owner"}).
  • Admit getPool and getAuthorization fault warn!s → one shared read_fault_warn on ResolvingPoolView (one remedy: the endpoint; each fault counts on decdn_rpc_requests_total).
  • adr/appendix-observability.md § Peer-triggered warnings lists the new lines.

Not covered here: the zero-amount sealed-voucher warn! in voucher.rs that §4 also names.

Checks

  • cargo nextest run -p decdn-node: 1626 passed (1 flaky retry in proof_wait::stream_frames_count_stream_data_and_not_keep_alives, unrelated)
  • cargo clippy --workspace --all-targets --all-features: clean
  • No pub signature changed, so no anvil-e2e compile check was needed.

🤖 Generated with Claude Code

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]>
@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main f1706d8 claude/2770-admissio... a87883a +/-
78% 78% 0%
View coverage of the 8 most impacted files.
File main f1706d8 claude/2770-admissio... a87883a +/-
crates/node/src...nt/serve_leg.rs 95% 94% -1%
crates/protocol/src/framing.rs 93% 92% -1%
crates/e2e/src/ports.rs 85% 84% -1%
crates/client/src/lib.rs 89% 89% 0%
crates/node/src...t_settlement.rs 83% 83% 0%
crates/node/src...gin/pull_leg.rs 84% 84% 0%
crates/node/src...s/client/mod.rs 89% 89% 0%
crates/node/src...nt/admission.rs 98% 98% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@alpergundogdu
alpergundogdu merged commit 00be83e into main Nov 27, 2026
36 checks passed
@alpergundogdu
alpergundogdu deleted the claude/2770-admission-lane-order-c74d07 branch November 27, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant