Repository navigation
Description
Spun out of the PR #1151 review (type-design + test-coverage passes). Pre-existing; noting it while the resolver family is fresh.
Observation
resolve_appeal guards its resolved address against the zero address (crates/cli/src/commands/chain_ctx.rs, ~L190):
anyhow::ensure!(
slash_appeal_address != Address::ZERO,
"slash_appeal_address must not be the zero address — set it to the deployed SlashAppeal contract (ADR 028)"
);The accompanying comment calls this "the sole validation site for the appeal address", with the rationale: a zero address parses fine but is never a real deployment — it would surface only as an opaque on-chain revert.
That rationale applies verbatim to the other three resolved contract addresses, none of which is guarded:
Resolved.capacity_bond_address(fromresolve) — consumed byregister/bond/setup.ResolvedPublish.publisher_registry_address— consumed bypublish namespace create/claim.ResolvedPublish.origin_assignment_address— consumed bypublish assign.
A misconfigured 0x000…0 for any of these parses cleanly and only fails later as an opaque contract revert (e.g. a CapacityBond/PublisherRegistry/OriginAssignment call to the zero address), instead of a clear "must not be the zero address" CLI error at resolve time.
Decision to make
Two consistent options — pick one:
- Extend the guard to all four resolved addresses (a shared
ensure_nonzero(addr, label)helper called fromresolve/resolve_appeal/resolve_publish), so every contract address gets the same early, labelled rejection. - Keep appeal-only, but document why — if there's a real reason the appeal path is special (e.g. only it has no other liveness check before submit), update the
chain_ctx.rscomment so the asymmetry reads as intentional rather than an oversight.
Option 1 is the likely answer (the rationale is not appeal-specific), but it is a small behavior change (new hard error on 0x0 for three more addresses), so it wants its own PR + a changelog line — hence this issue rather than bundling it into #1151.
Related
- chore: tech-debt batch — origin-replay window unify + Resolved address typing (#1139, #1140) #1151 (the refactor(cli): resolve contract addresses to
Addressin theResolved*structs, notString#1140 String→Address refactor that surfaced this), refactor(cli): resolve contract addresses toAddressin theResolved*structs, notString#1140.
Activity
docs(cli): scope zero-address-guard wording to the four resolved addr…
fix(node,cli): observable origin-replay range guard + zero-address gu…
fix(cli,incentive): reject zero address for all parsed contract addre…
fix(node,common,cli,incentive): guard daemon contract addresses again…