You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: record the secondary read-view contract and API-016
The read-view pinning added in 3724c8a was documented nowhere, and it
constrains every new API read path. The 06f3fe9 check-count bump missed one
call site.
STORE_SCHEMA.md
- New "Read Consistency (secondary readers)" section: a secondary cannot take
snapshots and its view advances only on `try_catch_up_with_primary()`, so
`read_view.rs` makes catch-up exclusive with pinned read scopes. Covers the
`CatchUpWindow` compile-time rule, one pinned view per HTTP request, the
three deliberately unpinned readers (cycles long-poll, cache warmup, WS
broadcasters), both bounds (100ms yield, 5s stall log), and the self-deadlock
rule.
ARCHITECTURE_MAP.md
- Data-flow step 4 names the catch-up loop, Store Ownership gains the rule a
new read path has to know, and the Store row lists `read_view.rs`.
CLAUDE.md
- The store section carries the pin rule, including that a handler which waits
for new data must release its pin first; the Gotchas row no longer stops at
"read-only, no write locks".
POSTMORTEM.md
- API-016: the 500 on `GET /dao/deposits?status=0`. The index was exact
(91,508/91,508 mainnet, 9,288/9,288 testnet); what had been lost was the
snapshot the assertion was written against — added in ca9afe0, dropped again
in 559e05f to make the path run on a secondary, with a regression test that
only exercised the primary branch.
NETWORK_PEER_CRAWLER.md
- 56 -> 57 checks, the one site 06f3fe9 missed.
Re-sync required: no.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JsRbGi6hngQBnJXm6GjB3g
Copy file name to clipboardExpand all lines: CLAUDE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,7 +191,7 @@ Sync progress and memory stats are stored in RocksDB (`get_sync_tip()`/`get_sync
191
191
192
192
## ckbadger-store (Embedded Storage Engine)
193
193
194
-
Three logical RocksDB store classes: domain (`[store].domain_data_path`, default `data/domain`, 59 CFs), append-only (`[store].append_only_data_path`, default `data/append-only`, 1 CF: `CF_CELLS`), and network (`[store].network_data_path`, default `data/network`, 2 CFs: `CF_NET_NODES`, `CF_NET_STATS`). For the two chain stores the indexer opens read-write and the API opens secondary (read-only); the append-only store holds only immutable cell payloads keyed by outpoint, while all other chain state (activities, indexes, stats, etc.) lives in the domain store. The network store is written solely by the opt-in `ckbadger-crawler` service (configured via the `[crawler]` section, default `enabled = false`; API opens it secondary) and holds non-chain p2p-crawler observations — it is the only store EXEMPT from rebuild-from-genesis. See `docs/STORE_SCHEMA.md` for full column family reference.
194
+
Three logical RocksDB store classes: domain (`[store].domain_data_path`, default `data/domain`, 59 CFs), append-only (`[store].append_only_data_path`, default `data/append-only`, 1 CF: `CF_CELLS`), and network (`[store].network_data_path`, default `data/network`, 2 CFs: `CF_NET_NODES`, `CF_NET_STATS`). For the two chain stores the indexer opens read-write and the API opens secondary (read-only); the append-only store holds only immutable cell payloads keyed by outpoint, while all other chain state (activities, indexes, stats, etc.) lives in the domain store. A secondary has no snapshots and its view advances only on `try_catch_up_with_primary()`, so the API pins one read view per HTTP request (`crates/ckbadger-store/src/read_view.rs`) and catch-up is exclusive with pinned scopes — any read that resolves an index row and then loads the row it points at is coherent by default. Handlers that wait for the indexer to write new data (the cycles long-poll) must release the pin first; see `docs/STORE_SCHEMA.md` → Read Consistency. The network store is written solely by the opt-in `ckbadger-crawler` service (configured via the `[crawler]` section, default `enabled = false`; API opens it secondary) and holds non-chain p2p-crawler observations — it is the only store EXEMPT from rebuild-from-genesis. See `docs/STORE_SCHEMA.md` for full column family reference.
195
195
196
196
Memory is budgeted per network. `[store].memory_budget_gb` is an explicit per-network override;
197
197
otherwise detected host RAM is divided by the number of co-resident orchestrator networks. The
| Store |`crates/ckbadger-store/src/lib.rs`|`store.rs`, `types.rs`, `keys.rs`, `*_ops.rs`, `network_*`|`cargo test -p ckbadger-store`|
45
+
| Store |`crates/ckbadger-store/src/lib.rs`|`store.rs`, `read_view.rs`, `types.rs`, `keys.rs`, `*_ops.rs`, `network_*`|`cargo test -p ckbadger-store`|
39
46
| API / frontend server |`crates/api/src/lib.rs`, `entry.rs`|`routes/`, `ws/`, `frontend_proxy.rs`, `embedded_frontend.rs`, `response.rs`|`cargo test -p ckbadger-api`, `crates/api/tests/api_*.rs`|
0 commit comments