Skip to main content

handle_subtree_byte_challenge

Function handle_subtree_byte_challenge 

Source
pub async fn handle_subtree_byte_challenge(
    challenge: &SubtreeByteChallenge,
    storage: &LmdbStorage,
    self_peer_id: &PeerId,
    is_bootstrapping: bool,
    commitment_state: Option<&Arc<ResponderCommitmentState>>,
) -> SubtreeByteResponse
Expand description

Handle a round-2 byte challenge (responder side), ADR-0002.

The auditor has already structurally verified this node’s round-1 subtree proof and now demands the ORIGINAL chunk bytes for a small freshly-random sample of those leaves. For each requested key the responder either returns the bytes (SubtreeByteItem::Present) or — if it committed to the key but can no longer produce it — an explicit SubtreeByteItem::Absent, which the auditor counts as a provable failure (committing to bytes you don’t hold).

A key the responder never committed to (not in the pinned tree) is also returned Absent: the auditor only ever samples keys it saw in round 1, so in practice this guards against a malformed/forged byte challenge rather than an honest mismatch.