Repository navigation
fix(cache,node): announce ranged-fill partials to the DHT - #2188
Merged
Merged
Conversation
A node that filled its cache only through ranged serve-miss pulls published no DHT provider records. The republisher learned about content from whole-blob pull-through commits and from a boot walk of Complete blobs only, so partial holders never entered its schedule (ADR 022 §STORE Flow, AC 21). - A ranged admit (admit_bao, admit_bao_stream) that touches a fully present 64 MiB discovery block announces the hash on subscribe_inserts, on failure too, because the store keeps the items it verified. A coverage-query fault announces anyway and the consumer decides. - iter_hashes lists partial blobs, so the cold-start seed and the lag sweep reach them. The due-time gate drops a partial with no whole block. - The republisher publishes eagerly only for a hash that has not announced yet, tracked apart from scheduling so a seeded partial still publishes at once when its first block verifies. An empty coverage sends no Store. Closes #2186 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved issues remain around protection-failure announcements, failed publish retries, empty batch entries, and cold-start rescheduling.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates cache and DHT republishing so ranged partial blobs become discoverable after completing verified blocks.
Changes:
- Announces completed ranged blocks through cache insert events.
- Seeds partial blobs during cold starts and lag sweeps.
- Adds publish deduplication, scheduling updates, regression tests, and changelog documentation.
| File | Summary |
|---|---|
crates/node/tests/dht_bootstrap.rs |
Adds end-to-end partial-publication tests. |
crates/node/src/runtime/mod.rs |
Seeds complete and partial cache entries. |
crates/node/src/dht/publish.rs |
Updates partial seeding, eager publishing, scheduling, and deduplication. |
crates/node/src/dht/client.rs |
Updates publishing documentation. |
crates/cache/src/engine.rs |
Adds block coverage detection and ranged-admit announcements. |
CHANGELOG.md |
Documents the ranged-fill announcement fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit c122757 in the Show a line coverage summary of the most impacted files.
Updated |
The drain cycle marked every held hash announced before its detached BatchStore ran. A cycle with no routing peers, or one every receiver refused, still marked the hash, so its next cache event skipped the eager retry. publish_batch now reports the hashes a peer accepted with non-empty coverage, and only those are marked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thiras
added a commit
that referenced
this pull request
Sep 28, 2026
…ial-only (#2201) Since #2188 a DHT answer can name only partial holders. `discover` read the on-chain origin directory only when the DHT answer was empty, so the ranged assembly ran out of candidates for the blocks no partial held and the client got a truncated stream after `ok: true`. On the ranged pull leg, a probe round whose holders do not span the blob is followed by a round over the origin-directory candidates it did not probe, an origin past the `probe_fanout` cut among them. A probe-cache entry that does not span the blob counts as a miss there. A partial holder's probe now carries the blob size (`CacheEngine::coverage_sized`), so a set of partials that covers every block counts as spanning. Before signing `ok: true` the serve leg checks, against the signed size, that its candidates cover the part of the pull range it does not hold, and refuses with a signed miss when they do not. `AssembleOutcome::Unavailable` carries its cause, logged with a `warn!`. ADR 022 gains the partial-coverage fallback and the refusal-before-commit rule; ADRs 001 and 039, architecture.md and the observability appendix follow. Closes #2195 Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
A node that filled its cache only through ranged serve-miss pulls published no DHT provider records. On the testnet, ash1, hel1 and hil1 showed
decdn_dht_store_published_totalat 0 for 26 h, while ash1 was serving ranges from its own cache. The republisher learned about content from two sources only: whole-blob pull-through commits, and a boot walk ofCompleteblobs. So partial holders never entered its schedule. ADR 022 §STORE Flow and AC 21 require a STORE once a node verifies its first 64 MiB block.engine.rs). A ranged admit (admit_bao,admit_bao_stream) that touches a fully present discovery block announces the hash onsubscribe_inserts. It also announces when the admit fails partway, because the store keeps the items it verified and a gap-fill retry never touches those blocks again. If the coverage query faults, it announces anyway and lets the consumer decide. The block math (discovery_block_span,covered_blocks) is shared withcoverage()and reads the same overridable block size asnum_blocks.iter_hasheslists partial blobs, so the cold-start seed and the lag sweep reach them. It reads onlystatus(), because anobserve()per partial at boot costs an fsync each. The due-time gatecache_still_holdsdrops a partial that covers no block.publish.rs).announcedset tracks this, kept apart from scheduling, so a seeded partial still publishes at once when its first block verifies.Store.cache_still_holdsabout front-only partials was stale:coverage()already reads the size from theobserve()bitfield. A test now pins that.Closes #2186
Reviewer notes
announce_completed_blocksand the restructured tail ofadmit_bao_streamincrates/cache/src/engine.rs. Then theOk(hash)arm ofrun_republishand theannouncedset incrates/node/src/dht/publish.rs.Storealso skips a hash that has already announced. Before this PR, every commit published. The wider coverage now goes out on the next cycle, as ADR 022 §Content Records and TTL describes.status()+observe()call per admit, on a store entry the admit just touched. It is skipped when no subscriber exists. A front-to-back fill announces about once per 64 MiB block, so the channel does not come under new pressure.relay_foreign_namespaces = false, the seeds now put partials throughorigin_probe_presencetoo. The probe memo bounds that cost.Verification
cargo fmt -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo nextest run(workspace: 4164 passed)RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-itemsCHANGELOG.mdentry addedfix, lowercase subjectRegression tests:
crates/node/tests/dht_bootstrap.rs), through the realadmit_bao→subscribe_inserts→run_republish→Store→RecordStorechain:crates/cache/src/engine.rs):iter_hashesincludes partials.publish.rsunit tests):holder_snapshotincludes partials.After deploy: hel1's cold-start log shows
cold_start_count > 0, anddecdn_dht_store_published_totalrises on ash1, hel1 and hil1.🤖 Generated with Claude Code