Repository navigation
Description
#2081 introduced decdn_common::data_dir as the single home for the names of the store files a daemon owns, so the CLI and the daemon cannot disagree about which files mean "a decdn-node has run here". decdn doctor keeps its own copy, and that copy has already drifted.
The duplicate
crates/cli/src/commands/doctor/state.rs:273-280:
const REDB: &[&str] = &[
"lanes.redb",
"settle.redb",
"floor-loss.redb",
"checkpoint.redb",
"buyer.redb",
"buyer-pools.redb",
];versus crates/common/src/data_dir.rs, which defines NODE_BUYER_DB_FILE, NODE_LANES_DB_FILE, NODE_SETTLE_DB_FILE, NODE_CHECKPOINT_DB_FILE, CLIENT_BUYER_DB_FILE and the DAEMON_STORE_FILES set, and which channel_store.rs and buyer_pool_redb.rs both now source their filenames from.
Evidence the drift is not theoretical
floor-loss.redb is created by nothing. PersistentPoolStateStore::open opens exactly four family files (crates/node/src/channel_store.rs), and a repo-wide grep finds the name only in this list and in one stale doc comment:
crates/cli/src/commands/doctor/state.rs:276— the list entrycrates/incentive/src/buyer_pool_table.rs:14— module doc still describing "the seller lane, pending-settle, floor-loss, and watcher-checkpoint families"
So doctor silently reports on a file that cannot exist, and the doc claims a family the daemon does not open.
Why it matters beyond tidiness
doctor's list drives the permission and zero-length checks in check_state. A fifth daemon store added to channel_store.rs without a matching edit here is checked by nothing — and the same omission against DAEMON_STORE_FILES would weaken daemon_marker, whose failure mode is a wrong node-vs-client classification, i.e. the #2078 bug. One list makes both consequences share one edit.
Suggested direction
- Point
doctor/state.rsatDAEMON_STORE_FILESplusCLIENT_BUYER_DB_FILE; dropfloor-loss.redb. - Fix the stale family list in
buyer_pool_table.rs's module doc. - Optional, and what would actually keep it honest: a unit test in
channel_store.rsthat opensPersistentPoolStateStorein a temp dir and asserts everyDAEMON_STORE_FILESentry exists afterwards and that no.redbfile outside the set was created. That turns "the daemon opens all of them at bring-up" — currently a prose claim in thedata_dirmodule doc, and the premisedaemon_markerrests on — into a checked fact that fires the moment a fifth store appears.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
fix(cli): batch of five CLI fixes around the node-vs-client data dir (#…