Skip to content

Commit

Permalink
Revert "Added Capella fork config for Goerli (Consensys#6898)"
Browse files Browse the repository at this point in the history
This reverts commit b043068.
  • Loading branch information
rolfyone committed Mar 3, 2023
1 parent b043068 commit 02849cf
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 111 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ For information on changes in released versions of Teku, see the [releases page]
- Added an optional query parameter `locally_submitted` to `/eth/v1/beacon/pool/bls_to_execution_changes` to allow users to query only bls changes submitted to the current node.
- Added `/eth/v1/builder/states/{state_id}/expected_withdrawals` rest api endpoint.
- Added `/eth/v1/beacon/rewards/sync_committee/{block_id}` rest api endpoint.
- Added Capella fork information for Goerli network configuration.

### Bug Fixes
- Included All forks in fork schedule if they're defined in configuration.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class SpecConfigReader {
ImmutableSet.of(
PRESET_KEY,
CONFIG_NAME_KEY,
// Unsupported, upcoming fork-related keys
"SHARDING_FORK_VERSION",
"SHARDING_FORK_EPOCH",
// Old merge config item which is no longer used, ignore for backwards compatibility
"TRANSITION_TOTAL_DIFFICULTY");
private static final ImmutableSet<String> CONSTANT_KEYS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ BELLATRIX_FORK_EPOCH: 385536 # 2022-11-30T19:23:40.000Z
CAPELLA_FORK_VERSION: 0x03000064
CAPELLA_FORK_EPOCH: 18446744073709551615
# Sharding
DENEB_FORK_VERSION: 0x04000064
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x04000064
SHARDING_FORK_EPOCH: 18446744073709551615

# TBD, 2**32 is a placeholder. Merge transition approach is in active R&D.
TRANSITION_TOTAL_DIFFICULTY: 4294967296
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ TERMINAL_BLOCK_HASH: 0x000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615

# Sharding
DENEB_FORK_VERSION: 0x03000000
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03000000
SHARDING_FORK_EPOCH: 18446744073709551615


# Time parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ BELLATRIX_FORK_EPOCH: 18446744073709551615
CAPELLA_FORK_VERSION: 0x03000001
CAPELLA_FORK_EPOCH: 18446744073709551615
# Sharding
DENEB_FORK_VERSION: 0x04000001
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x04000001
SHARDING_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ ALTAIR_FORK_EPOCH: 36660
# BELLATRIX
BELLATRIX_FORK_VERSION: 0x02001020
BELLATRIX_FORK_EPOCH: 112260
# Capella
CAPELLA_FORK_VERSION: 0x03001020
CAPELLA_FORK_EPOCH: 162304
# Sharding
DENEB_FORK_VERSION: 0x03001020
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03001020
SHARDING_FORK_EPOCH: 18446744073709551615


# Time parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ TERMINAL_BLOCK_HASH: 0x000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615

# Sharding
DENEB_FORK_VERSION: 0x03001020
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03001020
SHARDING_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ CAPELLA_FORK_VERSION: 0x90000072
CAPELLA_FORK_EPOCH: 56832

# Sharding
DENEB_FORK_VERSION: 0x04001020
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x04001020
SHARDING_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ 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");
private static final Set<String> CAPELLA_NETWORKS = Set.of("sepolia");

@Test
public void defaultFactoryShouldScheduleAltairAndBellatrixForMainNet() {
Expand All @@ -64,18 +64,6 @@ public void defaultFactoryShouldNotEnableBellatrixUnlessForkEpochIsSet(final Str
}
}

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

