Skip to content

Commit

Permalink
Change to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Nov 25, 2024
1 parent 11cb4c2 commit acf6314
Show file tree
Hide file tree
Showing 25 changed files with 18 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,4 @@ SUBNETS_PER_NODE: 2
ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2
ATTESTATION_SUBNET_PREFIX_BITS: 6
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -392,11 +382,6 @@ public int getAttestationSubnetPrefixBits() {
return specConfig.getAttestationSubnetPrefixBits();
}

@Override
public int getMaxConcurrentRequests() {
return specConfig.getMaxConcurrentRequests();
}

@Override
public int getProposerScoreBoost() {
return specConfig.getProposerScoreBoost();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ public interface NetworkingSpecConfig {

int getMinEpochsForBlockRequests();

// in seconds
int getTtfbTimeout();

// in seconds
int getRespTimeout();

int getAttestationPropagationSlotRange();

// in millis
Expand All @@ -54,8 +48,6 @@ public interface NetworkingSpecConfig {
// int(ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS)
int getAttestationSubnetPrefixBits();

int getMaxConcurrentRequests();

default NetworkingSpecConfig getNetworkingConfig() {
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -117,7 +115,6 @@ public class SpecConfigPhase0 implements SpecConfig {
private final int attestationSubnetCount;
private final int attestationSubnetExtraBits;
private final int attestationSubnetPrefixBits;
private final int maxConcurrentRequests;
private final int reorgMaxEpochsSinceFinalization;
private final int reorgHeadWeightThreshold;
private final int reorgParentWeightThreshold;
Expand Down Expand Up @@ -180,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,
Expand All @@ -190,7 +185,6 @@ public SpecConfigPhase0(
final int attestationSubnetCount,
final int attestationSubnetExtraBits,
final int attestationSubnetPrefixBits,
final int maxConcurrentRequests,
final int reorgMaxEpochsSinceFinalization,
final int reorgHeadWeightThreshold,
final int reorgParentWeightThreshold,
Expand Down Expand Up @@ -251,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;
Expand All @@ -261,7 +253,6 @@ public SpecConfigPhase0(
this.attestationSubnetCount = attestationSubnetCount;
this.attestationSubnetExtraBits = attestationSubnetExtraBits;
this.attestationSubnetPrefixBits = attestationSubnetPrefixBits;
this.maxConcurrentRequests = maxConcurrentRequests;
this.reorgMaxEpochsSinceFinalization = reorgMaxEpochsSinceFinalization;
this.reorgHeadWeightThreshold = reorgHeadWeightThreshold;
this.reorgParentWeightThreshold = reorgParentWeightThreshold;
Expand Down Expand Up @@ -588,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;
Expand Down Expand Up @@ -638,11 +619,6 @@ public int getAttestationSubnetPrefixBits() {
return attestationSubnetPrefixBits;
}

@Override
public int getMaxConcurrentRequests() {
return maxConcurrentRequests;
}

@Override
public SpecMilestone getMilestone() {
return SpecMilestone.PHASE0;
Expand Down Expand Up @@ -699,9 +675,6 @@ public boolean equals(final Object o) {
&& attestationSubnetCount == that.attestationSubnetCount
&& attestationSubnetExtraBits == that.attestationSubnetExtraBits
&& attestationSubnetPrefixBits == that.attestationSubnetPrefixBits
&& maxConcurrentRequests == that.maxConcurrentRequests
&& ttfbTimeout == that.ttfbTimeout
&& respTimeout == that.respTimeout
&& attestationPropagationSlotRange == that.attestationPropagationSlotRange
&& maximumGossipClockDisparity == that.maximumGossipClockDisparity
&& Objects.equals(eth1FollowDistance, that.eth1FollowDistance)
Expand Down Expand Up @@ -781,16 +754,13 @@ public int hashCode() {
maxChunkSize,
maxRequestBlocks,
epochsPerSubnetSubscription,
ttfbTimeout,
respTimeout,
attestationPropagationSlotRange,
maximumGossipClockDisparity,
messageDomainInvalidSnappy,
messageDomainValidSnappy,
subnetsPerNode,
attestationSubnetCount,
attestationSubnetExtraBits,
attestationSubnetPrefixBits,
maxConcurrentRequests);
attestationSubnetPrefixBits);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public class SpecConfigReader {
"TRANSITION_TOTAL_DIFFICULTY",
// Deprecated fields
"GOSSIP_MAX_SIZE_BELLATRIX",
"MAX_CHUNK_SIZE_BELLATRIX");
"MAX_CHUNK_SIZE_BELLATRIX",
"TTFB_TIMEOUT",
"RESP_TIMEOUT");
private static final ImmutableSet<String> CONSTANT_KEYS =
ImmutableSet.of(
// Phase0 constants which may exist in legacy config files, but should now be ignored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -123,7 +121,6 @@ public class SpecConfigBuilder {
private Integer attestationSubnetCount;
private Integer attestationSubnetExtraBits;
private Integer attestationSubnetPrefixBits;
private Integer maxConcurrentRequests;

// added after Phase0, so add default values, or will be compatibility issue
private Integer reorgMaxEpochsSinceFinalization = 2;
Expand Down Expand Up @@ -206,8 +203,6 @@ public SpecConfigAndParent<SpecConfigElectra> build() {
maxRequestBlocks,
epochsPerSubnetSubscription,
minEpochsForBlockRequests,
ttfbTimeout,
respTimeout,
attestationPropagationSlotRange,
maximumGossipClockDisparity,
messageDomainInvalidSnappy,
Expand All @@ -216,7 +211,6 @@ public SpecConfigAndParent<SpecConfigElectra> build() {
attestationSubnetCount,
attestationSubnetExtraBits,
attestationSubnetPrefixBits,
maxConcurrentRequests,
reorgMaxEpochsSinceFinalization,
reorgHeadWeightThreshold,
reorgParentWeightThreshold,
Expand Down Expand Up @@ -281,8 +275,6 @@ private Map<String, Object> 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);
Expand All @@ -291,7 +283,6 @@ private Map<String, Object> getValidationMap() {
constants.put("attestationSubnetCount", attestationSubnetCount);
constants.put("attestationSubnetExtraBits", attestationSubnetExtraBits);
constants.put("attestationSubnetPrefixBits", attestationSubnetPrefixBits);
constants.put("maxConcurrentRequests", maxConcurrentRequests);
constants.put("reorgMaxEpochsSinceFinalization", reorgMaxEpochsSinceFinalization);
constants.put("reorgHeadWeightThreshold", reorgHeadWeightThreshold);
constants.put("reorgParentWeightThreshold", reorgParentWeightThreshold);
Expand Down Expand Up @@ -654,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;
Expand Down Expand Up @@ -705,11 +686,6 @@ public SpecConfigBuilder attestationSubnetPrefixBits(final Integer attestationSu
return this;
}

public SpecConfigBuilder maxConcurrentRequests(final Integer maxConcurrentRequests) {
this.maxConcurrentRequests = maxConcurrentRequests;
return this;
}

public SpecConfigBuilder reorgMaxEpochsSinceFinalization(
final Integer reorgMaxEpochsSinceFinalization) {
this.reorgMaxEpochsSinceFinalization = reorgMaxEpochsSinceFinalization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ public class NetworkConstants {
public static final int DEFAULT_SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY = 128;

public static final int NODE_ID_BITS = 256;

// https://github.com/ethereum/consensus-specs/pull/3767
public static final int MAX_CONCURRENT_REQUESTS = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2

# Deneb
# `2**7` (=128)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,4 @@ SUBNETS_PER_NODE: 2
ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2
ATTESTATION_SUBNET_PREFIX_BITS: 6
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,4 @@ SUBNETS_PER_NODE: 2
ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2
ATTESTATION_SUBNET_PREFIX_BITS: 6
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,4 @@ SUBNETS_PER_NODE: 2
ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6
MAX_CONCURRENT_REQUESTS: 2
ATTESTATION_SUBNET_PREFIX_BITS: 6
Loading

0 comments on commit acf6314

Please sign in to comment.