Skip to content

docs: retire payment-channel vocabulary in node comments - #2404

Merged
thiras merged 3 commits into
mainfrom
docs/2402-retire-channel-vocabulary
Oct 10, 2026
Merged

thiras merged 3 commits into
mainfrom
docs/2402-retire-channel-vocabulary

Conversation

@thiras

@thiras thiras commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2402

Summary

  • Rewrites every comment, doc and test-local string that named the retired payment-channel surface to the PaymentPool names. The old names: openChannel, reclaimExpired, getChannel, ChannelOpened, ChannelToppedUp, PaymentChannel, BuyerChannelStore, BuyerChannelService, buyer_channel_redb/_table, register_open_channel, try_reclaim.
  • Where the claim around a name was wrong, not just outdated, it now states current behaviour:
    • Runbook, "refusing paying clients":
      • Quotes the real warn! text and fields.
      • Remediation compares headroom against deposit − totalRedeemed − M from PaymentPool.getPool(poolId). decdn node pools lists only the node's own buyer pools, so it cannot show the client pool being refused.
    • PoolOpened is projection-only (PoolProjection::record_opened). Updated to match:
      • the reorg-orphan paragraph, which now says the node goes unpaid for service against a phantom pool
      • the backfill margin note
      • the register_lane docs: its one production caller is the capability intake
      • the client_loopback idempotency guard
    • chain_events::timed doc: drops getChannel and the origin watcher, which does not exist; the origin directory is a lazy cache.
    • runtime:
      • Settlement is the only watcher that persists a cursor.
      • reclaim reverts when submitted optimistically after a failed chain-head read, or when another caller reclaims first. A deadline race cannot happen.
    • Metrics docs:
      • The reclaim-failure causes match reclaim_once.
      • The extra open-failure causes are store, open-task and capability signing. A failed watermark read meters buyer_lane_seed_failure, not this total.
    • dispatch: spend is gated on lane authority (pull_authorized), not pool ownership.
    • selection: the node's one pool serves every provider.

Emitted strings

None in production. The only string changes are test-local .context values in node_origin/tests.rs. They now match production: "submit openPool" and "persist opened buyer pool". No metric or log is renamed, so nothing in decdn/devops changes.

Out of scope

  • Code identifiers that are merely old: buyer_channel.rs, channel_store.rs, concrete_channel_store, channel_state_store, CHANNEL_OPEN_CALLER_BUDGET.
  • Tracked in cleanup: remaining payment-channel wording and stale comments after #2404 #2405:
    • remaining "channel" wording elsewhere
    • user-facing strings (DEFAULT_CONFIG template, crate description, READMEs)
    • an existing break in the OpenReported metering rule

Test plan

  • Issue grep returns no hits outside adr/_history. The grep was extended with PaymentChannel|BuyerChannelService|buyer_channel_(redb|table)|register_open_channel|try_reclaim. contracts/ keeps only the intentional test_reclaimExpired_removed negative test.
  • cargo fmt -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items
  • cargo nextest run -p decdn-node -E 'test(/node_origin::tests|metrics::tests::pool_open_failures|register_lane_is_idempotent/)' (37 passed)
  • pre-commit hooks

🤖 Generated with Claude Code

Rewrite comments, doc strings and test-local strings that still named the
retired channel surface (openChannel, reclaimExpired, getChannel,
ChannelOpened, PaymentChannel, BuyerChannelStore/Service, buyer_channel_*
modules) to the PaymentPool names.

Where the surrounding claim was wrong rather than merely old, state the
current behaviour: PoolOpened is projection-only (PoolProjection), so the
lane-idempotency guard, reorg-orphan and backfill-margin notes no longer
describe a durable channel registration; the reclaim sweep pre-checks the
chain-head deadline; the reclaim-failure metric docs drop the nonexistent
try_reclaim / escalation threshold; the runbook points at `decdn node pools`
and PaymentPool.getPool.

No metric names, log strings or code identifiers change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 08:56
@thiras thiras added kind:docs README, docs/, runbook, rustdoc or ADR prose only kind:chore Cleanup, dependencies, tooling or release work; no user-visible change labels Oct 10, 2026
@thiras thiras self-assigned this Oct 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The runbook inspects unrelated buyer-side state, and two updated comments contain incorrect or unresolved API documentation.