@Test
void shouldSupportAltairWhenForkEpochSetInConfig() {
final SpecConfig config =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
import tech.pegasys.teku.spec.config.SpecConfig;
import tech.pegasys.teku.spec.config.SpecConfigAltair;
import tech.pegasys.teku.spec.config.SpecConfigBellatrix;
import tech.pegasys.teku.spec.config.SpecConfigCapella;
import tech.pegasys.teku.spec.config.SpecConfigLoader;
import tech.pegasys.teku.spec.networks.Eth2Network;

public class SpecMilestoneTest {
private final SpecConfigCapella capellaSpecConfig =
SpecConfigCapella.required(SpecConfigLoader.loadConfig(Eth2Network.MINIMAL.configName()));
private final SpecConfigBellatrix bellatrixSpecConfig =
SpecConfigBellatrix.required(SpecConfigLoader.loadConfig(Eth2Network.MINIMAL.configName()));
private final SpecConfigAltair altairSpecConfig =
Expand All @@ -37,24 +34,13 @@ public class SpecMilestoneTest {

@Test
public void isGreaterThanOrEqualTo() {
// Phase0
assertThat(SpecMilestone.PHASE0.isGreaterThanOrEqualTo(SpecMilestone.PHASE0)).isTrue();
assertThat(SpecMilestone.PHASE0.isGreaterThanOrEqualTo(SpecMilestone.ALTAIR)).isFalse();

// Altair
assertThat(SpecMilestone.ALTAIR.isGreaterThanOrEqualTo(SpecMilestone.PHASE0)).isTrue();
assertThat(SpecMilestone.ALTAIR.isGreaterThanOrEqualTo(SpecMilestone.ALTAIR)).isTrue();
assertThat(SpecMilestone.ALTAIR.isGreaterThanOrEqualTo(SpecMilestone.BELLATRIX)).isFalse();

// Bellatrix
assertThat(SpecMilestone.PHASE0.isGreaterThanOrEqualTo(SpecMilestone.PHASE0)).isTrue();
assertThat(SpecMilestone.PHASE0.isGreaterThanOrEqualTo(SpecMilestone.ALTAIR)).isFalse();
assertThat(SpecMilestone.BELLATRIX.isGreaterThanOrEqualTo(SpecMilestone.ALTAIR)).isTrue();
assertThat(SpecMilestone.BELLATRIX.isGreaterThanOrEqualTo(SpecMilestone.BELLATRIX)).isTrue();
assertThat(SpecMilestone.BELLATRIX.isGreaterThanOrEqualTo(SpecMilestone.CAPELLA)).isFalse();

// Capella
assertThat(SpecMilestone.CAPELLA.isGreaterThanOrEqualTo(SpecMilestone.BELLATRIX)).isTrue();
assertThat(SpecMilestone.CAPELLA.isGreaterThanOrEqualTo(SpecMilestone.CAPELLA)).isTrue();
assertThat(SpecMilestone.CAPELLA.isGreaterThanOrEqualTo(SpecMilestone.DENEB)).isFalse();
assertThat(SpecMilestone.ALTAIR.isGreaterThanOrEqualTo(SpecMilestone.BELLATRIX)).isFalse();
}

@Test
Expand All @@ -74,12 +60,6 @@ public void getAllPriorMilestones_bellatrix() {
.contains(SpecMilestone.PHASE0, SpecMilestone.ALTAIR);
}

@Test
public void getAllPriorMilestones_capella() {
assertThat(SpecMilestone.getAllPriorMilestones(SpecMilestone.CAPELLA))
.contains(SpecMilestone.PHASE0, SpecMilestone.ALTAIR, SpecMilestone.BELLATRIX);
}

@Test
public void getMilestonesUpTo_phase0() {
assertThat(SpecMilestone.getMilestonesUpTo(SpecMilestone.PHASE0))
Expand All @@ -98,12 +78,6 @@ public void getMilestonesUpTo_bellatrix() {
.contains(SpecMilestone.PHASE0, SpecMilestone.ALTAIR, SpecMilestone.BELLATRIX);
}

@Test
public void getMilestonesUpTo_capella() {
assertThat(SpecMilestone.getMilestonesUpTo(SpecMilestone.CAPELLA))
.contains(SpecMilestone.PHASE0, SpecMilestone.ALTAIR, SpecMilestone.BELLATRIX);
}

@Test
public void areMilestonesInOrder() {
assertThat(SpecMilestone.areMilestonesInOrder(SpecMilestone.PHASE0, SpecMilestone.ALTAIR))
Expand All @@ -124,10 +98,6 @@ public void areMilestonesInOrder() {
SpecMilestone.areMilestonesInOrder(
SpecMilestone.PHASE0, SpecMilestone.BELLATRIX, SpecMilestone.ALTAIR))
.isFalse();
assertThat(SpecMilestone.areMilestonesInOrder(SpecMilestone.BELLATRIX, SpecMilestone.CAPELLA))
.isTrue();
assertThat(SpecMilestone.areMilestonesInOrder(SpecMilestone.CAPELLA, SpecMilestone.BELLATRIX))
.isFalse();
}

@Test
Expand All @@ -152,55 +122,35 @@ public void getForkVersion_bellatrix() {
}

@Test
public void getForkVersion_capella() {
final Bytes4 expected = capellaSpecConfig.getCapellaForkVersion();
assertThat(SpecMilestone.getForkVersion(capellaSpecConfig, SpecMilestone.CAPELLA))
.contains(expected);
}

@Test
public void getForkEpoch_phase0() {
public void getForkSlot_phase0() {
final UInt64 expected = UInt64.ZERO;
assertThat(SpecMilestone.getForkEpoch(altairSpecConfig, SpecMilestone.PHASE0))
.contains(expected);
}

@Test
public void getForkEpoch_altair() {
public void getForkSlot_altair() {
final UInt64 expected = altairSpecConfig.getAltairForkEpoch();
assertThat(SpecMilestone.getForkEpoch(altairSpecConfig, SpecMilestone.ALTAIR))
.contains(expected);
}

@Test
public void getForkEpoch_bellatrix() {
public void getForkSlot_bellatrix() {
final UInt64 expected = bellatrixSpecConfig.getBellatrixForkEpoch();
assertThat(SpecMilestone.getForkEpoch(bellatrixSpecConfig, SpecMilestone.BELLATRIX))
.contains(expected);
}

@Test
public void getForkEpoch_capella() {
final UInt64 expected = capellaSpecConfig.getCapellaForkEpoch();
assertThat(SpecMilestone.getForkEpoch(capellaSpecConfig, SpecMilestone.CAPELLA))
.contains(expected);
}

@Test
public void getForkEpoch_altairNotScheduled() {
public void getForkSlot_altairNotScheduled() {
assertThat(SpecMilestone.getForkEpoch(phase0SpecConfig, SpecMilestone.ALTAIR))
.contains(UInt64.MAX_VALUE);
}

@Test
public void getForkEpoch_bellatrixNotScheduled() {
assertThat(SpecMilestone.getForkEpoch(altairSpecConfig, SpecMilestone.BELLATRIX))
.contains(UInt64.MAX_VALUE);
}

@Test
public void getForkEpoch_capellaNotScheduled() {
assertThat(SpecMilestone.getForkEpoch(bellatrixSpecConfig, SpecMilestone.CAPELLA))
public void getForkSlot_bellatrixNotScheduled() {
assertThat(SpecMilestone.getForkEpoch(phase0SpecConfig, SpecMilestone.BELLATRIX))
.contains(UInt64.MAX_VALUE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.spec.config.SpecConfigAltair;
import tech.pegasys.teku.spec.config.SpecConfigBellatrix;
import tech.pegasys.teku.spec.config.SpecConfigCapella;
import tech.pegasys.teku.spec.config.SpecConfigLoader;
import tech.pegasys.teku.spec.networks.Eth2Network;

Expand Down Expand Up @@ -61,16 +60,4 @@ void shouldCreateBellatrixSpec() {
assertThat(actualVersion.get().getSchemaDefinitions())
.hasSameClassAs(expectedVersion.getSchemaDefinitions());
}

@Test
void shouldCreateCapellaSpec() {
final SpecConfigCapella capellaSpecConfig = SpecConfigCapella.required(minimalConfig);
final SpecVersion expectedVersion = SpecVersion.createCapella(capellaSpecConfig);
final Optional<SpecVersion> actualVersion =
SpecVersion.create(SpecMilestone.CAPELLA, minimalConfig);
assertThat(actualVersion).isPresent();
assertThat(actualVersion.get().getMilestone()).isEqualTo(SpecMilestone.CAPELLA);
assertThat(actualVersion.get().getSchemaDefinitions())
.hasSameClassAs(expectedVersion.getSchemaDefinitions());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ALTAIR_FORK_EPOCH: 18446744073709551615
BELLATRIX_FORK_VERSION: 0x02000001
BELLATRIX_FORK_EPOCH: 18446744073709551615
# Sharding
DENEB_FORK_VERSION: 0x03000001
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03000001
SHARDING_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ALTAIR_FORK_EPOCH: 18446744073709551615
BELLATRIX_FORK_VERSION: 0x02000001
BELLATRIX_FORK_EPOCH: 18446744073709551615
# Sharding
DENEB_FORK_VERSION: 0x03000001
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03000001
SHARDING_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ ALTAIR_FORK_EPOCH: 18446744073709551615
BELLATRIX_FORK_VERSION: 0x02000001
BELLATRIX_FORK_EPOCH: 18446744073709551615
# Sharding
DENEB_FORK_VERSION: 0x03000001
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03000001
SHARDING_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ ALTAIR_FORK_EPOCH: 18446744073709551615
BELLATRIX_FORK_VERSION: 0x02000000
BELLATRIX_FORK_EPOCH: 18446744073709551615
# Sharding
DENEB_FORK_VERSION: 0x03000000
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03000000
SHARDING_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ ALTAIR_FORK_EPOCH: 36660
BELLATRIX_FORK_VERSION: 0x02001020
BELLATRIX_FORK_EPOCH: 18446744073709551615
# Sharding
DENEB_FORK_VERSION: 0x03001020
DENEB_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_VERSION: 0x03001020
SHARDING_FORK_EPOCH: 18446744073709551615

# Transition
# ---------------------------------------------------------------
Expand Down

0 comments on commit 02849cf

Please sign in to comment.