mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Remove TOCTOU early return
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user