Skip to content

fix(node,cache,bao-range): local store faults scored as upstream Unreachable; RangedStoreError repeats its cause; OriginPullError doc in changelog voice #2286

Closed

Description

@yigitdot

Found while reviewing #2276. All three predate that PR.

1. A local store fault is scored against the upstream as Unreachable

crates/node/src/node_origin/mod.rs pull_verdict (~2780) only downcasts client sentinels. A drive error whose cause is this node's own CacheError (a store fault, or a full disk under CacheError::Store) falls through to PullVerdict::Unreachable, and the honest holder is scored for it (~3175). This path is reached from pull_leg.rs drive_run → classify_pull_failure (~1516) and from the buffered path (~2316).

After #2276, decdn_client::classify sees the disk io::Error through CacheError::source(), so ends_the_assembly stops the pull after the first holder. That first holder is still scored Unreachable.

Suggested fix: in pull_verdict, before the catch-all, treat a chain that holds CacheError::Store / CacheError::Internal (or that classify calls Fatal(Command)) as OurLocalFault. Add a test with CacheError::Store(iroh_blobs::api::Error::io(StorageFull, ..)).

2. RangedStoreError repeats its cause in chain renders

crates/bao-range/src/ranged_store.rs: Backend is #[error("backend: {0}")] with #[source], and Alignment is #[error("range alignment: {0}")] with #[from]. The cause appears both in Display and through source(), so {:#} / {:?} / decdn_cache::ErrorChain print it twice, e.g. backend: store error: store error: ctx: root.

The fix is a short Display (cause through source() only, the rule CacheError follows after #2276). But bao-range is shared with the client's .partial store, so every plain-Display site of a RangedStoreError in client / cli / node must switch to a chain renderer in the same change, or those logs go terse. Related: crates/node/src/handlers/client/serve_encoder.rs flattens EncodeError (Debug-based Display) with anyhow!("coherent range encode failed: {e}") (~408). It could use .context() instead.

3. OriginPullError doc uses changelog voice

crates/cache/src/error.rs (OriginPullError doc, ~233-235) says "…so external observers see no change in the error surface". That breaks the CLAUDE.md present-tense rule. Restate it as current behaviour.

Activity

  1. added
    kind:bug
    prio:medium
    rust
    area:node
    kind:chore
    on Oct 5, 2026
  2. self-assigned this
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:nodekind:bugkind:choreprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions