Skip to content

Node: apply the zero-address contract guard to the daemon's runtime parse sites (follow-up to #1213) #1219

Closed

Description

@thiras

Observation

Spun out of the #1213 review. #1213 extended the shared zero-address guard (parse_nonzero_address, from #1153) to every contract address parsed in the decdn CLI. The decdn-node daemon, however, still parses the same logical contracts with a plain .parse() + .with_context() and no zero-address guard:

  • crates/node/src/runtime/mod.rs:880 — origin_assignment_addr
  • crates/node/src/runtime/mod.rs:885 — publisher_registry_addr
  • crates/node/src/runtime/mod.rs:949 — payment_channel_addr
  • crates/node/src/runtime/mod.rs:1359 — content_blacklist_addr

payment_channel, origin_assignment, and publisher_registry are the same contracts the CLI now guards, so a 0x0000…0000 misconfig on the daemon still surfaces as the opaque late on-chain revert that #1153/#1213 set out to eliminate — the workspace is left with a half-guarded surface (CLI guarded, daemon not).

Suggested fix

Route the daemon's contract-address parse sites through a zero-address guard. Since both binaries need it, the cleanest home is a parse_nonzero-style helper in a leaf crate both can import (e.g. config-types, already on the shared common → config-types, protocol path), replacing the two duplicated copies (cli/src/commands/chain_ctx.rs::parse_nonzero_address and incentive/src/swap_venue.rs::parse_nonzero) with one.

As with #1213, only contract addresses — EOA/account addresses keep the permissive parse. Present-but-zero errors; unset optionals still resolve to None.

Related

Activity

  1. added
    kind:security
    rust
    on Jul 16, 2026
  2. self-assigned this
    on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:securityrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions