mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 11:52:42 +00:00
Ensure that parent_block.slot < block.slot
This commit is contained in:
@@ -53,6 +53,7 @@ pub enum SszBlockValidationError {
|
||||
UnknownPoWChainRef,
|
||||
UnknownParentHash,
|
||||
BadAttestationSsz,
|
||||
ParentSlotHigherThanBlockSlot,
|
||||
AttestationValidationError(AttestationValidationError),
|
||||
AttestationSignatureFailed,
|
||||
ProposerAttestationHasObliqueHashes,
|
||||
@@ -204,6 +205,15 @@ impl<T> BlockValidationContext<T>
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* The parent block slot must be less than the block slot.
|
||||
*
|
||||
* In other words, the parent must come before the child.
|
||||
*/
|
||||
if parent_block_slot >= block_slot {
|
||||
return Err(SszBlockValidationError::ParentSlotHigherThanBlockSlot);
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate the context in which attestations will be validated.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user