Skip to main content

handle_subtree_challenge

Function handle_subtree_challenge 

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

Handle an incoming subtree audit challenge (responder side).

Validates the challenge targets this node, looks up the pinned commitment in the retained (last-two-gossiped) set, and builds the subtree proof for the nonce-selected branch. If this node is bootstrapping it says so; if it genuinely does not retain the pinned commitment it rejects (which the auditor treats as a confirmed failure for a recently gossiped root).