Far-future epoch check before installing 4844 vals (#4497)

This commit is contained in:
henridf 2023-01-12 21:46:12 +01:00 committed by GitHub
parent 7e276937dc
commit 9da64bb605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

View File

@ -1468,7 +1468,8 @@ proc installMessageValidators(node: BeaconNode) =
installPhase0Validators(forkDigests.altair) installPhase0Validators(forkDigests.altair)
installPhase0Validators(forkDigests.bellatrix) installPhase0Validators(forkDigests.bellatrix)
installPhase0Validators(forkDigests.capella) installPhase0Validators(forkDigests.capella)
installPhase0Validators(forkDigests.eip4844) if node.dag.cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH:
installPhase0Validators(forkDigests.eip4844)
node.network.addValidator( node.network.addValidator(
getBeaconBlocksTopic(forkDigests.altair), getBeaconBlocksTopic(forkDigests.altair),
@ -1500,12 +1501,13 @@ proc installMessageValidators(node: BeaconNode) =
toValidationResult(node.processor[].processSignedBeaconBlock( toValidationResult(node.processor[].processSignedBeaconBlock(
MsgSource.gossip, signedBlock))) MsgSource.gossip, signedBlock)))
node.network.addValidator( if node.dag.cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH:
getBeaconBlockAndBlobsSidecarTopic(forkDigests.eip4844), node.network.addValidator(
proc (signedBlock: eip4844.SignedBeaconBlockAndBlobsSidecar): ValidationResult = getBeaconBlockAndBlobsSidecarTopic(forkDigests.eip4844),
# TODO: take into account node.shouldSyncOptimistically(node.currentSlot) proc (signedBlock: eip4844.SignedBeaconBlockAndBlobsSidecar): ValidationResult =
toValidationResult(node.processor[].processSignedBeaconBlockAndBlobsSidecar( # TODO: take into account node.shouldSyncOptimistically(node.currentSlot)
MsgSource.gossip, signedBlock))) toValidationResult(node.processor[].processSignedBeaconBlockAndBlobsSidecar(
MsgSource.gossip, signedBlock)))
template installSyncCommitteeeValidators(digest: auto) = template installSyncCommitteeeValidators(digest: auto) =
for subcommitteeIdx in SyncSubcommitteeIndex: for subcommitteeIdx in SyncSubcommitteeIndex:
@ -1529,7 +1531,8 @@ proc installMessageValidators(node: BeaconNode) =
installSyncCommitteeeValidators(forkDigests.altair) installSyncCommitteeeValidators(forkDigests.altair)
installSyncCommitteeeValidators(forkDigests.bellatrix) installSyncCommitteeeValidators(forkDigests.bellatrix)
installSyncCommitteeeValidators(forkDigests.capella) installSyncCommitteeeValidators(forkDigests.capella)
installSyncCommitteeeValidators(forkDigests.eip4844) if node.dag.cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH:
installSyncCommitteeeValidators(forkDigests.eip4844)
node.installLightClientMessageValidators() node.installLightClientMessageValidators()