Skip to content

cli: zero-address guard not applied to contract addresses parsed outside the resolve* family (fetch/channel/setup) #1213

Closed

Description

@yigitdot

Spun out of the #1209 review (which fixed #1153). Pre-existing gap noted while the guard is fresh.

Observation

#1153 added a shared parse_nonzero_address guard and applied it to the four contract addresses resolved by resolve / resolve_appeal / resolve_publish in crates/cli/src/commands/chain_ctx.rs. But several other contract addresses in the CLI are still parsed via the plain chain_ctx::parse_address (which accepts 0x0000…0000), so the same "a zero address parses cleanly but is never a real deployment — it surfaces only as an opaque on-chain revert" rationale that motivated #1153 still applies to them:

  • crates/cli/src/commands/fetch.rs:212 — capacity_bond_address. Note the inconsistency: the same logical address IS zero-guarded when it comes through resolve(), but not on the fetch path.
  • crates/cli/src/commands/fetch.rs:204 — slash_judge_address.
  • crates/cli/src/commands/fetch.rs:192 and crates/cli/src/commands/channel.rs:77 — payment_channel_address.
  • crates/cli/src/commands/setup.rs:1079 — usdc_address.

(Account/EOA addresses like --provider-address and operator are deliberately excluded — the "never a real deployment" rationale is contract-specific.)

Suggested fix

Route these contract-address parse sites through chain_ctx::parse_nonzero_address instead of parse_address, mirroring #1153. This is a small behavior change (new hard error on 0x0 for these addresses), so it wants its own PR + a CHANGELOG line — hence this issue rather than bundling it into #1209.

Once done, the parse_nonzero_address doc comment and the CHANGELOG "tracked separately" note (added in #1209) can be updated to reflect the broader coverage.

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cli

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions