diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java index 5a32aae7313..923dbde9d04 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java @@ -17,6 +17,7 @@ import static tech.pegasys.teku.spec.SpecMilestone.BELLATRIX; import static tech.pegasys.teku.spec.SpecMilestone.CAPELLA; import static tech.pegasys.teku.spec.SpecMilestone.DENEB; +import static tech.pegasys.teku.spec.SpecMilestone.EIP7805; import static tech.pegasys.teku.spec.SpecMilestone.ELECTRA; import static tech.pegasys.teku.spec.SpecMilestone.PHASE0; import static tech.pegasys.teku.spec.config.SpecConfig.FAR_FUTURE_EPOCH; @@ -29,6 +30,7 @@ import tech.pegasys.teku.spec.config.SpecConfigBellatrix; import tech.pegasys.teku.spec.config.SpecConfigCapella; import tech.pegasys.teku.spec.config.SpecConfigDeneb; +import tech.pegasys.teku.spec.config.SpecConfigEip7805; import tech.pegasys.teku.spec.config.SpecConfigElectra; import tech.pegasys.teku.spec.config.SpecConfigLoader; import tech.pegasys.teku.spec.config.builder.SpecConfigBuilder; @@ -76,9 +78,17 @@ public static Spec create(final SpecConfigAndParent config .toVersionElectra() .map(SpecConfigElectra::getElectraForkEpoch) .orElse(FAR_FUTURE_EPOCH); + final UInt64 eip7805ForkEpoch = + config + .specConfig() + .toVersionEip7805() + .map(SpecConfigEip7805::getEip7805ForkEpoch) + .orElse(FAR_FUTURE_EPOCH); final SpecMilestone highestMilestoneSupported; - if (!electraForkEpoch.equals(FAR_FUTURE_EPOCH)) { + if (!eip7805ForkEpoch.equals(FAR_FUTURE_EPOCH)) { + highestMilestoneSupported = EIP7805; + } else if (!electraForkEpoch.equals(FAR_FUTURE_EPOCH)) { highestMilestoneSupported = ELECTRA; } else if (!denebForkEpoch.equals(FAR_FUTURE_EPOCH)) { highestMilestoneSupported = DENEB; diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java index 914bbf98f8c..7548c9686cb 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java @@ -466,8 +466,7 @@ private void scheduleValidatorsDuties( new InclusionListDutyFactory(validatorApiChannel); final BeaconCommitteeSubscriptions beaconCommitteeSubscriptions = new BeaconCommitteeSubscriptions(validatorApiChannel); - final InclusionListCommitteeSubscriptions inclusionListCommitteeSubscriptions = - new InclusionListCommitteeSubscriptions(); + final boolean dvtSelectionsEndpointEnabled = config.getValidatorConfig().isDvtSelectionsEndpointEnabled(); final DutyLoader attestationDutyLoader = @@ -498,24 +497,9 @@ private void scheduleValidatorsDuties( validatorDutyMetrics::performDutyWithMetrics), validators, validatorIndexProvider)); - final DutyLoader inclusionListDutyLoader = - new RetryingDutyLoader<>( - asyncRunner, - new InclusionListDutyLoader( - validatorApiChannel, - dependentRoot -> - new SlotBasedScheduledDuties<>( - inclusionListDutyFactory, - dependentRoot, - validatorDutyMetrics::performDutyWithMetrics), - validators, - validatorIndexProvider, - inclusionListCommitteeSubscriptions)); validatorTimingChannels.add(new BlockDutyScheduler(metricsSystem, blockDutyLoader, spec)); validatorTimingChannels.add( new AttestationDutyScheduler(metricsSystem, attestationDutyLoader, spec)); - validatorTimingChannels.add( - new InclusionListDutyScheduler(metricsSystem, inclusionListDutyLoader, spec)); validatorTimingChannels.add(validatorLoader.getSlashingProtectionLogger()); if (spec.isMilestoneSupported(SpecMilestone.ALTAIR)) { @@ -546,6 +530,27 @@ private void scheduleValidatorsDuties( }); validatorRegistrator.ifPresent(validatorTimingChannels::add); } + + if (spec.isMilestoneSupported(SpecMilestone.EIP7805)) { + final InclusionListCommitteeSubscriptions inclusionListCommitteeSubscriptions = + new InclusionListCommitteeSubscriptions(); + final DutyLoader inclusionListDutyLoader = + new RetryingDutyLoader<>( + asyncRunner, + new InclusionListDutyLoader( + validatorApiChannel, + dependentRoot -> + new SlotBasedScheduledDuties<>( + inclusionListDutyFactory, + dependentRoot, + validatorDutyMetrics::performDutyWithMetrics), + validators, + validatorIndexProvider, + inclusionListCommitteeSubscriptions)); + validatorTimingChannels.add( + new InclusionListDutyScheduler(metricsSystem, inclusionListDutyLoader, spec)); + } + addValidatorCountMetric(metricsSystem, validators); final ValidatorStatusLogger validatorStatusLogger = new ValidatorStatusLogger(validators); validatorStatusProvider.subscribeValidatorStatusesUpdates(