Skip to content

Commit

Permalink
Drafted goerli deneb network change
Browse files Browse the repository at this point in the history
The pr was missing some config I think, I had to add a bunch of Deneb fields that were flagged missing in tests.

Ref. eth-clients/goerli#178

Signed-off-by: Paul Harris <paul.harris@consensys.net>
  • Loading branch information
rolfyone committed Dec 23, 2023
1 parent 5c2c4a8 commit b809016
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ BELLATRIX_FORK_EPOCH: 112260
# CAPELLA
CAPELLA_FORK_VERSION: 0x03001020
CAPELLA_FORK_EPOCH: 162304
# DENEB
DENEB_FORK_VERSION: 0x04001020
DENEB_FORK_EPOCH: 231680
# Sharding
SHARDING_FORK_VERSION: 0x03001020
SHARDING_FORK_EPOCH: 18446744073709551615
Expand Down Expand Up @@ -71,6 +74,8 @@ EJECTION_BALANCE: 16000000000
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536
# [New in Deneb:EIP7514] 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8


# Fork choice
Expand Down Expand Up @@ -119,4 +124,16 @@ 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
ATTESTATION_SUBNET_PREFIX_BITS: 6

# Deneb
# `2**7` (=128)
MAX_REQUEST_BLOCKS_DENEB: 128
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
MAX_REQUEST_BLOB_SIDECARS: 768
# `2**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6
# `uint64(6)`
MAX_BLOBS_PER_BLOCK: 6
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import static tech.pegasys.teku.spec.SpecMilestone.ALTAIR;
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.PHASE0;

import java.util.Arrays;
Expand All @@ -39,7 +40,9 @@ public class SpecFactoryTest {
private static final Set<String> NON_BELLATRIX_NETWORKS = Set.of("swift", "less-swift");

private static final Set<String> CAPELLA_NETWORKS =
Set.of("sepolia", "prater", "mainnet", "gnosis", "chiado", "lukso", "holesky");
Set.of("sepolia", "mainnet", "gnosis", "chiado", "lukso", "holesky");

private static final Set<String> DENEB_NETWORKS = Set.of("prater");

@Test
public void defaultFactoryShouldScheduleBellatrixAndCapellaForMainNet() {
Expand All @@ -59,6 +62,9 @@ public void defaultFactoryShouldNotEnableBellatrixUnlessForkEpochIsSet(final Str
} else if (CAPELLA_NETWORKS.contains(configName)) {
assertThat(spec.getForkSchedule().getSupportedMilestones())
.containsExactly(PHASE0, ALTAIR, BELLATRIX, CAPELLA);
} else if (DENEB_NETWORKS.contains(configName)) {
assertThat(spec.getForkSchedule().getSupportedMilestones())
.containsExactly(PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB);
} else {
assertThat(spec.getForkSchedule().getSupportedMilestones())
.containsExactly(PHASE0, ALTAIR, BELLATRIX);
Expand All @@ -72,11 +78,26 @@ public void shouldSupportCapellaWhenForkEpochSetInConfig(final String configName
if (CAPELLA_NETWORKS.contains(configName)) {
assertThat(spec.getForkSchedule().getSupportedMilestones())
.containsExactly(PHASE0, ALTAIR, BELLATRIX, CAPELLA);
} else if (DENEB_NETWORKS.contains(configName)) {
assertThat(spec.getForkSchedule().getSupportedMilestones())
.contains(PHASE0, ALTAIR, BELLATRIX, CAPELLA);
} else {
assertThat(spec.getForkSchedule().getSupportedMilestones()).doesNotContain(CAPELLA);
}
}

@ParameterizedTest(name = "{0}")
@MethodSource("getKnownConfigNames")
public void shouldSupportDenebWhenForkEpochSetInConfig(final String configName) {
final Spec spec = SpecFactory.create(configName);
if (DENEB_NETWORKS.contains(configName)) {
assertThat(spec.getForkSchedule().getSupportedMilestones())
.containsExactly(PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB);
} else {
assertThat(spec.getForkSchedule().getSupportedMilestones()).doesNotContain(DENEB);
}
}

@Test
void shouldSupportAltairWhenForkEpochSetInConfig() {
final SpecConfig config =
Expand Down

0 comments on commit b809016

Please sign in to comment.