You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
decdn fetch: decouple --provider-address from --node-id so it can guard the --channel-id adopt path #1492
The decdn fetch --channel-id <id> adopt-by-id path reads --provider-address purely as a guard: it asserts the flag matches the channel's actual on-chain provider and hard-errors on a mismatch (hydrate_channel_by_id), rather than using it to locate the node. The node to dial is derived from the adopted channel's on-chain provider via resolve_node_for_provider.
Because of the requires = "node_id" coupling, a user who wants that provider mismatch-guard is forced to also pass --node-id — which partly defeats the point of adopt-by-id being able to derive the node itself. The combination is awkward, not broken: the guard still works when --node-id is supplied.
Proposal
Relax the coupling so --provider-address can stand alone as a guard on the --channel-id path, while preserving today's behavior on the auto-open path (where --provider-address without --node-id has no discovery step to run and genuinely needs the explicit node).
Options to weigh:
Drop requires = "node_id" and instead validate the flag combination in code: --provider-address alone is allowed only alongside --channel-id; on the auto-open path it still requires --node-id.
Or keep the clap-level requires and just document the combination in the flag help.
Acceptance criteria
decdn fetch --channel-id <id> --provider-address <addr> works without --node-id, using --provider-address as the mismatch guard against the channel's on-chain provider.
The auto-open path (--provider-address without --channel-id) keeps its current requirement.
cli_command_tree_is_clap_valid still passes; add a unit test for the new allowed/disallowed flag combinations.
The issue identifies an awkward clap arg coupling in crates/common/src/cli/fetch.rs where --provider-address has requires = "node_id", preventing it from being used as a standalone mismatch guard on the --channel-id adopt-by-id path. The proposal is to move the validation into code rather than clap's declarative constraint, allowing --provider-address to stand alone only when paired with --channel-id, while preserving the existing requirement on the auto-open path. Acceptance criteria and the affected code path (hydrate_channel_by_id) are clearly identified.
📊 Assessment
Dimension
Value
Reasoning
Type
Feature
Relaxing a CLI constraint to enable a new valid usage pattern; enhances UX rather than fixing broken behavior
Labels
cli, enhancement, medium
Scoped to CLI arg parsing, improves ergonomics, not urgent
Coding agent
Suitable
Clear scope (single file crates/common/src/cli/fetch.rs), explicit acceptance criteria, and a defined test requirement (cli_command_tree_is_clap_valid + new combo test)
🔗 Similar issues
No similar open issues found.
💡 Notes and suggestions
Implementation approach:
Remove requires = "node_id" from the --provider-address arg declaration in crates/common/src/cli/fetch.rs.
Add a runtime validation block (likely in the FetchArgs validation or wherever fetch args are resolved) that enforces:
If --provider-address is set and --channel-id is not set → require --node-id (current behavior, now enforced in code instead of clap).
If --provider-address is set and --channel-idis set → allow without --node-id; the mismatch guard in hydrate_channel_by_id handles the rest.
Unit tests to add:
--channel-id <id> --provider-address <addr> → valid (no --node-id needed).
--provider-address <addr> alone (no --channel-id, no --node-id) → clap/validation error.
Activity
github-actions commentedon Jul 28, 2026
🎯 Triage report
The issue identifies an awkward
claparg coupling incrates/common/src/cli/fetch.rswhere--provider-addresshasrequires = "node_id", preventing it from being used as a standalone mismatch guard on the--channel-idadopt-by-id path. The proposal is to move the validation into code rather than clap's declarative constraint, allowing--provider-addressto stand alone only when paired with--channel-id, while preserving the existing requirement on the auto-open path. Acceptance criteria and the affected code path (hydrate_channel_by_id) are clearly identified.📊 Assessment
cli,enhancement,mediumcrates/common/src/cli/fetch.rs), explicit acceptance criteria, and a defined test requirement (cli_command_tree_is_clap_valid+ new combo test)🔗 Similar issues
No similar open issues found.
💡 Notes and suggestions
Implementation approach:
requires = "node_id"from the--provider-addressarg declaration incrates/common/src/cli/fetch.rs.FetchArgsvalidation or wherever fetch args are resolved) that enforces:--provider-addressis set and--channel-idis not set → require--node-id(current behavior, now enforced in code instead of clap).--provider-addressis set and--channel-idis set → allow without--node-id; the mismatch guard inhydrate_channel_by_idhandles the rest.--channel-id <id> --provider-address <addr>→ valid (no--node-idneeded).--provider-address <addr>alone (no--channel-id, no--node-id) → clap/validation error.--provider-address <addr> --node-id <id>(no--channel-id) → valid (auto-open path, existing behavior).cli_command_tree_is_clap_validstill passes after removing therequiresconstraint.Context: Surfaced during review of #1488, suggesting this came up in a real usage flow rather than being hypothetical.
Add this agentic workflow to your repo
To install this agentic workflow, run
test(e2e): cover bundle pull --channel-id adopt-by-id against live anvil
fix(cli): attach client binding on bundle pull auto-open so --namespa…
feat(cli): decouple --provider-address (#1492) + bundle pull --channe…