assert relationship between constants necessary to avoid underflow

This commit is contained in:
Dustin Brody 2019-02-25 06:53:01 -08:00
parent eda43b5b1c
commit 60e6a9fedc
1 changed files with 2 additions and 0 deletions

View File

@ -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)