assert relationship between constants necessary to avoid underflow
This commit is contained in:
parent
eda43b5b1c
commit
60e6a9fedc
|
@ -359,6 +359,8 @@ proc checkAttestation*(
|
||||||
## be followed!
|
## be followed!
|
||||||
|
|
||||||
# Can't underflow, because GENESIS_SLOT > MIN_ATTESTATION_INCLUSION_DELAY
|
# Can't underflow, because GENESIS_SLOT > MIN_ATTESTATION_INCLUSION_DELAY
|
||||||
|
doAssert GENESIS_SLOT > MIN_ATTESTATION_INCLUSION_DELAY
|
||||||
|
|
||||||
if not (attestation.data.slot <= state.slot - MIN_ATTESTATION_INCLUSION_DELAY):
|
if not (attestation.data.slot <= state.slot - MIN_ATTESTATION_INCLUSION_DELAY):
|
||||||
warn("Attestation too new",
|
warn("Attestation too new",
|
||||||
attestation_slot = attestation.data.slot, state_slot = state.slot)
|
attestation_slot = attestation.data.slot, state_slot = state.slot)
|
||||||
|
|
Loading…
Reference in New Issue