Remove TOCTOU early return

This commit is contained in:
Michael Sproul
2026-04-01 11:31:51 +11:00
parent bc6cf0f882
commit 4684d972e0

View File

@@ -1305,17 +1305,10 @@ where
return Ok(()); return Ok(());
} }
match self.validate_on_payload_attestation(attestation, is_from_block) { // TODO(gloas): Should ignore wrong-slot payload attestations at the caller, they could
Ok(()) => (), // have been processed at the correct slot when received on gossip, but then have the
Err(InvalidAttestation::PayloadAttestationNotCurrentSlot { .. }) => { // wrong-slot by the time they make it to here (TOCTOU).
// Just ignore wrong-slot payload attestations, they could have been processed at self.validate_on_payload_attestation(attestation, is_from_block)?;
// the correct slot when received on gossip, but then have the wrong-slot by the
// time they make it to here (TOCTOU).
// TODO(gloas): consider moving this to the call site for gossip processing
return Ok(());
}
Err(e) => return Err(e.into()),
}
// Resolve validator indices to PTC committee positions. // Resolve validator indices to PTC committee positions.
let ptc_indices: Vec<usize> = attestation let ptc_indices: Vec<usize> = attestation