register validators for MEV regardless of whether attached to BN (#4363)

This commit is contained in:
tersec 2022-11-26 18:50:42 +00:00 committed by GitHub
parent 898684c175
commit c5d52f1b25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -1312,6 +1312,13 @@ proc onSlotStart(node: BeaconNode, wallTime: BeaconTime,
await onSlotEnd(node, wallSlot)
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#registration-dissemination
# This specification suggests validators re-submit to builder software every
# `EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION` epochs.
if wallSlot.is_epoch and
wallSlot.epoch mod EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION == 0:
asyncSpawn node.registerValidators(wallSlot.epoch)
return false
proc handleMissingBlocks(node: BeaconNode) =

View File

@ -1282,7 +1282,7 @@ proc getValidatorRegistration(
from std/sequtils import toSeq
proc registerValidators(node: BeaconNode, epoch: Epoch) {.async.} =
proc registerValidators*(node: BeaconNode, epoch: Epoch) {.async.} =
try:
if (not node.config.payloadBuilderEnable) or
node.currentSlot.epoch < node.dag.cfg.BELLATRIX_FORK_EPOCH:
@ -1444,13 +1444,6 @@ proc handleValidatorDuties*(node: BeaconNode, lastSlot, slot: Slot) {.async.} =
curSlot += 1
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#registration-dissemination
# This specification suggests validators re-submit to builder software every
# `EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION` epochs.
if slot.is_epoch and
slot.epoch mod EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION == 0:
asyncSpawn node.registerValidators(slot.epoch)
let
newHead = await handleProposal(node, head, slot)
didSubmitBlock = (newHead != head)