Skip to content

Commit

Permalink
enable ILs duties based on fork
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi committed Feb 14, 2025
1 parent 97acbb7 commit 4e8a774
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ protected Node(final Network network, final String dockerImage, final Logger log
getClass().getSimpleName().toLowerCase(Locale.US) + NODE_UNIQUIFIER.incrementAndGet();
this.container =
new NodeContainer(dockerImage)
.withEnv("JAVA_OPTS", "-XX:UseSVE=0")
.withImagePullPolicy(PullPolicy.defaultPolicy())
.withNetwork(network)
.withNetworkAliases(nodeAlias)
Expand Down
4 changes: 2 additions & 2 deletions docker/jdk21/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM eclipse-temurin:21 as jre-build

# Create a custom Java runtime
RUN JAVA_TOOL_OPTIONS="-Djdk.lang.Process.launchMechanism=vfork" $JAVA_HOME/bin/jlink \
RUN JAVA_TOOL_OPTIONS="-Djdk.lang.Process.launchMechanism=vfork -XX:UseSVE=0" $JAVA_HOME/bin/jlink \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
Expand Down Expand Up @@ -39,7 +39,7 @@ ENV TEKU_REST_API_INTERFACE="0.0.0.0"
ENV TEKU_VALIDATOR_API_INTERFACE="0.0.0.0"
ENV TEKU_METRICS_INTERFACE="0.0.0.0"
ENV PATH "/opt/teku/bin:${PATH}"

ENV TEKU_OPTS -XX:UseSVE=0
# List Exposed Ports
# Metrics, Rest API, LibP2P, Discv5
EXPOSE 8008 5051 9000 9000/udp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -76,9 +78,17 @@ public static Spec create(final SpecConfigAndParent<? extends SpecConfig> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 4e8a774

Please sign in to comment.