Skip to content

refactor: retire remaining payment-channel identifiers and stale channel claims - #2412

Merged
thiras merged 4 commits into
mainfrom
chore/2407-retire-channel-identifiers
Oct 10, 2026
Merged

thiras merged 4 commits into
mainfrom
chore/2407-retire-channel-identifiers

Conversation

@thiras

@thiras thiras commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

What

Retires the payment-sense "channel" that #2406 left in identifiers and the prose around them. The model is one pool per owner and one lane per (pool_id, signer, provider), so every remaining payment "channel" now says pool or lane. Per the pre-mainnet rule, this is one rename with no aliases.

Closes #2407

Three commits:

  1. refactor(node): identifiers.
    • Modules: buyer_channel → buyer_pool, channel_store → pool_store, tests/channel_state_store.rs → tests/pool_state_store.rs.
    • Store fields and locals: the channel_state_store / concrete_channel_store / buyer_channel_store* family → pool_*.
    • ServeRejectReason::UnknownChannel → UnknownLane, matching its existing unknown_lane metric label.
    • CHANNEL_OPEN_CALLER_BUDGET → POOL_OPEN_CALLER_BUDGET.
    • wedged_channel → wedged_lane.
    • Test fixtures, *_channel_id locals (pool ids) and 21 test names.
  2. docs(adr): stale claims. Fixes the ADR 005, 011, 012, 016, 019 and 026 claims, the key-rotation and upgrade-path appendices, the runbook, and CHANGELOG lines that name current pool things. ADR 012 also claimed channels are keyed by (client, provider, nonce), which is no longer how keying works.
  3. docs(crates): prose. Rewrites comments, test prose, metric HELP text, log and error strings across about 50 files.

Reviewer notes

  • No on-disk, wire, metric-name or public-API change.
    • The redb tables were already lane_state_v1 / buyer_pool_state_v1. BuyerChannelTable only appeared in two stale Cargo.toml comments, so this needs no CHANGELOG BREAKING entry.
    • ServeRejectReason is private.
    • Nothing renamed lives in decdn-protocol or decdn-client pub API.
  • Operator-visible text:
    • The startup log line now reads pool state store ready with a lanes= field.
    • Five metric HELP strings now say pool or lane.
    • decdn/devops does not query either; its own stale prose is fixed in a companion devops PR.
  • Not just a rename.
    • retired scaffolding removed from StubOpener in node/tests/node_origin_pull.rs. Nothing ever pushed into it, so every retired.is_empty() assertion was vacuous.
    • Comments that cited things which don't exist are corrected:
      • --channel-id: bundle pull adopts a pool via --capability.
      • VoucherRejected { WrongChannel }: the variant is now WrongPool, and an unknown lane is refused pre-serve with NotFound.
      • cli::commands::channel.
  • Kept on purpose:
    • tokio, side-channel and tonic senses (ChannelWriter, *_CHANNEL_CAP, Channel*Sink).
    • ADR 003's pool-versus-channel contrasts.
    • ADR 012:114 "per-channel pin", which is also a contrast.
    • The channels_open vocabulary in architecture.md that the appendix-observability rename table maps.
    • The CHANGELOG entries describing the retired PaymentChannel contract.
  • Found, not fixed:
    • cli::commands::pool's close_and_forget / reclaim_and_forget hand-roll send/receipt and lose the tx hash on a receipt error. The incentive/src/tx.rs module doc now says so.

Verification

  • 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 --workspace: 4781 passed
  • pre-commit hooks on every commit
  • Leftover sweep: rg -n -i channel crates adr docs --glob '!adr/_history/**' shows only non-payment senses and the kept ADR lines above
  • User-visible change: CHANGELOG.md entry added (n/a: only a log line and HELP text change)
  • Design change: ADRs updated (prose only, no design change)
  • PR title type is refactor

🤖 Generated with Claude Code

thiras and others added 3 commits October 10, 2026 15:56
The payment model has one on-chain pool per owner and one lane per
(pool_id, signer, provider). Rename the identifiers that still say
"channel": the buyer_channel and channel_store modules, the
channel_state_store family of fields and locals, UnknownChannel,
CHANNEL_OPEN_CALLER_BUDGET, and the test fixtures, locals and test names
that carry payment-sense "channel". No on-disk table, wire, metric or
public-API name changes.

Refs #2407

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ADR 005, 011, 012, 016, 019, 026, the key-rotation and upgrade-path
appendices, and the runbook still described payment channels: one
channel per (client, node) pair, a `payment_channel_address` config key,
`address(paymentChannel)` in the deploy grant, channel deposits. State
the current model instead: one pool per owner, one lane per
(pool_id, signer, provider). CHANGELOG entries that name the
`pool_open_failures_*` family and the buyer pool store follow.

ADR 003's deliberate pool-versus-channel contrasts and general uses of
"channel" stay.

Refs #2407

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rewrite the remaining payment-sense "channel" in doc comments, test
prose, metric HELP text, log messages and error contexts as pool
(deposit, funding, owner, open) or lane (per-signer-provider frontier,
voucher progress, ledger). Metric names and labels are unchanged; the
startup log reads "pool state store ready" with a `lanes` field. tokio
and side-channel senses stay.

Also correct comments that named things that do not exist: the
`--channel-id` flag (bundle pull adopts a pool via `--capability`),
`VoucherRejected { WrongChannel }`, and `cli::commands::channel`. Drop
the `retired` scaffolding from the node-origin `StubOpener`: nothing
ever recorded into it, so its assertions were vacuous.

Closes #2407

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

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

Several updated claims remain inaccurate, including nonce-based lane prose, per-run lane cardinality, incomplete ADR cleanup, and an undisclosed exported API rename.

4 open findings
What changed in this PR

Aligns payment terminology with the pool/lane model across node internals, tests, documentation, and operator-visible text.

Changes:

  • Renames channel-oriented modules, identifiers, rejection reasons, and tests.
  • Updates ADRs, comments, logs, errors, and metric help text.
  • Removes unused StubOpener retirement scaffolding.
File Description
docs/​runbook.md Updates operational payment terminology.
crates/​node/​Cargo.toml Corrects buyer table references.
crates/​node/​src/​lib.rs Exports renamed modules.
crates/​node/​src/​buyer_pool.rs Renames the buyer service module.
crates/​node/​src/​buyer_pool/​tests.rs Moves buyer service tests.
crates/​node/​src/​buyer_ledgers.rs Updates lane terminology.
crates/​node/​src/​pool_store.rs Renames the persistent store module.
crates/​node/​src/​pool_store/​tests.rs Moves persistent store tests.
crates/​node/​src/​selection.rs Renames the pool-open budget constant.
crates/​node/​src/​selection/​tests.rs Updates constant references.
crates/​node/​src/​runtime/​mod.rs Renames store wiring and startup text.
crates/​node/​src/​runtime/​tests.rs Updates renamed module references.
crates/​node/​src/​receipt_log.rs Updates store documentation links.
crates/​node/​src/​metrics.rs Updates payment terminology in metric documentation.
crates/​node/​src/​binding_check.rs Updates lane terminology.
crates/​node/​src/​content_deny.rs Renames pool-funder documentation.
crates/​node/​src/​chain_events/​resumable_watcher/​tests.rs Updates watcher test prose.
crates/​node/​src/​dht/​node_address.rs Updates buyer service link.
crates/​node/​src/​dht/​capacity_bond_registry.rs Updates settlement terminology.
crates/​node/​src/​dht/​capacity_bond_registry/​tests.rs Updates payment terminology in tests.
crates/​node/​src/​node_origin/​mod.rs Renames buyer APIs and lane concepts.
crates/​node/​src/​node_origin/​pull_leg.rs Updates pool-open constants and lane prose.
crates/​node/​src/​node_origin/​ranged_pull.rs Updates lane terminology.
crates/​node/​src/​node_origin/​backend_source.rs Clarifies the unpaid local path.
crates/​node/​src/​node_origin/​admit_store.rs Updates remedy terminology.
crates/​node/​src/​node_origin/​funder.rs Updates buyer service references.
crates/​node/​src/​node_origin/​funder/​tests.rs Updates renamed imports.
crates/​node/​src/​node_origin/​tests.rs Updates lane verdict terminology.
crates/​node/​src/​handlers/​client/​mod.rs Renames rejection and store fields.
crates/​node/​src/​handlers/​client/​dispatch.rs Uses UnknownLane.
crates/​node/​src/​handlers/​client/​fill.rs Updates store terminology.
crates/​node/​src/​handlers/​client/​outcome.rs Maps the renamed rejection reason.
crates/​node/​src/​handlers/​client/​outcome/​tests.rs Updates rejection coverage.
crates/​node/​src/​handlers/​client/​serve_leg.rs Updates authorization terminology.
crates/​node/​src/​handlers/​client/​tests.rs Updates renamed fields and variants.
crates/​node/​src/​handlers/​client/​voucher.rs Uses the renamed store field.
crates/​node/​src/​handlers/​client/​window.rs Updates lane authorization prose.
crates/​node/​tests/​support/​mod.rs Updates store fixture documentation.
crates/​node/​tests/​pool_state_store.rs Renames store integration tests.
crates/​node/​tests/​origin_range_pull.rs Renames pool/lane fixtures and prose.
crates/​node/​tests/​node_to_node_pull_through.rs Renames lane assertions and scenarios.
crates/​node/​tests/​node_origin_pull.rs Removes unused retirement scaffolding.
crates/​node/​tests/​client_loopback.rs Renames payment fixtures and tests.
crates/​node/​tests/​anvil_settlement_e2e.rs Updates renamed module imports.
crates/​node/​tests/​anvil_bringup_shutdown_e2e.rs Updates store documentation.
crates/​incentive/​src/​tx.rs Corrects pool command documentation.
crates/​incentive/​src/​buyer_pool_table.rs Updates node store references.
crates/​incentive/​src/​bind_sig.rs Clarifies lane signer attribution.
crates/​client/​src/​lib.rs Updates public documentation terminology.
crates/​client/​src/​driver.rs Renames lane-ledger prose and errors.
crates/​client/​src/​pacer.rs Clarifies pool deposit semantics.
crates/​client/​src/​scheduler.rs Updates lock errors and leg terminology.
crates/​client/​src/​scheduler/​tests.rs Updates scheduler test prose.
crates/​client/​src/​sink.rs Updates cumulative lane terminology.
crates/​client/​src/​sink/​tests.rs Updates paid-frontier test prose.
crates/​client/​src/​source.rs Renames pool context errors and docs.
crates/​client/​src/​tests.rs Renames pool ID locals.
crates/​common/​src/​address.rs Updates CLI command documentation.
crates/​common/​src/​admin.rs Updates lane watermark documentation.
crates/​common/​src/​cli/​bundle.rs Documents capability-based pool adoption.
crates/​common/​src/​config/​mod.rs Updates pool-open budget documentation.
crates/​common/​src/​config/​resolved.rs Updates pool transaction and deny-list prose.
crates/​cli/​src/​commands/​config.rs Updates generated configuration comments.
crates/​cli/​src/​commands/​fetch/​tests.rs Updates lane watermark test prose.
crates/​cli/​src/​commands/​rotate_key/​eth.rs Updates key-rotation terminology.
crates/​cli/​src/​commands/​unbond.rs Updates pool command reference.
crates/​cli/​tests/​common/​mod.rs Updates pool-list references.
crates/​cli/​tests/​pool_list.rs Uses the renamed store module.
crates/​cache/​src/​engine.rs Updates lane authorization documentation.
crates/​e2e/​tests/​origin_stream_while_store.rs Updates lane-state test prose.
crates/​e2e/​tests/​origin_blacklist_compliance.rs Updates pool-funder terminology.
crates/​e2e/​tests/​node_pull_pool_redeploy.rs Updates buyer module references.
crates/​e2e/​tests/​node_pull_pool_adopt.rs Updates buyer module references.
crates/​e2e/​tests/​g_node_07_rotate_key.rs Updates settlement terminology.
crates/​e2e/​tests/​g_node_04_blacklist_compliance.rs Updates failure-class prose.
crates/​e2e/​tests/​g_gov_03_real_evidence.rs Updates pool/lane preconditions.
CHANGELOG.md Rewrites current component terminology.
adr/​005-protocol.md Corrects pool and lane cardinality.
adr/​011-content-takedown.md Updates blacklisted-pool behavior.
adr/​012-client.md Corrects keying and configuration claims.
adr/​016-contract-interactions.md Corrects contract and deposit names.
adr/​019-node-onboarding.md Updates payment-model reference.
adr/​026-tokenomics.md Updates settlement terminology.
adr/​appendix-operator-key-rotation.md Updates key-rotation behavior.
adr/​appendix-operator-upgrade-path.md Updates migration terminology.

🧠 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/node/src/selection.rs Resolved
Comment thread adr/005-protocol.md Resolved
Comment thread crates/node/src/node_origin/pull_leg.rs Resolved
@github-code-quality

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

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust, Solidity

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 43240d1 in the chore/2407-retire-ch... branch remains at 75%, unchanged from commit 4880c1f in the main branch.

Show a line coverage summary of the most impacted files.
File main 4880c1f chore/2407-retire-ch... 43240d1 +/-
crates/client/src/lib.rs 88% 88% 0%
crates/cache/src/engine.rs 91% 91% 0%
crates/node/src...ent/dispatch.rs 83% 83% 0%
crates/node/src/buyer_pool.rs 0% 63% +63%
crates/node/src/pool_store.rs 0% 84% +84%

Solidity / code-coverage/forge

The overall line coverage in commit 43240d1 in the chore/2407-retire-ch... branch remains at 92%, unchanged from commit 4880c1f in the main branch.


Updated October 10, 2026 13:38 UTC

- The owner-mismatch counter and its HELP text describe a request with
  no verified binding; a binding for a signer with no lane counts as
  unknown_lane.
- The pull-through gate checks lane authority (a known lane for the
  bound signer), not pool ownership; rename the test to
  pull_through_gate_authorizes_only_lane_signer. The funder of a
  delegated lane is refused as an unknown lane.
- The tracked-watermark test exhausts the signer's capability cap
  (SpendingCapExhausted), not the pool deposit.
- InsufficientDeposit is a pool-class refusal, not lane-class.
- tx.rs states why the pool close/reclaim pair is hand-rolled and
  points at #2413.
- Cargo.toml, ci.yml, ADR 003, 005, 019 and the key-rotation appendix
  drop remaining channel names and imprecise pool/lane claims; a
  CHANGELOG item no longer names an expired pool, which does not exist.

Refs #2407

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@thiras
thiras merged commit f41ab4c into main Oct 10, 2026
32 checks passed
@thiras
thiras deleted the chore/2407-retire-channel-identifiers branch October 10, 2026 13:41
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.

cleanup: rename remaining payment-channel identifiers and fix stale channel claims in ADRs

2 participants