Skip to content

Commit

Permalink
few more fixes again
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 10, 2024
1 parent 85e774e commit c40abd5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ private ExecutionPayloadHeader mockExecutionPayloadHeader() {
b.depositRequestsRoot(() -> Bytes32.ZERO);
b.withdrawalRequestsRoot(() -> Bytes32.ZERO);
b.consolidationRequestsRoot(() -> Bytes32.ZERO);
// ePBS
b.parentBlockHash(() -> Bytes32.ZERO);
b.parentBlockRoot(() -> Bytes32.ZERO);
b.builderIndex(() -> UInt64.ZERO);
b.slot(() -> UInt64.ZERO);
b.value(() -> UInt64.ZERO);
b.blobKzgCommitmentsRoot(() -> Bytes32.ZERO);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import tech.pegasys.teku.spec.config.SpecConfigBellatrix;
import tech.pegasys.teku.spec.config.SpecConfigCapella;
import tech.pegasys.teku.spec.config.SpecConfigDeneb;
import tech.pegasys.teku.spec.config.SpecConfigEip7732;
import tech.pegasys.teku.spec.config.SpecConfigElectra;
import tech.pegasys.teku.spec.config.SpecConfigLoader;
import tech.pegasys.teku.spec.config.builder.SpecConfigBuilder;
Expand Down Expand Up @@ -116,7 +117,7 @@ public static Spec createMinimalElectra(final Consumer<SpecConfigBuilder> config
}

public static Spec createMinimalEip7732() {
final SpecConfigElectra specConfig = getElectraSpecConfig(Eth2Network.MINIMAL);
final SpecConfigEip7732 specConfig = getEip7732SpecConfig(Eth2Network.MINIMAL);
return create(specConfig, SpecMilestone.EIP7732);
}

Expand Down Expand Up @@ -228,7 +229,7 @@ public static Spec createMainnetElectra() {
}

public static Spec createMainnetEip7732() {
final SpecConfigElectra specConfig = getElectraSpecConfig(Eth2Network.MAINNET);
final SpecConfigEip7732 specConfig = getEip7732SpecConfig(Eth2Network.MAINNET);
return create(specConfig, SpecMilestone.EIP7732);
}

Expand Down Expand Up @@ -437,13 +438,17 @@ private static SpecConfigElectra getElectraSpecConfig(
}));
}

private static SpecConfigElectra getEip7732SpecConfig(
private static SpecConfigEip7732 getEip7732SpecConfig(final Eth2Network network) {
return getEip7732SpecConfig(network, UInt64.ZERO, UInt64.ZERO, UInt64.ZERO, UInt64.ZERO);
}

private static SpecConfigEip7732 getEip7732SpecConfig(
final Eth2Network network,
final UInt64 capellaForkEpoch,
final UInt64 denebForkEpoch,
final UInt64 electraForkEpoch,
final UInt64 eip7732ForkEpoch) {
return getElectraSpecConfig(
return getEip7732SpecConfig(
network,
builder ->
builder
Expand All @@ -455,6 +460,23 @@ private static SpecConfigElectra getEip7732SpecConfig(
.eip7732Builder(eip7732 -> eip7732.eip7732ForkEpoch(eip7732ForkEpoch)));
}

private static SpecConfigEip7732 getEip7732SpecConfig(
final Eth2Network network, final Consumer<SpecConfigBuilder> configAdapter) {
return SpecConfigEip7732.required(
SpecConfigLoader.loadConfig(
network.configName(),
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))
.eip7732Builder(eip7732 -> eip7732.eip7732ForkEpoch(UInt64.ZERO));
configAdapter.accept(builder);
}));
}

public static Spec createMinimalWithCapellaDenebAndElectraForkEpoch(
final UInt64 capellaForkEpoch, final UInt64 denebForkEpoch, final UInt64 electraForkEpoch) {
final SpecConfigBellatrix config =
Expand Down

0 comments on commit c40abd5

Please sign in to comment.