Skip to content

Commit

Permalink
8944 focil spec config (#8948)
Browse files Browse the repository at this point in the history
* add missing test spec config
  • Loading branch information
mehdi-aouadi authored Dec 20, 2024
1 parent 79c59d0 commit f0f3f50
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static Spec createMinimal(final SpecMilestone specMilestone) {
case CAPELLA -> createMinimalCapella();
case DENEB -> createMinimalDeneb();
case ELECTRA -> createMinimalElectra();
case EIP7805 -> createMainnetEip7805();
};
}

Expand All @@ -55,6 +56,7 @@ public static Spec createMainnet(final SpecMilestone specMilestone) {
case CAPELLA -> createMainnetCapella();
case DENEB -> createMainnetDeneb();
case ELECTRA -> createMainnetElectra();
case EIP7805 -> createMainnetEip7805();
};
}

Expand Down Expand Up @@ -221,6 +223,12 @@ public static Spec createMainnetElectra() {
return create(specConfig, SpecMilestone.ELECTRA);
}

public static Spec createMainnetEip7805() {
final SpecConfigAndParent<? extends SpecConfig> specConfig =
getElectraSpecConfig(Eth2Network.MAINNET);
return create(specConfig, SpecMilestone.ELECTRA);
}

public static Spec createPhase0(final SpecConfigAndParent<? extends SpecConfig> config) {
return create(config, SpecMilestone.PHASE0);
}
Expand Down Expand Up @@ -271,6 +279,15 @@ public static Spec create(
.capellaBuilder(c -> c.capellaForkEpoch(UInt64.ZERO))
.denebBuilder(d -> d.denebForkEpoch(UInt64.ZERO))
.electraBuilder(e -> e.electraForkEpoch(UInt64.ZERO));
case EIP7805 ->
builder ->
builder
.altairBuilder(a -> a.altairForkEpoch(UInt64.ZERO))
.bellatrixBuilder(b -> b.bellatrixForkEpoch(UInt64.ZERO))
.capellaBuilder(c -> c.capellaForkEpoch(UInt64.ZERO))
.denebBuilder(d -> d.denebForkEpoch(UInt64.ZERO))
.electraBuilder(e -> e.electraForkEpoch(UInt64.ZERO))
.eip7805Builder(e -> e.eip7805ForkEpoch(UInt64.ZERO));
};
return create(
SpecConfigLoader.loadConfig(network.configName(), defaultModifier.andThen(configModifier)),
Expand Down Expand Up @@ -391,6 +408,11 @@ private static SpecConfigAndParent<? extends SpecConfig> getElectraSpecConfig(
return getElectraSpecConfig(network, UInt64.ZERO, UInt64.ZERO, UInt64.ZERO);
}

private static SpecConfigAndParent<? extends SpecConfig> getEip7805SpecConfig(
final Eth2Network network) {
return getEip7805SpecConfig(network, UInt64.ZERO, UInt64.ZERO, UInt64.ZERO, UInt64.ZERO);
}

private static SpecConfigAndParent<? extends SpecConfig> getElectraSpecConfig(
final Eth2Network network,
final UInt64 capellaForkEpoch,
Expand All @@ -407,6 +429,24 @@ private static SpecConfigAndParent<? extends SpecConfig> getElectraSpecConfig(
.electraBuilder(e -> e.electraForkEpoch(electraForkEpoch)));
}

private static SpecConfigAndParent<? extends SpecConfig> getEip7805SpecConfig(
final Eth2Network network,
final UInt64 capellaForkEpoch,
final UInt64 denebForkEpoch,
final UInt64 electraForkEpoch,
final UInt64 eip7805ForkEpoch) {
return getElectraSpecConfig(
network,
builder ->
builder
.altairBuilder(a -> a.altairForkEpoch(UInt64.ZERO))
.bellatrixBuilder(b -> b.bellatrixForkEpoch(UInt64.ZERO))
.capellaBuilder(c -> c.capellaForkEpoch(capellaForkEpoch))
.denebBuilder(d -> d.denebForkEpoch(denebForkEpoch))
.electraBuilder(e -> e.electraForkEpoch(electraForkEpoch))
.eip7805Builder(e -> e.eip7805ForkEpoch(eip7805ForkEpoch)));
}

private static SpecConfigAndParent<? extends SpecConfig> getElectraSpecConfig(
final Eth2Network network, final Consumer<SpecConfigBuilder> configAdapter) {
return requireElectra(
Expand Down

0 comments on commit f0f3f50

Please sign in to comment.