Skip to content

cli, client: log typed RPC errors through sanitize_error_sources so the failure class survives #2277

Closed

Description

@yigitdot

The fix for #2271 adds decdn_common::redact::sanitize_error_sources. It walks a typed error's source() chain, drops repeated layers, and strips URLs. sanitize_rpc_display prints only the top-level Display. For an alloy or reqwest transport error, that layer names the operation and the URL, and the failure class (timeout, connection refused, DNS, TLS) is a deeper source(). After the URL strip, the class is lost.

The #2271 PR switches every such site in crates/node/src. These sites outside the node crate still use sanitize_rpc_display on an error value:

Fix

For each site, check the argument's type:

  • a typed std::error::Error (alloy ContractError, RpcError, reqwest::Error) → sanitize_error_sources(&e)
  • an anyhow::Error → sanitize_err_chain(&e)
  • a plain String / &str reason → keep sanitize_rpc_display

No behaviour change beyond the log/error text.

Activity

  1. added
    kind:chore
    rust
    area:cli
    prio:low
    on Oct 5, 2026
  2. self-assigned this
    on Oct 8, 2026
  3. moved this from In progress to Done in deCDNon Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:choreprio:lowrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions