Skip to content

Commit 023fa8a

Browse files
Created Fulu skeleton (#9325)
1 parent 6510fb3 commit 023fa8a

File tree

65 files changed

+2774
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2774
-188
lines changed

acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/MergedGenesisInteropModeAcceptanceTest.java

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,22 @@ private static TekuNodeConfigBuilder createTekuNodeBuilderForMilestone(
7575
.withInteropNumberOfValidators(64)
7676
.withValidatorProposerDefaultFeeRecipient("0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73");
7777

78-
switch (specMilestone) {
79-
// We do not need to consider PHASE0, ALTAIR or BELLATRIX as they are all pre-Merge
80-
// milestones
81-
case CAPELLA:
82-
tekuNodeConfigBuilder.withCapellaEpoch(UInt64.ZERO);
83-
break;
84-
case DENEB:
85-
tekuNodeConfigBuilder.withCapellaEpoch(UInt64.ZERO);
86-
tekuNodeConfigBuilder.withDenebEpoch(UInt64.ZERO);
87-
break;
88-
case ELECTRA:
89-
tekuNodeConfigBuilder.withCapellaEpoch(UInt64.ZERO);
90-
tekuNodeConfigBuilder.withDenebEpoch(UInt64.ZERO);
91-
tekuNodeConfigBuilder.withElectraEpoch(UInt64.ZERO);
92-
break;
93-
default:
94-
// Test will reach this whenever a new milestone is added and isn't mapped on the switch.
95-
// This is a way to force us to always remember to validate that a new milestone can start
96-
// from a merged
97-
// state.
98-
fail("Milestone %s not used on merged genesis interop test", specMilestone);
78+
if (specMilestone.isGreaterThanOrEqualTo(SpecMilestone.CAPELLA)) {
79+
tekuNodeConfigBuilder.withCapellaEpoch(UInt64.ZERO);
80+
}
81+
if (specMilestone.isGreaterThanOrEqualTo(SpecMilestone.DENEB)) {
82+
tekuNodeConfigBuilder.withDenebEpoch(UInt64.ZERO);
83+
}
84+
if (specMilestone.isGreaterThanOrEqualTo(SpecMilestone.ELECTRA)) {
85+
tekuNodeConfigBuilder.withElectraEpoch(UInt64.ZERO);
9986
}
87+
if (specMilestone.isGreaterThanOrEqualTo(SpecMilestone.FULU)) {
88+
tekuNodeConfigBuilder.withFuluEpoch(UInt64.ZERO);
89+
}
90+
if (specMilestone.isGreaterThan(SpecMilestone.FULU)) {
91+
fail("Milestone %s not used on merged genesis interop test", specMilestone);
92+
}
93+
10094
return tekuNodeConfigBuilder;
10195
}
10296
}

acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuNodeConfigBuilder.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,18 @@ public TekuNodeConfigBuilder withElectraEpoch(final UInt64 electraForkEpoch) {
173173
return this;
174174
}
175175

176+
public TekuNodeConfigBuilder withFuluEpoch(final UInt64 fuluForkEpoch) {
177+
mustBe(NodeType.BEACON_NODE);
178+
LOG.debug("Xnetwork-fulu-fork-epoch={}", fuluForkEpoch);
179+
configMap.put("Xnetwork-fulu-fork-epoch", fuluForkEpoch.toString());
180+
specConfigModifier =
181+
specConfigModifier.andThen(
182+
specConfigBuilder ->
183+
specConfigBuilder.fuluBuilder(
184+
fuluBuilder -> fuluBuilder.fuluForkEpoch(fuluForkEpoch)));
185+
return this;
186+
}
187+
176188
public TekuNodeConfigBuilder withTrustedSetupFromClasspath(final String trustedSetup)
177189
throws Exception {
178190
mustBe(NodeType.BEACON_NODE);

data/beaconrestapi/src/integration-test/java/tech/pegasys/teku/beaconrestapi/v3/GetNewBlockV3IntegrationTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import static tech.pegasys.teku.infrastructure.unsigned.UInt64.ONE;
2929
import static tech.pegasys.teku.spec.SpecMilestone.BELLATRIX;
3030
import static tech.pegasys.teku.spec.SpecMilestone.DENEB;
31+
import static tech.pegasys.teku.spec.SpecMilestone.FULU;
3132

3233
import com.fasterxml.jackson.databind.JsonNode;
3334
import com.google.common.io.Resources;
@@ -55,7 +56,9 @@
5556
import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData;
5657
import tech.pegasys.teku.spec.util.DataStructureUtil;
5758

58-
@TestSpecContext(allMilestones = true)
59+
@TestSpecContext(
60+
allMilestones = true,
61+
ignoredMilestones = FULU) // TODO-fulu eventually we remove this ignore
5962
public class GetNewBlockV3IntegrationTest extends AbstractDataBackedRestAPIIntegrationTest {
6063

6164
private DataStructureUtil dataStructureUtil;

data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v1/config/mainnetConfig.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,20 @@
144144
"DOMAIN_AGGREGATE_AND_PROOF" : "0x06000000",
145145
"CHURN_LIMIT_QUOTIENT" : "65536",
146146
"BLS_WITHDRAWAL_PREFIX" : "0x00",
147-
"MIN_ACTIVATION_BALANCE" : "32000000000"
147+
"MIN_ACTIVATION_BALANCE" : "32000000000",
148+
"FIELD_ELEMENTS_PER_EXT_BLOB":"8192",
149+
"FIELD_ELEMENTS_PER_CELL":"64",
150+
"KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH":"4",
151+
"MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS":"4096",
152+
"MAX_BLOBS_PER_BLOCK_FULU":"12",
153+
"FULU_FORK_EPOCH":"18446744073709551615",
154+
"FULU_FORK_VERSION":"0x06000000",
155+
"NUMBER_OF_COLUMNS":"128",
156+
"NUMBER_OF_CUSTODY_GROUPS":"128",
157+
"DATA_COLUMN_SIDECAR_SUBNET_COUNT":"128",
158+
"MAX_REQUEST_DATA_COLUMN_SIDECARS":"16384",
159+
"SAMPLES_PER_SLOT":"8",
160+
"CUSTODY_REQUIREMENT":"4",
161+
"VALIDATOR_CUSTODY_REQUIREMENT":"8",
162+
"BALANCE_PER_ADDITIONAL_CUSTODY_GROUP":"32000000000"
148163
}

data/provider/src/main/java/tech/pegasys/teku/api/SchemaObjectProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public BeaconBlock getBlindedBlock(
9898
block.getParentRoot(),
9999
block.getStateRoot(),
100100
getBlindedBlockBodyDeneb(block.getBody()));
101-
case ELECTRA ->
101+
case ELECTRA, FULU ->
102102
new BlindedBlockElectra(
103103
block.getSlot(),
104104
block.getProposerIndex(),
@@ -147,7 +147,7 @@ public BeaconBlock getBeaconBlock(
147147
block.getParentRoot(),
148148
block.getStateRoot(),
149149
getBeaconBlockBodyDeneb(block.getBody()));
150-
case ELECTRA ->
150+
case ELECTRA, FULU ->
151151
new BeaconBlockElectra(
152152
block.getSlot(),
153153
block.getProposerIndex(),

data/serializer/src/main/java/tech/pegasys/teku/api/schema/Version.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public enum Version {
2222
bellatrix,
2323
capella,
2424
deneb,
25-
electra;
25+
electra,
26+
fulu;
2627

2728
public static Version fromMilestone(final SpecMilestone milestone) {
2829
return switch (milestone) {
@@ -32,6 +33,7 @@ public static Version fromMilestone(final SpecMilestone milestone) {
3233
case CAPELLA -> capella;
3334
case DENEB -> deneb;
3435
case ELECTRA -> electra;
36+
case FULU -> fulu;
3537
};
3638
}
3739
}

data/serializer/src/test/java/tech/pegasys/teku/api/schema/BeaconStateTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void shouldConvertToInternalObject(final SpecContext ctx) {
4141
case BELLATRIX -> new BeaconStateBellatrix(beaconStateInternal);
4242
case CAPELLA -> new BeaconStateCapella(beaconStateInternal);
4343
case DENEB -> new BeaconStateDeneb(beaconStateInternal);
44-
case ELECTRA -> new BeaconStateElectra(beaconStateInternal);
44+
case ELECTRA, FULU -> new BeaconStateElectra(beaconStateInternal);
4545
};
4646

4747
assertThat(beaconState.asInternalBeaconState(spec)).isEqualTo(beaconStateInternal);

ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/MilestoneBasedEngineJsonRpcMethodsResolver.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public MilestoneBasedEngineJsonRpcMethodsResolver(
7676
case ELECTRA:
7777
methodsByMilestone.put(milestone, electraSupportedMethods());
7878
break;
79+
case FULU:
80+
methodsByMilestone.put(milestone, fuluSupportedMethods());
81+
break;
7982
}
8083
});
8184
}
@@ -120,6 +123,16 @@ private Map<EngineApiMethod, EngineJsonRpcMethod<?>> electraSupportedMethods() {
120123
return methods;
121124
}
122125

126+
private Map<EngineApiMethod, EngineJsonRpcMethod<?>> fuluSupportedMethods() {
127+
final Map<EngineApiMethod, EngineJsonRpcMethod<?>> methods = new HashMap<>();
128+
129+
methods.put(ENGINE_NEW_PAYLOAD, new EngineNewPayloadV4(executionEngineClient));
130+
methods.put(ENGINE_GET_PAYLOAD, new EngineGetPayloadV4(executionEngineClient, spec));
131+
methods.put(ENGINE_FORK_CHOICE_UPDATED, new EngineForkChoiceUpdatedV3(executionEngineClient));
132+
133+
return methods;
134+
}
135+
123136
@Override
124137
@SuppressWarnings({"unchecked", "unused"})
125138
public <T> EngineJsonRpcMethod<T> getMethod(

ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/MilestoneBasedEngineJsonRpcMethodsResolverTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,28 @@ private static Stream<Arguments> electraMethods() {
200200
arguments(ENGINE_FORK_CHOICE_UPDATED, EngineForkChoiceUpdatedV3.class));
201201
}
202202

203+
@ParameterizedTest
204+
@MethodSource("fuluMethods")
205+
void shouldProvideExpectedMethodsForFulu(
206+
final EngineApiMethod method, final Class<EngineJsonRpcMethod<?>> expectedMethodClass) {
207+
final Spec electraSpec = TestSpecFactory.createMinimalFulu();
208+
209+
final MilestoneBasedEngineJsonRpcMethodsResolver engineMethodsResolver =
210+
new MilestoneBasedEngineJsonRpcMethodsResolver(electraSpec, executionEngineClient);
211+
212+
final EngineJsonRpcMethod<Object> providedMethod =
213+
engineMethodsResolver.getMethod(method, () -> SpecMilestone.FULU, Object.class);
214+
215+
assertThat(providedMethod).isExactlyInstanceOf(expectedMethodClass);
216+
}
217+
218+
private static Stream<Arguments> fuluMethods() {
219+
return Stream.of(
220+
arguments(ENGINE_NEW_PAYLOAD, EngineNewPayloadV4.class),
221+
arguments(ENGINE_GET_PAYLOAD, EngineGetPayloadV4.class),
222+
arguments(ENGINE_FORK_CHOICE_UPDATED, EngineForkChoiceUpdatedV3.class));
223+
}
224+
203225
@Test
204226
void getsCapabilities() {
205227
final Spec spec =

ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/EthereumTypes.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ public class EthereumTypes {
9595

9696
public static final StringValueTypeDefinition<SpecMilestone> MILESTONE_TYPE =
9797
new EnumTypeDefinition<>(
98-
SpecMilestone.class, milestone -> milestone.name().toLowerCase(Locale.ROOT), Set.of());
98+
SpecMilestone.class,
99+
milestone -> milestone.name().toLowerCase(Locale.ROOT),
100+
Set.of(SpecMilestone.FULU)); // TODO-fulu eventually we remove this ignore
99101

100102
public static final EnumHeaderTypeDefinition<SpecMilestone> ETH_CONSENSUS_HEADER_TYPE =
101103
new EnumHeaderTypeDefinition.EnumTypeHeaderDefinitionBuilder<>(
@@ -105,6 +107,8 @@ public class EthereumTypes {
105107
.description(
106108
"Required in response so client can deserialize returned json or ssz data more effectively.")
107109
.example("phase0")
110+
.excludedEnumerations(
111+
Set.of(SpecMilestone.FULU)) // TODO-fulu eventually we remove this ignore
108112
.build();
109113

110114
public static final BooleanHeaderTypeDefinition ETH_HEADER_EXECUTION_PAYLOAD_BLINDED_TYPE =

0 commit comments

Comments
 (0)