Skip to content

Commit 0c11dbb

Browse files
Add more Gloas containers (#9873)
1 parent 808909e commit 0c11dbb

File tree

22 files changed

+823
-59
lines changed

22 files changed

+823
-59
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
### Additions and Improvements
1313

1414
### Bug Fixes
15-
- Updated ephemery network configuration to load the configuration and bootnodes from remote. If the name "ephemery" is used for network now, it will by default load from ephemery.dev.
15+
- `ephemery` network now defaults to loading configuration and bootnodes directly from https://ephemery.dev.
16+

eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/ssz_static/SszTestExecutor.java

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,6 @@ public class SszTestExecutor<T extends SszData> implements TestExecutor {
256256
new SszTestExecutor<>(
257257
schemas ->
258258
SchemaDefinitionsGloas.required(schemas).getBuilderPendingWithdrawalSchema()))
259-
.put("ssz_static/PayloadAttestationMessage", IGNORE_TESTS)
260-
.put("ssz_static/IndexedPayloadAttestation", IGNORE_TESTS)
261-
.put("ssz_static/ExecutionPayloadEnvelope", IGNORE_TESTS)
262-
.put("ssz_static/SignedExecutionPayloadEnvelope", IGNORE_TESTS)
263-
.put("ssz_static/ForkChoiceNode", IGNORE_TESTS)
264259
.put(
265260
"ssz_static/PayloadAttestationData",
266261
new SszTestExecutor<>(
@@ -271,12 +266,36 @@ public class SszTestExecutor<T extends SszData> implements TestExecutor {
271266
new SszTestExecutor<>(
272267
schemas ->
273268
SchemaDefinitionsGloas.required(schemas).getPayloadAttestationSchema()))
269+
.put(
270+
"ssz_static/PayloadAttestationMessage",
271+
new SszTestExecutor<>(
272+
schemas ->
273+
SchemaDefinitionsGloas.required(schemas)
274+
.getPayloadAttestationMessageSchema()))
275+
.put(
276+
"ssz_static/IndexedPayloadAttestation",
277+
new SszTestExecutor<>(
278+
schemas ->
279+
SchemaDefinitionsGloas.required(schemas)
280+
.getIndexedPayloadAttestationSchema()))
274281
.put(
275282
"ssz_static/SignedExecutionPayloadHeader",
276283
new SszTestExecutor<>(
277284
schemas ->
278285
SchemaDefinitionsGloas.required(schemas)
279286
.getSignedExecutionPayloadHeaderSchema()))
287+
.put(
288+
"ssz_static/ExecutionPayloadEnvelope",
289+
new SszTestExecutor<>(
290+
schemas ->
291+
SchemaDefinitionsGloas.required(schemas).getExecutionPayloadEnvelopeSchema()))
292+
.put(
293+
"ssz_static/SignedExecutionPayloadEnvelope",
294+
new SszTestExecutor<>(
295+
schemas ->
296+
SchemaDefinitionsGloas.required(schemas)
297+
.getSignedExecutionPayloadEnvelopeSchema()))
298+
.put("ssz_static/ForkChoiceNode", IGNORE_TESTS)
280299

281300
// Legacy Schemas (Not yet migrated to SchemaDefinitions)
282301
.put(

ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/gloas/BeaconBlockBodyBuilderGloas.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody;
2121
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder;
2222
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema;
23-
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BeaconBlockBodyElectra;
24-
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BlindedBeaconBlockBodyElectra;
2523
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.fulu.BeaconBlockBodyBuilderFulu;
2624
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.PayloadAttestation;
2725
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadHeader;
@@ -33,8 +31,8 @@ public class BeaconBlockBodyBuilderGloas extends BeaconBlockBodyBuilderFulu {
3331
private SszList<PayloadAttestation> payloadAttestations;
3432

3533
public BeaconBlockBodyBuilderGloas(
36-
final BeaconBlockBodySchema<? extends BeaconBlockBodyElectra> schema,
37-
final BeaconBlockBodySchema<? extends BlindedBeaconBlockBodyElectra> blindedSchema) {
34+
final BeaconBlockBodySchema<? extends BeaconBlockBodyGloas> schema,
35+
final BeaconBlockBodySchema<? extends BlindedBeaconBlockBodyGloas> blindedSchema) {
3836
super(schema, blindedSchema);
3937
}
4038

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
* Copyright Consensys Software Inc., 2025
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package tech.pegasys.teku.spec.datastructures.epbs.versions.gloas;
15+
16+
import org.apache.tuweni.bytes.Bytes32;
17+
import tech.pegasys.teku.infrastructure.ssz.SszList;
18+
import tech.pegasys.teku.infrastructure.ssz.containers.Container7;
19+
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
20+
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
21+
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
22+
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
23+
import tech.pegasys.teku.spec.datastructures.blocks.SlotAndBlockRoot;
24+
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload;
25+
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests;
26+
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;
27+
28+
public class ExecutionPayloadEnvelope
29+
extends Container7<
30+
ExecutionPayloadEnvelope,
31+
ExecutionPayload,
32+
ExecutionRequests,
33+
SszUInt64,
34+
SszBytes32,
35+
SszUInt64,
36+
SszList<SszKZGCommitment>,
37+
SszBytes32> {
38+
39+
ExecutionPayloadEnvelope(
40+
final ExecutionPayloadEnvelopeSchema schema,
41+
final ExecutionPayload payload,
42+
final ExecutionRequests executionRequests,
43+
final UInt64 builderIndex,
44+
final Bytes32 beaconBlockRoot,
45+
final UInt64 slot,
46+
final SszList<SszKZGCommitment> blobKzgCommitments,
47+
final Bytes32 stateRoot) {
48+
super(
49+
schema,
50+
payload,
51+
executionRequests,
52+
SszUInt64.of(builderIndex),
53+
SszBytes32.of(beaconBlockRoot),
54+
SszUInt64.of(slot),
55+
blobKzgCommitments,
56+
SszBytes32.of(stateRoot));
57+
}
58+
59+
ExecutionPayloadEnvelope(final ExecutionPayloadEnvelopeSchema type, final TreeNode backingNode) {
60+
super(type, backingNode);
61+
}
62+
63+
public ExecutionPayload getPayload() {
64+
return getField0();
65+
}
66+
67+
public ExecutionRequests getExecutionRequests() {
68+
return getField1();
69+
}
70+
71+
public UInt64 getBuilderIndex() {
72+
return getField2().get();
73+
}
74+
75+
public Bytes32 getBeaconBlockRoot() {
76+
return getField3().get();
77+
}
78+
79+
public UInt64 getSlot() {
80+
return getField4().get();
81+
}
82+
83+
public SszList<SszKZGCommitment> getBlobKzgCommitments() {
84+
return getField5();
85+
}
86+
87+
public Bytes32 getStateRoot() {
88+
return getField6().get();
89+
}
90+
91+
public SlotAndBlockRoot getSlotAndBlockRoot() {
92+
return new SlotAndBlockRoot(getSlot(), getBeaconBlockRoot());
93+
}
94+
95+
@Override
96+
public ExecutionPayloadEnvelopeSchema getSchema() {
97+
return (ExecutionPayloadEnvelopeSchema) super.getSchema();
98+
}
99+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Copyright Consensys Software Inc., 2025
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package tech.pegasys.teku.spec.datastructures.epbs.versions.gloas;
15+
16+
import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_KZG_COMMITMENTS_SCHEMA;
17+
import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_SCHEMA;
18+
import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_REQUESTS_SCHEMA;
19+
20+
import org.apache.tuweni.bytes.Bytes32;
21+
import tech.pegasys.teku.infrastructure.ssz.SszList;
22+
import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema7;
23+
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
24+
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
25+
import tech.pegasys.teku.infrastructure.ssz.schema.SszPrimitiveSchemas;
26+
import tech.pegasys.teku.infrastructure.ssz.schema.SszSchema;
27+
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
28+
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
29+
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload;
30+
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests;
31+
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;
32+
import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry;
33+
34+
public class ExecutionPayloadEnvelopeSchema
35+
extends ContainerSchema7<
36+
ExecutionPayloadEnvelope,
37+
ExecutionPayload,
38+
ExecutionRequests,
39+
SszUInt64,
40+
SszBytes32,
41+
SszUInt64,
42+
SszList<SszKZGCommitment>,
43+
SszBytes32> {
44+
45+
public ExecutionPayloadEnvelopeSchema(final SchemaRegistry schemaRegistry) {
46+
super(
47+
"ExecutionPayloadEnvelope",
48+
namedSchema(
49+
"payload",
50+
SszSchema.as(ExecutionPayload.class, schemaRegistry.get(EXECUTION_PAYLOAD_SCHEMA))),
51+
namedSchema("execution_requests", schemaRegistry.get(EXECUTION_REQUESTS_SCHEMA)),
52+
namedSchema("builder_index", SszPrimitiveSchemas.UINT64_SCHEMA),
53+
namedSchema("beacon_block_root", SszPrimitiveSchemas.BYTES32_SCHEMA),
54+
namedSchema("slot", SszPrimitiveSchemas.UINT64_SCHEMA),
55+
namedSchema("blob_kzg_commitments", schemaRegistry.get(BLOB_KZG_COMMITMENTS_SCHEMA)),
56+
namedSchema("state_root", SszPrimitiveSchemas.BYTES32_SCHEMA));
57+
}
58+
59+
public ExecutionPayloadEnvelope create(
60+
final ExecutionPayload payload,
61+
final ExecutionRequests executionRequests,
62+
final UInt64 builderIndex,
63+
final Bytes32 beaconBlockRoot,
64+
final UInt64 slot,
65+
final SszList<SszKZGCommitment> blobKzgCommitments,
66+
final Bytes32 stateRoot) {
67+
return new ExecutionPayloadEnvelope(
68+
this,
69+
payload,
70+
executionRequests,
71+
builderIndex,
72+
beaconBlockRoot,
73+
slot,
74+
blobKzgCommitments,
75+
stateRoot);
76+
}
77+
78+
@Override
79+
public ExecutionPayloadEnvelope createFromBackingNode(final TreeNode node) {
80+
return new ExecutionPayloadEnvelope(this, node);
81+
}
82+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright Consensys Software Inc., 2025
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package tech.pegasys.teku.spec.datastructures.epbs.versions.gloas;
15+
16+
import tech.pegasys.teku.bls.BLSSignature;
17+
import tech.pegasys.teku.infrastructure.ssz.collections.SszUInt64List;
18+
import tech.pegasys.teku.infrastructure.ssz.containers.Container3;
19+
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
20+
import tech.pegasys.teku.spec.datastructures.type.SszSignature;
21+
22+
public class IndexedPayloadAttestation
23+
extends Container3<
24+
IndexedPayloadAttestation, SszUInt64List, PayloadAttestationData, SszSignature> {
25+
26+
IndexedPayloadAttestation(
27+
final IndexedPayloadAttestationSchema schema,
28+
final SszUInt64List attestingIndices,
29+
final PayloadAttestationData data,
30+
final BLSSignature signature) {
31+
super(schema, attestingIndices, data, new SszSignature(signature));
32+
}
33+
34+
IndexedPayloadAttestation(
35+
final IndexedPayloadAttestationSchema type, final TreeNode backingNode) {
36+
super(type, backingNode);
37+
}
38+
39+
public SszUInt64List getAttestingIndices() {
40+
return getField0();
41+
}
42+
43+
public PayloadAttestationData getData() {
44+
return getField1();
45+
}
46+
47+
public BLSSignature getSignature() {
48+
return getField2().getSignature();
49+
}
50+
51+
@Override
52+
public IndexedPayloadAttestationSchema getSchema() {
53+
return (IndexedPayloadAttestationSchema) super.getSchema();
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright Consensys Software Inc., 2025
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package tech.pegasys.teku.spec.datastructures.epbs.versions.gloas;
15+
16+
import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.PAYLOAD_ATTESTATION_DATA_SCHEMA;
17+
18+
import tech.pegasys.teku.bls.BLSSignature;
19+
import tech.pegasys.teku.infrastructure.ssz.collections.SszUInt64List;
20+
import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema3;
21+
import tech.pegasys.teku.infrastructure.ssz.schema.SszFieldName;
22+
import tech.pegasys.teku.infrastructure.ssz.schema.collections.SszUInt64ListSchema;
23+
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
24+
import tech.pegasys.teku.spec.datastructures.type.SszSignature;
25+
import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema;
26+
import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry;
27+
28+
public class IndexedPayloadAttestationSchema
29+
extends ContainerSchema3<
30+
IndexedPayloadAttestation, SszUInt64List, PayloadAttestationData, SszSignature> {
31+
32+
private static final SszFieldName ATTESTING_INDICES = () -> "attesting_indices";
33+
34+
public IndexedPayloadAttestationSchema(final long ptcSize, final SchemaRegistry schemaRegistry) {
35+
super(
36+
"IndexedPayloadAttestation",
37+
namedSchema(ATTESTING_INDICES, SszUInt64ListSchema.create(ptcSize)),
38+
namedSchema("data", schemaRegistry.get(PAYLOAD_ATTESTATION_DATA_SCHEMA)),
39+
namedSchema("signature", SszSignatureSchema.INSTANCE));
40+
}
41+
42+
public IndexedPayloadAttestation create(
43+
final SszUInt64List attestingIndices,
44+
final PayloadAttestationData data,
45+
final BLSSignature signature) {
46+
return new IndexedPayloadAttestation(this, attestingIndices, data, signature);
47+
}
48+
49+
@Override
50+
public IndexedPayloadAttestation createFromBackingNode(final TreeNode node) {
51+
return new IndexedPayloadAttestation(this, node);
52+
}
53+
54+
public SszUInt64ListSchema<?> getAttestingIndicesSchema() {
55+
return (SszUInt64ListSchema<?>) getChildSchema(getFieldIndex(ATTESTING_INDICES));
56+
}
57+
}

0 commit comments

Comments
 (0)