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
{{ message }}
Repository navigation
probe: an empty-blob holder is dropped as a has_blob/coverage mismatch #2471
#1054 fixed empty-blob delivery on the bao path, but its tests bypass probing. client_delivers_empty_blob dials a known target, and window_pull_through_serves_and_caches_empty_blob never opens upstream for a size of zero.
Repro
Seen during the #2464 review. An Origin::fetch through provisioned_origin_with_ceiling of Hash::new(&[]), against an honest A whose probe answers with total_bytes = 0, returns OriginFetch::NotFound, with the cap at 0 and with a cap set alike. A debug log shows the mismatch drop.
Fix direction
Accept has_blob: true with empty coverage when total_bytes == Some(0). The empty blob spans zero blocks, so an empty coverage over it is complete. Do this in consistent_with itself, or have it take the size, so both consumers agree. Add a probe-driven empty-blob test on each path: node populate (Origin::fetch) and a client decdn get that discovers through probes.
Re-triage: the real node never sends the inconsistent pair this issue describes. Only the test responder does.
What the handler answers.crates/node/src/handlers/probe.rs:622 sets has_blob = !coverage.is_empty(). For the empty blob, num_blocks(0) == 0, so a holder signs has_blob: false with an empty coverage and total_bytes: Some(0). That pair is consistent. It is also what ADR 022 requires:
:239: has_blob means "will serve ≥1 full 64 MiB block".
:243: has_blob: true ⟺ the bitmap is non-empty.
So consistent_with is right to accept it, and right to reject has_blob: true with an empty bitmap.
Where the repro's pair comes from.answer_probe in crates/node/tests/node_origin_pull.rs:326-336 always signs has_blob: true and sets Coverage::full(num_blocks(total_bytes)). With total_bytes = 0 that is the malformed pair. The Origin::fetch repro in the issue ran against this responder.
What remains is narrower. An honest holder of the empty blob reads as a non-holder. By reading the code (I have not run these), the effects are:
Client (decdn get):classify_probe puts every node in NonHolder, and failover_order (crates/client/src/targets.rs:~700) falls back to reachable non-holders as pull-through serve targets. Any node trivially holds the empty blob, so the fetch should still succeed. It takes the cold path, not a ranked holder.
Node origin:has_blob: false records a negative-cache entry and skips the peer (node_origin/mod.rs:1430-1436). A node that wants the empty blob already "has" it in its store, so this should not matter.
crates/client/examples/common/mod.rs:196-206: this does fail. It skips non-holders, then errors with "no verified holder reported the blob's size".
Suggested scope:
Make answer_probe follow the handler (has_blob = !coverage.is_empty()), so the test fixture cannot produce a pair the real node never sends.
Optionally, short-circuit the empty blob on the client: hash == Hash::new(&[]) needs no network or payment. That fixes the example and skips a pointless pull-through.
Leave consistent_with and ADR 022 unchanged.
If nobody wants (2), this can close once (1) lands.
Activity
thiras commentedon Oct 16, 2026
Re-triage: the real node never sends the inconsistent pair this issue describes. Only the test responder does.
What the handler answers.
crates/node/src/handlers/probe.rs:622setshas_blob = !coverage.is_empty(). For the empty blob,num_blocks(0) == 0, so a holder signshas_blob: falsewith an empty coverage andtotal_bytes: Some(0). That pair is consistent. It is also what ADR 022 requires::239:has_blobmeans "will serve ≥1 full 64 MiB block".:243:has_blob: true⟺ the bitmap is non-empty.So
consistent_withis right to accept it, and right to rejecthas_blob: truewith an empty bitmap.Where the repro's pair comes from.
answer_probeincrates/node/tests/node_origin_pull.rs:326-336always signshas_blob: trueand setsCoverage::full(num_blocks(total_bytes)). Withtotal_bytes = 0that is the malformed pair. TheOrigin::fetchrepro in the issue ran against this responder.What remains is narrower. An honest holder of the empty blob reads as a non-holder. By reading the code (I have not run these), the effects are:
decdn get):classify_probeputs every node inNonHolder, andfailover_order(crates/client/src/targets.rs:~700) falls back to reachable non-holders as pull-through serve targets. Any node trivially holds the empty blob, so the fetch should still succeed. It takes the cold path, not a ranked holder.has_blob: falserecords a negative-cache entry and skips the peer (node_origin/mod.rs:1430-1436). A node that wants the empty blob already "has" it in its store, so this should not matter.crates/client/examples/common/mod.rs:196-206: this does fail. It skips non-holders, then errors with "no verified holder reported the blob's size".Suggested scope:
answer_probefollow the handler (has_blob = !coverage.is_empty()), so the test fixture cannot produce a pair the real node never sends.hash == Hash::new(&[])needs no network or payment. That fixes the example and skips a pointless pull-through.consistent_withand ADR 022 unchanged.If nobody wants (2), this can close once (1) lands.
fix(node): re-check refusal in the empty-root probe term (#2471)
fix(protocol,node)!: advertise and accept the empty blob over cdn/pro…