diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/interop/GenesisStateBuilder.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/interop/GenesisStateBuilder.java index 27c32dfa87f..84de36364f7 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/interop/GenesisStateBuilder.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/interop/GenesisStateBuilder.java @@ -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); }); } } diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/TestSpecFactory.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/TestSpecFactory.java index 71134507c37..7858d3fdb9c 100644 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/TestSpecFactory.java +++ b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/TestSpecFactory.java @@ -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; @@ -116,7 +117,7 @@ public static Spec createMinimalElectra(final Consumer config } public static Spec createMinimalEip7732() { - final SpecConfigElectra specConfig = getElectraSpecConfig(Eth2Network.MINIMAL); + final SpecConfigEip7732 specConfig = getEip7732SpecConfig(Eth2Network.MINIMAL); return create(specConfig, SpecMilestone.EIP7732); } @@ -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); } @@ -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 @@ -455,6 +460,23 @@ private static SpecConfigElectra getEip7732SpecConfig( .eip7732Builder(eip7732 -> eip7732.eip7732ForkEpoch(eip7732ForkEpoch))); } + private static SpecConfigEip7732 getEip7732SpecConfig( + final Eth2Network network, final Consumer 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 =