make attestation duty minimum offset relative to slot length (#3522)

This commit is contained in:
Jacek Sieka 2022-03-19 09:59:13 +01:00 committed by GitHub
parent 637f1e2be6
commit e418497bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1119,7 +1119,8 @@ proc handleValidatorDuties*(node: BeaconNode, lastSlot, slot: Slot) {.async.} =
# Regardless, because we "just" received the block, we'll impose the
# delay.
const afterBlockDelay = millis(2000)
# Take into consideration chains with a different slot time
const afterBlockDelay = nanos(attestationSlotOffset.nanoseconds div 2)
let
afterBlockTime = node.beaconClock.now() + afterBlockDelay
afterBlockCutoff = node.beaconClock.fromNow(