Skip to content

Commit bd684d0

Browse files
committed
increase block attestation wait time (#2705)
We generally send out attestations 250 ms after the block arrives. Recent efficiency improvements have led to a slightly increased incidence of "slot 0" issues where attestations are dropped by other nodes because they have not yet had time to process the block due to epoch processing taking time. This PR mitigates the problem by increasing the window between receiving the block and sending out attestations.
1 parent be75645 commit bd684d0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

beacon_chain/validators/validator_duties.nim

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,18 @@ proc handleValidatorDuties*(node: BeaconNode, lastSlot, slot: Slot) {.async.} =
688688
# An opposite case is that we received (or produced) a block that has
689689
# not yet reached our neighbours. To protect against our attestations
690690
# being dropped (because the others have not yet seen the block), we'll
691-
# impose a minimum delay of 250ms. The delay is enforced only when we're
691+
# impose a minimum delay of 1000ms. The delay is enforced only when we're
692692
# not hitting the "normal" cutoff time for sending out attestations.
693+
# An earlier delay of 250ms has proven to be not enough, increasing the
694+
# risk of losing attestations.
695+
# Regardless, because we "just" received the block, we'll impose the
696+
# delay.
693697

694-
const afterBlockDelay = 250
698+
const afterBlockDelay = 1000
695699
let
696700
afterBlockTime = node.beaconClock.now() + millis(afterBlockDelay)
697701
afterBlockCutoff = node.beaconClock.fromNow(
698-
min(afterBlockTime, attestationCutoffTime))
702+
min(afterBlockTime, attestationCutoffTime + millis(afterBlockDelay)))
699703

700704
if afterBlockCutoff.inFuture:
701705
debug "Got block, waiting to send attestations",

0 commit comments

Comments
 (0)