Repository navigation
fix(node): span the coverage union for the empty root on its first holder - #2529
Merged
Merged
Conversation
…lder (#2526) `CoverageUnionTracker::spans()` requires a block target above zero, and the empty blob has zero discovery blocks, so the union never spanned the empty root: the `CoverageUnion` probe round drained to the fanout ceiling instead of stopping on its first holder, the origin-directory round always ran, and a cached holder list never counted as a probe-cache hit. The tracker now takes the requested hash. For `EMPTY_ROOT` it spans once one holder is admitted. The rule keys on the hash, as `ProbeResponseExt::consistent_with` does, never on the unsigned `total_bytes` hint, so a holder that reports `Some(0)` for a real blob closes nothing. Closes #2526 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The narrow fix consistently updates coverage checks and includes focused regression tests, with no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes empty-blob coverage gathering so the first admitted holder spans EMPTY_ROOT, without changing non-empty blob behavior.
Changes:
- Passes the requested hash through probe and cache coverage checks.
- Adds regression tests for empty-root holders and misleading zero-size hints.
- Documents the fix in the changelog.
| File | Description |
|---|---|
| crates/node/src/node_origin/tests.rs | Tests empty-root handling and preserves non-empty coverage checks. |
| crates/node/src/node_origin/pull_leg.rs | Passes the hash into cached coverage checks. |
| crates/node/src/node_origin/mod.rs | Implements hash-based empty-root spanning. |
| CHANGELOG.md | Records the coverage-gathering fix. |
Review effort: Balanced
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 8 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…nt both ways Review follow-ups on #2529: the changelog names the origin-directory lookup, not a round, as the step that always ran; the inline comment in the probe round no longer restates the rule the tracker's own doc owns; the `holders` field says where it is read; and the unit test asserts that an empty-root holder reporting a non-zero size still spans the blob, so the hash-not-hint rule is pinned from both sides. Co-Authored-By: Claude Fable 5.1 <[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
CoverageUnionTracker::spans()requires a block target above zero, and the empty blob has zero discovery blocks, so underProbeGather::CoverageUnionthe union never spannedEMPTY_ROOT: the probe round drained to the fanout ceiling instead of stopping on its first holder, the origin-directory second round always ran, and a cached holder list never counted as a probe-cache hit. Latency, not failure: the holders still reachedcandidates.The tracker now takes the requested hash (
CoverageUnionTracker::new(hash_bytes),coverage_spans(hash_bytes, …)). ForEMPTY_ROOTit spans once one holder is admitted. The rule keys on the hash, asProbeResponseExt::consistent_withdoes, never on the unsignedtotal_byteshint, so a holder that reportsSome(0)for a real blob closes nothing.Closes #2526
Reviewer notes
CoverageUnionTrackerincrates/node/src/node_origin/mod.rsfirst; the three call sites (probe_and_rank,probe_round,spanning_cached_candidates) only thread the hash through.Origin::fetchpath gathers withProbeGather::EarlyExit, so the onlyCoverageUnioncaller isopen_pull_leg. The existingnode_origin_discovers_the_empty_blob_by_probetest never touches the tracker, and since iroh-blobs reports the empty root complete on every backend, the serve-miss pull leg forEMPTY_ROOTis unreachable in the loopback harness too. The regression test is therefore the unit test the issue asks for (coverage_spans_for_the_empty_root_needs_one_admitted_holder), including the lyingSome(0)hint on a real blob.has_blob; the gather stop rule is implementation.Verification
cargo fmt -- --checkCARGO_BUILD_WARNINGS=deny cargo clippy --workspace --all-targets --all-featuresCARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-itemscargo nextest run -p decdn-node coverage_spans(new test red before thespans()change, green after), the empty-blob loopback tests, and the six node: a DHT answer with only partial holders skips the origin-directory fallback, so the ranged miss fails #2195 probe-round-count cases (a_dht_answer_of_partial_holders_only_pulls_in_the_directory_origin,a_partial_only_probe_cache_hit_falls_through_to_the_directory_origin,a_spanning_probe_cache_hit_serves_without_probing,spanning_dht_holders_skip_the_origin_supplement,a_directory_origin_past_the_probe_fanout_is_probed,no_covering_candidate_refuses_before_commit): all passpre-commit run --all-filescontracts/changed: n/aCHANGELOG.mdentry added🤖 Generated with Claude Code