From 78bf8178cc77278b37428607a5512b2c046182a1 Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Wed, 4 Dec 2024 16:08:56 +0000 Subject: [PATCH] remove constants --- .../spec/config/DelegatingSpecConfig.java | 10 ---------- .../spec/config/NetworkingSpecConfig.java | 6 ------ .../teku/spec/config/SpecConfigPhase0.java | 20 ------------------- .../config/builder/SpecConfigBuilder.java | 16 --------------- .../cli/subcommand/RemoteSpecLoaderTest.java | 2 -- 5 files changed, 54 deletions(-) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/DelegatingSpecConfig.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/DelegatingSpecConfig.java index b513c9b16bf..403dae93aba 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/DelegatingSpecConfig.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/DelegatingSpecConfig.java @@ -327,16 +327,6 @@ public int getMaxChunkSize() { return specConfig.getMaxChunkSize(); } - @Override - public int getTtfbTimeout() { - return specConfig.getTtfbTimeout(); - } - - @Override - public int getRespTimeout() { - return specConfig.getRespTimeout(); - } - @Override public int getAttestationPropagationSlotRange() { return specConfig.getAttestationPropagationSlotRange(); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/NetworkingSpecConfig.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/NetworkingSpecConfig.java index ef5b229dfcc..a41f0d5f920 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/NetworkingSpecConfig.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/NetworkingSpecConfig.java @@ -27,12 +27,6 @@ public interface NetworkingSpecConfig { int getMinEpochsForBlockRequests(); - // in seconds - int getTtfbTimeout(); - - // in seconds - int getRespTimeout(); - int getAttestationPropagationSlotRange(); // in millis diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigPhase0.java index 6d41969704c..52654dfdd29 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigPhase0.java @@ -107,8 +107,6 @@ public class SpecConfigPhase0 implements SpecConfig { private final int maxRequestBlocks; private final int epochsPerSubnetSubscription; private final int minEpochsForBlockRequests; - private final int ttfbTimeout; - private final int respTimeout; private final int attestationPropagationSlotRange; private final int maximumGossipClockDisparity; private final Bytes4 messageDomainInvalidSnappy; @@ -179,8 +177,6 @@ public SpecConfigPhase0( final int maxRequestBlocks, final int epochsPerSubnetSubscription, final int minEpochsForBlockRequests, - final int ttfbTimeout, - final int respTimeout, final int attestationPropagationSlotRange, final int maximumGossipClockDisparity, final Bytes4 messageDomainInvalidSnappy, @@ -249,8 +245,6 @@ public SpecConfigPhase0( this.maxRequestBlocks = maxRequestBlocks; this.epochsPerSubnetSubscription = epochsPerSubnetSubscription; this.minEpochsForBlockRequests = minEpochsForBlockRequests; - this.ttfbTimeout = ttfbTimeout; - this.respTimeout = respTimeout; this.attestationPropagationSlotRange = attestationPropagationSlotRange; this.maximumGossipClockDisparity = maximumGossipClockDisparity; this.messageDomainInvalidSnappy = messageDomainInvalidSnappy; @@ -585,16 +579,6 @@ public int getMinEpochsForBlockRequests() { return minEpochsForBlockRequests; } - @Override - public int getTtfbTimeout() { - return ttfbTimeout; - } - - @Override - public int getRespTimeout() { - return respTimeout; - } - @Override public int getAttestationPropagationSlotRange() { return attestationPropagationSlotRange; @@ -691,8 +675,6 @@ public boolean equals(final Object o) { && attestationSubnetCount == that.attestationSubnetCount && attestationSubnetExtraBits == that.attestationSubnetExtraBits && attestationSubnetPrefixBits == that.attestationSubnetPrefixBits - && ttfbTimeout == that.ttfbTimeout - && respTimeout == that.respTimeout && attestationPropagationSlotRange == that.attestationPropagationSlotRange && maximumGossipClockDisparity == that.maximumGossipClockDisparity && Objects.equals(eth1FollowDistance, that.eth1FollowDistance) @@ -772,8 +754,6 @@ public int hashCode() { maxChunkSize, maxRequestBlocks, epochsPerSubnetSubscription, - ttfbTimeout, - respTimeout, attestationPropagationSlotRange, maximumGossipClockDisparity, messageDomainInvalidSnappy, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/SpecConfigBuilder.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/SpecConfigBuilder.java index 5e48e29614c..e731ec925fe 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/SpecConfigBuilder.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/SpecConfigBuilder.java @@ -112,8 +112,6 @@ public class SpecConfigBuilder { private Integer maxChunkSize; private Integer maxRequestBlocks; private Integer epochsPerSubnetSubscription; - private Integer ttfbTimeout; - private Integer respTimeout; private Integer attestationPropagationSlotRange; private Integer maximumGossipClockDisparity; private Bytes4 messageDomainInvalidSnappy; @@ -205,8 +203,6 @@ public SpecConfigAndParent build() { maxRequestBlocks, epochsPerSubnetSubscription, minEpochsForBlockRequests, - ttfbTimeout, - respTimeout, attestationPropagationSlotRange, maximumGossipClockDisparity, messageDomainInvalidSnappy, @@ -279,8 +275,6 @@ private Map getValidationMap() { constants.put("maxRequestBlocks", maxRequestBlocks); constants.put("epochsPerSubnetSubscription", epochsPerSubnetSubscription); constants.put("minEpochsForBlockRequests", minEpochsForBlockRequests); - constants.put("ttfbTimeout", ttfbTimeout); - constants.put("respTimeout", respTimeout); constants.put("attestationPropagationSlotRange", attestationPropagationSlotRange); constants.put("maximumGossipClockDisparity", maximumGossipClockDisparity); constants.put("messageDomainInvalidSnappy", messageDomainInvalidSnappy); @@ -651,16 +645,6 @@ public SpecConfigBuilder minEpochsForBlockRequests(final Integer minEpochsForBlo return this; } - public SpecConfigBuilder ttfbTimeout(final Integer ttfbTimeout) { - this.ttfbTimeout = ttfbTimeout; - return this; - } - - public SpecConfigBuilder respTimeout(final Integer respTimeout) { - this.respTimeout = respTimeout; - return this; - } - public SpecConfigBuilder attestationPropagationSlotRange( final Integer attestationPropagationSlotRange) { this.attestationPropagationSlotRange = attestationPropagationSlotRange; diff --git a/teku/src/test/java/tech/pegasys/teku/cli/subcommand/RemoteSpecLoaderTest.java b/teku/src/test/java/tech/pegasys/teku/cli/subcommand/RemoteSpecLoaderTest.java index a6818600c2c..5747896cae1 100644 --- a/teku/src/test/java/tech/pegasys/teku/cli/subcommand/RemoteSpecLoaderTest.java +++ b/teku/src/test/java/tech/pegasys/teku/cli/subcommand/RemoteSpecLoaderTest.java @@ -78,8 +78,6 @@ void shouldDefaultNetworkConfigThatMovedFromConstants() throws IOException { assertThat(specConfig.getMaxRequestBlocks()).isEqualTo(1024); assertThat(specConfig.getEpochsPerSubnetSubscription()).isEqualTo(256); assertThat(specConfig.getMinEpochsForBlockRequests()).isEqualTo(33024); - assertThat(specConfig.getTtfbTimeout()).isEqualTo(5); - assertThat(specConfig.getRespTimeout()).isEqualTo(10); assertThat(specConfig.getAttestationPropagationSlotRange()).isEqualTo(32); assertThat(specConfig.getMaximumGossipClockDisparity()).isEqualTo(500); }