Skip to content

Unbounded open_or_reuse_channel: a wedged on-chain RPC starves the candidate fallback loop #1143

Closed

Description

@thiras

Found during the review of #1142 (which fixed the sibling gap, #1141).

Problem

#1141 bounded the progressive-OPEN stage of a node→node candidate attempt with deps.config.pull_timeout. But open_or_reuse_channel runs before that wrapper and is itself unbounded, on both paths:

  • NodeOrigin::open_from_candidate (window path) — crates/node/src/node_origin.rs
  • NodeOrigin::pull_from_candidate (buffered path) — same file

ChannelOpener::open_or_reuse_channel has no internal timeout (crates/client-pull/src/buyer_channel.rs).

So a candidate whose channel open hangs — an unresponsive RPC endpoint, a ChannelOpened tx that never mines — still blocks the loop indefinitely and consumes the caller's entire outer deadline. Candidates #2..N are never reached and the serve path refuses a blob the honest fallback holds. That is the same failure shape as #1141, one stage earlier.

crates/node/src/selection.rs already concedes this: the PULL_THROUGH_OUTER_SLACK doc notes open_or_reuse_channel "is not bounded by the per-candidate pull_timeout".

Why it was not fixed in #1142

Wrapping it in tokio::time::timeout drops the future mid-flight, and that future may have an in-flight on-chain openChannel transaction. The tx can still land while we forget about it — gas spent on a channel we abandoned. That is a real hazard and wants its own design (persist-then-open, a bounded receipt wait, or reusing a pre-opened channel), not a timeout bolted onto a bugfix PR.

Acceptance

  • A candidate whose channel open wedges is abandoned on its own budget and the loop reaches candidates docs: Generalize architecture to content-agnostic CDN, refocus slashing on bad edges #2..N.
  • No on-chain transaction is silently abandoned mid-flight (or, if one is, it is recoverable/reusable on the next attempt rather than leaked).
  • Applies to both open_from_candidate and pull_from_candidate.
  • Test: the spawn_a_stalling_server fixture pattern, but stalling at the channel-open stage.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions