Repository navigation
fix(node,cli)!: report the pool owner as a lane's counterparty (#2484) - #2488
Merged
Merged
Conversation
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]>
There was a problem hiding this comment.
🟢 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
counterpartynullable; the CLI displays unknown owners asunknownor JSONnull. - 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.
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 7 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
admin_v1_lanesreported the lane's voucher signer ascounterparty. TheLaneSnapshotdocs definecounterpartyas the pool owner: the refund destination and the subject of the ADR-011 funder gate. Since #2482, everydecdn getlane signs with a key derived for its data dir. Sodecdn node lanesshowed that derived key, and an operator looking a client up by its funding wallet found nothing.admin::pool_owners::PoolOwnersnames each lane's owner (getPool.owner) from three sources, in order:PoolProjectionthe serve gates read;getPoolper pool in neither, at most eight at once.openPoolsets it once), so the cache keeps every owner it reads.LaneSnapshot.counterpartyis nowOption<String>. It isNoneonly 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 lanesprintsunknownforNone, and--jsonprintsnull.Closes #2484
Reviewer notes
crates/node/src/admin/pool_owners.rs, the resolver and its chain source.lanes()handler incrates/node/src/admin.rs. It resolves owners before callingbuild_lane_snapshots, which stays pure and takes an ownerHashMap.crates/node/src/runtime/mod.rs, which buildsPoolOwnersbesideResolvingPoolView.ResolvingPoolView: that view negative-caches a failed read and then refuses serves on the pool for a while. The owner lookup has its ownPaymentPoolbinding and caches only successful reads, so anode lanescall can never affect serving.node_pull_topupandnode_to_node_coalescefind their lane byvoucher_signer, since node buyers sign with the operator key. They thenensure!the owner, so a regression fails with a clear message instead of a poll timeout.smokeandg_node_01_onboardingassert both fields.cli_fetch_multi_sourceandcli_bundle_pull_multi_sourceassert that a lane signed by the derived key reports the funding wallet. These two prove the fix end to end.pool_view.rsbackfill docs. They described the projection miss as a first-boot-only case and named a "background pool-owner resolver" that does not exist.SIGNERcolumn 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: cleancargo 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 newpool_ownerstests, among them a stalled-provider bound and a live-projection test.cargo nextest run -p decdn-e2e --features anvil-e2eonsmoke,g_node_01_onboarding,node_pull_topup,node_to_node_coalesce,cli_fetch_multi_source,cli_bundle_pull_multi_source: 8/8 passed, run aftercargo build --bin decdn-node --bin decdnCARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items: cleanCHANGELOG.mdentry addedfix, lowercase subject🤖 Generated with Claude Code