3 open findings
What changed in this PR

Updates node documentation and test comments from retired payment-channel terminology to the current PaymentPool model.

Changes:

  • Renames legacy contract, service, store, and event terminology.
  • Corrects watcher, reclaim, and projection descriptions.
  • Updates operator guidance and test-local error strings.
File Description
docs/​runbook.md Updates pool troubleshooting guidance.
crates/​node/​tests/​node_origin_pull.rs Renames pool-opening test documentation.
crates/​node/​tests/​client_loopback.rs Corrects lane-registration rationale.
crates/​node/​src/​selection.rs Updates pool-open timeout documentation.
crates/​node/​src/​runtime/​mod.rs Revises watcher and reclaim comments.
crates/​node/​src/​node_origin/​tests.rs Updates test-local pool errors.
crates/​node/​src/​node_origin/​pull_leg.rs Renames the on-chain open operation.
crates/​node/​src/​metrics/​tests.rs Updates metric test terminology.
crates/​node/​src/​metrics.rs Corrects pool and reclaim metric documentation.
crates/​node/​src/​handlers/​client/​fill.rs Documents pool-based spend authorization.
crates/​node/​src/​handlers/​client/​dispatch.rs Updates pull-through authorization comments.
crates/​node/​src/​chain_events/​resumable_watcher.rs Revises settlement cursor documentation.
crates/​node/​src/​chain_events/​mod.rs Corrects projection and RPC descriptions.
crates/​node/​src/​chain_events/​backfill.rs Updates reorg replay terminology.
crates/​e2e/​src/​chain.rs Renames buyer funding concepts.
crates/​e2e/​Cargo.toml Updates store/module names in feature comments.
crates/​common/​src/​cli/​fetch.rs Renames the pool-opening transaction.
crates/​client/​src/​driver.rs Updates the buyer-store documentation link.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/client/src/driver.rs Resolved
Comment thread docs/runbook.md Resolved
@github-code-quality

github-code-quality Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 4a75b9b in the docs/2402-retire-cha... branch remains at 75%, unchanged from commit fae8257 in the main branch.

Show a line coverage summary of the most impacted files.
File main fae8257 docs/2402-retire-cha... 4a75b9b +/-
crates/client/src/sink.rs 95% 93% -2%
crates/cache/src/engine.rs 91% 91% 0%
crates/protocol/src/framing.rs 93% 93% 0%
crates/node/src...gin/pull_leg.rs 85% 85% 0%

Updated October 10, 2026 09:34 UTC

Review of the first pass found rewrites that traded a stale claim for a
false one:

- runbook: `decdn node pools` lists the node's own buyer pools, not the
  client pool a refusal names; compare `headroom` against
  `deposit - totalRedeemed - M` from `getPool` instead. Quote the real
  `warn!` text and fields, and name `PoolToppedUp`.
- metrics: a failed watermark read meters `buyer_lane_seed_failure`, not
  the open-failure total; the extra causes are store, open-task and
  capability signing.
- chain_events: drop the #1227 sentence (false of `PoolProjection`), say
  the node goes unpaid for service against a phantom pool, and stop
  naming a nonexistent origin watcher in the `timed` doc.
- runtime: settlement is the only persisted watcher; `reclaim` reverts
  when submitted optimistically after a failed head read or when another
  caller reclaims first, not on a deadline race.
- `register_lane` has one production caller, the capability intake.
- dispatch gates spend on lane authority, not pool ownership; selection's
  pool serves every provider; e2e's `RedbBuyerPoolStore` has many users;
  the node_origin test names the real `open_pool` / `run_open` and the
  production context string.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…2402)

The pull-through gate checks that the bound signer holds a lane in the
named pool (`pull_authorized`). A delegate signer is not the pool owner,
so the shed-gate and pool-floor comments say lane authority too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras
thiras merged commit 9c4e7a1 into main Oct 10, 2026
32 checks passed
@thiras
thiras deleted the docs/2402-retire-channel-vocabulary branch October 10, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:chore Cleanup, dependencies, tooling or release work; no user-visible change kind:docs README, docs/, runbook, rustdoc or ADR prose only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cleanup: retire payment-channel vocabulary in node comments and docs

2 participants