Skip to content

fix(node,cli)!: report the pool owner as a lane's counterparty (#2484) - #2488

Merged
thiras merged 2 commits into
mainfrom
fix/lanes-counterparty-owner
Oct 16, 2026
Merged

thiras merged 2 commits into
mainfrom
fix/lanes-counterparty-owner

Conversation

@thiras

@thiras thiras commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

admin_v1_lanes reported the lane's voucher signer as counterparty. The LaneSnapshot docs define counterparty as the pool owner: the refund destination and the subject of the ADR-011 funder gate. Since #2482, every decdn get lane signs with a key derived for its data dir. So decdn node lanes showed that derived key, and an operator looking a client up by its funding wallet found nothing.

  • The new admin::pool_owners::PoolOwners names each lane's owner (getPool.owner) from three sources, in order:
    1. the event-fed PoolProjection the serve gates read;
    2. an owner cache local to the admin surface;
    3. one bounded getPool per pool in neither, at most eight at once.
  • A pool id's owner never changes (openPool sets it once), so the cache keeps every owner it reads.
  • The read path matters after a restart. The projection lives in memory and the watcher resumes at its checkpoint, so every carried-over lane is missing from it.
  • Wire-breaking: LaneSnapshot.counterparty is now Option<String>. It is None only when the read fails or finds no such pool. A failed read logs one warning per call and is retried on the next call. It never falls back to the signer.
  • decdn node lanes prints unknown for None, and --json prints null.

Closes #2484

Reviewer notes

  • Read first:
    • crates/node/src/admin/pool_owners.rs, the resolver and its chain source.
    • The lanes() handler in crates/node/src/admin.rs. It resolves owners before calling build_lane_snapshots, which stays pure and takes an owner HashMap.
    • The wiring in crates/node/src/runtime/mod.rs, which builds PoolOwners beside ResolvingPoolView.
  • Why the read is separate from ResolvingPoolView: that view negative-caches a failed read and then refuses serves on the pool for a while. The owner lookup has its own PaymentPool binding and caches only successful reads, so a node lanes call can never affect serving.
  • e2e:
    • node_pull_topup and node_to_node_coalesce find their lane by voucher_signer, since node buyers sign with the operator key. They then ensure! the owner, so a regression fails with a clear message instead of a poll timeout.
    • smoke and g_node_01_onboarding assert both fields.
    • cli_fetch_multi_source and cli_bundle_pull_multi_source assert that a lane signed by the derived key reports the funding wallet. These two prove the fix end to end.
  • Also fixed, nearby: the pool_view.rs backfill docs. They described the projection miss as a first-boot-only case and named a "background pool-owner resolver" that does not exist.
  • CHANGELOG: new BREAKING entry. I also corrected the older SIGNER column entry, which said the two columns are always equal.

Verification

  • cargo fmt -- --check (via pre-commit)
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean
  • cargo nextest run: not run in full locally. I ran a targeted set: -p decdn-common -p decdn-cli -p decdn-node -p decdn-e2e -E 'test(/lane|pool_owners|owner/) | binary(admin_rpc) | binary(no_inline_test_modules)', 176 passed. That includes 8 new pool_owners tests, among them a stalled-provider bound and a live-projection test.
  • e2e: cargo nextest run -p decdn-e2e --features anvil-e2e on smoke, g_node_01_onboarding, node_pull_topup, node_to_node_coalesce, cli_fetch_multi_source, cli_bundle_pull_multi_source: 8/8 passed, run after cargo build --bin decdn-node --bin decdn
  • CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items: clean
  • User-visible change: CHANGELOG.md entry added
  • PR title type fix, lowercase subject

🤖 Generated with Claude Code

admin_v1_lanes filled LaneSnapshot.counterparty with the lane signer. Since
#2482 every `decdn get` lane signs with a key derived for its data dir, so
`decdn node lanes` showed that key, not the wallet that funds the pool, and
an operator looking a client up by its funding wallet found nothing.

The node now reads the owner (getPool.owner) from the event-fed pool view
the serve gates already use, with no chain call. counterparty becomes
Option<String>: None when the view holds no entry for the pool, never the
signer. `decdn node lanes` prints `unknown` there, `--json` prints null.

Tests seed an owner distinct from the signer at every layer, and the two
multi-source CLI e2e journeys now assert that a derived-key lane reports
its funding wallet as the counterparty.

Closes #2484

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:49
@thiras thiras self-assigned this Oct 16, 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.

🟢 Approval recommended

The owner lookup, nullable API, CLI handling, and regression coverage are consistent, with no unresolved blocking issues.

0 open findings

What changed in this PR

Fixes #2484 by reporting each lane’s pool owner as its counterparty, distinct from its voucher signer.

Changes:

  • Reads owners from the shared pool projection without chain calls.
  • Makes counterparty nullable; the CLI displays unknown owners as unknown or JSON null.
  • Updates regression tests and documents the breaking API change.
File Description
crates/​node/​src/​runtime/​mod.rs Shares the pool projection with admin handlers.
crates/​node/​src/​admin/​tests.rs Tests known and unknown pool owners.
crates/​node/​src/​admin.rs Resolves counterparties from pool ownership.
crates/​e2e/​tests/​smoke.rs Checks owner and signer separately.
crates/​e2e/​tests/​node_to_node_coalesce.rs Handles nullable owner matching.
crates/​e2e/​tests/​node_pull_topup.rs Handles nullable payer lookup.
crates/​e2e/​tests/​g_node_01_onboarding.rs Checks owner and signer separately.
crates/​e2e/​tests/​cli_fetch_multi_source.rs Verifies derived-key lanes report their owner.
crates/​e2e/​tests/​cli_bundle_pull_multi_source.rs Verifies bundle lanes report their owner.
crates/​common/​src/​admin/​tests.rs Tests nullable counterparty serialization.
crates/​common/​src/​admin.rs Defines and documents the nullable owner field.
crates/​cli/​tests/​admin_rpc.rs Verifies owner reporting over RPC.
crates/​cli/​src/​commands/​node/​tests.rs Tests unknown-owner table and JSON output.
crates/​cli/​src/​commands/​node.rs Displays unknown owners explicitly.
CHANGELOG.md Documents the breaking change and corrects signer guidance.

🧠 Review effort: Balanced


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

@github-code-quality

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

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main b2cf20a fix/lanes-counterpar... 6cfcad8 +/-
75% 75% 0%
View coverage of the 7 most impacted files.
File main b2cf20a fix/lanes-counterpar... 6cfcad8 +/-
crates/node/src/dht/publish.rs 80% 78% -2%
crates/node/src/runtime/mod.rs 27% 26% -1%
crates/client/src/scheduler.rs 94% 94% 0%
crates/cli/src/...ommands/node.rs 59% 59% 0%
crates/node/src...gin/pull_leg.rs 85% 85% 0%
crates/node/src/admin.rs 78% 78% 0%
crates/node/src.../pool_owners.rs 0% 85% +85%

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


Updated October 16, 2026 19:24 UTC

The pool projection lives in memory and the settlement watcher resumes at
its checkpoint, so after any restart every carried-over lane read `None`
until its pool saw a new request. That covered most lanes an operator
checks, including settlement-eligible ones.

admin_v1_lanes now resolves owners through PoolOwners: the projection,
then an owner cache, then one bounded getPool per pool in neither, eight
at a time. A pool's owner never changes, so the cache keeps every owner
it reads. The read uses its own binding, not ResolvingPoolView, so a
failed read never negative-caches a pool the serve path reads. A failed
read reports None, logs one warning per call, and is retried next call.

Review follow-ups: the e2e topup and coalesce helpers find the lane by
signer and then assert the owner; the JSON test requires the key; the
pool_view backfill docs describe the restart case and the real resolver.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras
thiras merged commit 3cb8411 into main Oct 16, 2026
31 checks passed
@thiras
thiras deleted the fix/lanes-counterparty-owner branch October 16, 2026 19:50
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.

admin: lanes() reports the voucher signer as counterparty, not the pool owner

2 participants