Skip to content

cli: daemon_marker classifies a stat failure as 'not a node' #2086

Closed

Description

@thiras

Follow-up from the #2085 review, not introduced by it.

decdn_common::data_dir::daemon_marker uses Path::exists():

DAEMON_STORE_FILES.iter().copied().find(|name| data_dir.join(name).exists())

Path::exists() collapses every stat error to false — the exact anti-pattern whoami.rs calls out by name and avoids with symlink_metadata.

That was tolerable when the classifier only chose which store to read. After #2078/#2081/#2082 it is the sole gate for three money-moving refusals (refuse_escrow, refuse_sweep, refuse_implicit_node_dir) and for pool list's node-vs-client routing. A stat that fails for a reason other than NotFound — EACCES on the parent, ELOOP, a transient EIO on NFS — classifies a node data dir as Client, and the guards return Ok.

Honest blast radius: in the EACCES case the subsequent ensure_data_dir / Database::create almost certainly fails too, so the practical outcome is an error rather than a stranded deposit. The residual risk is a transient or partial-permission stat failure where the create then succeeds. So: real but narrow.

If daemon_marker is the safety boundary for refusals that move USDC, it should treat a stat error as "unknown, refuse" rather than "not a node" — symlink_metadata, with a third outcome the callers must handle rather than a two-way Option.

🤖 Generated with Claude Code

Activity

  1. added
    area:cli
    prio:low
    on Sep 21, 2026
  2. moved this from Backlog to Ready in deCDNon Sep 21, 2026
  3. self-assigned this
    on Sep 22, 2026
  4. moved this from Ready to In progress in deCDNon Sep 22, 2026
  5. moved this from In progress to Done in deCDNon Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliprio:low

Type

No type

Fields

Priority

High

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions