Skip to content

probe: an empty-blob holder is dropped as a has_blob/coverage mismatch #2471

Closed

Description

@thiras

Problem

A holder of the empty (0-byte) blob is never accepted as a probe candidate, so the empty blob cannot be discovered from a peer.

  • The probe handler builds the coverage from the size: Coverage::full(num_blocks(size)) (crates/node/src/handlers/probe.rs:596).
  • num_blocks(0) == 0 (crates/protocol/src/coverage.rs:79), so a holder of the empty blob answers has_blob: true with an empty coverage.
  • ProbeResponseExt::consistent_with (crates/protocol/src/message.rs:295) is has_blob != coverage.is_empty(), so that answer reads as a mismatch.
  • Both probe consumers drop it:
    • node origin: crates/node/src/node_origin/mod.rs:1421, "node-origin: dropping a probe response with has_blob/coverage mismatch"
    • client targets: crates/client/src/targets.rs:445 (ProbeOutcome::Unusable)

#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.

Activity

  1. added theissue type on Oct 16, 2026
  2. thiras commented on Oct 16, 2026

    @thiras
    ContributorAuthor

    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:

    1. Make answer_probe follow the handler (has_blob = !coverage.is_empty()), so the test fixture cannot produce a pair the real node never sends.
    2. 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.
    3. Leave consistent_with and ADR 022 unchanged.

    If nobody wants (2), this can close once (1) lands.

  3. self-assigned this
    on Oct 18, 2026
  4. moved this from Backlog to In progress in deCDNon Oct 18, 2026
  5. added a commit that references this issue on Oct 18, 2026
    261414e
  6. moved this from In progress to Done in deCDNon Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions