diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_blinded_blocks.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_blinded_blocks.json index d57306bae2a..56df6225beb 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_blinded_blocks.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_blinded_blocks.json @@ -31,13 +31,13 @@ }, { "$ref" : "#/components/schemas/SignedBeaconBlockAltair" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockBellatrix" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockBellatrix" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockCapella" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockCapella" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockDeneb" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockDeneb" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockElectra" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockElectra" } ] } } diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_blinded_blocks.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_blinded_blocks.json index e67b63bc5d2..1cb1edbd7d8 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_blinded_blocks.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_blinded_blocks.json @@ -41,13 +41,13 @@ }, { "$ref" : "#/components/schemas/SignedBeaconBlockAltair" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockBellatrix" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockBellatrix" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockCapella" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockCapella" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockDeneb" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockDeneb" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockElectra" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockElectra" } ] } } diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockCapella.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBellatrix.json similarity index 88% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockCapella.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBellatrix.json index 7f22389b7b8..44488aad10e 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockCapella.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBellatrix.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockCapella", + "title" : "BlindedBeaconBlockBellatrix", "type" : "object", "required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ], "properties" : { @@ -28,7 +28,7 @@ "format" : "byte" }, "body" : { - "$ref" : "#/components/schemas/BlindedBlockBodyCapella" + "$ref" : "#/components/schemas/BlindedBeaconBlockBodyBellatrix" } } } \ No newline at end of file diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyBellatrix.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyBellatrix.json similarity index 97% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyBellatrix.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyBellatrix.json index 46ef6b9a1eb..827dfd1f802 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyBellatrix.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyBellatrix.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockBodyBellatrix", + "title" : "BlindedBeaconBlockBodyBellatrix", "type" : "object", "required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload_header" ], "properties" : { diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyCapella.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyCapella.json similarity index 97% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyCapella.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyCapella.json index 7cf76cacd12..99f839ff19d 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyCapella.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyCapella.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockBodyCapella", + "title" : "BlindedBeaconBlockBodyCapella", "type" : "object", "required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload_header", "bls_to_execution_changes" ], "properties" : { diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyDeneb.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyDeneb.json similarity index 97% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyDeneb.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyDeneb.json index 9d26b2651a4..22165d4a0ed 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyDeneb.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyDeneb.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockBodyDeneb", + "title" : "BlindedBeaconBlockBodyDeneb", "type" : "object", "required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload_header", "bls_to_execution_changes", "blob_kzg_commitments" ], "properties" : { diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyElectra.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyElectra.json similarity index 97% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyElectra.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyElectra.json index f04f55d2a0c..3e63070a660 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBodyElectra.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockBodyElectra.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockBodyElectra", + "title" : "BlindedBeaconBlockBodyElectra", "type" : "object", "required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload_header", "bls_to_execution_changes", "blob_kzg_commitments", "execution_requests" ], "properties" : { diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockElectra.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockCapella.json similarity index 88% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockElectra.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockCapella.json index e9f8fc4a9d7..b254a00efb4 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockElectra.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockCapella.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockElectra", + "title" : "BlindedBeaconBlockCapella", "type" : "object", "required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ], "properties" : { @@ -28,7 +28,7 @@ "format" : "byte" }, "body" : { - "$ref" : "#/components/schemas/BlindedBlockBodyElectra" + "$ref" : "#/components/schemas/BlindedBeaconBlockBodyCapella" } } } \ No newline at end of file diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBellatrix.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockDeneb.json similarity index 89% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBellatrix.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockDeneb.json index 532eeac0a87..d201f7cf56b 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockBellatrix.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockDeneb.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockBellatrix", + "title" : "BlindedBeaconBlockDeneb", "type" : "object", "required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ], "properties" : { @@ -28,7 +28,7 @@ "format" : "byte" }, "body" : { - "$ref" : "#/components/schemas/BlindedBlockBodyBellatrix" + "$ref" : "#/components/schemas/BlindedBeaconBlockBodyDeneb" } } } \ No newline at end of file diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockDeneb.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockElectra.json similarity index 88% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockDeneb.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockElectra.json index dfa1babf2a7..f3e4a22f90b 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBlockDeneb.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/BlindedBeaconBlockElectra.json @@ -1,5 +1,5 @@ { - "title" : "BlindedBlockDeneb", + "title" : "BlindedBeaconBlockElectra", "type" : "object", "required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ], "properties" : { @@ -28,7 +28,7 @@ "format" : "byte" }, "body" : { - "$ref" : "#/components/schemas/BlindedBlockBodyDeneb" + "$ref" : "#/components/schemas/BlindedBeaconBlockBodyElectra" } } } \ No newline at end of file diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/GetBlindedBlockResponse.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/GetBlindedBlockResponse.json index b6bba539a51..36777047ed8 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/GetBlindedBlockResponse.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/GetBlindedBlockResponse.json @@ -21,13 +21,13 @@ }, { "$ref" : "#/components/schemas/SignedBeaconBlockAltair" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockBellatrix" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockBellatrix" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockCapella" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockCapella" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockDeneb" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockDeneb" }, { - "$ref" : "#/components/schemas/SignedBlindedBlockElectra" + "$ref" : "#/components/schemas/SignedBlindedBeaconBlockElectra" } ] } } diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/ProduceBlockV3Response.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/ProduceBlockV3Response.json index 3abeb040a5b..eede3e02bbf 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/ProduceBlockV3Response.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/ProduceBlockV3Response.json @@ -32,20 +32,20 @@ }, { "$ref" : "#/components/schemas/BeaconBlockBellatrix" }, { - "$ref" : "#/components/schemas/BlindedBlockBellatrix" + "$ref" : "#/components/schemas/BlindedBeaconBlockBellatrix" }, { "$ref" : "#/components/schemas/BeaconBlockCapella" }, { - "$ref" : "#/components/schemas/BlindedBlockCapella" + "$ref" : "#/components/schemas/BlindedBeaconBlockCapella" }, { "$ref" : "#/components/schemas/BlockContentsDeneb" }, { - "$ref" : "#/components/schemas/BlindedBlockDeneb" + "$ref" : "#/components/schemas/BlindedBeaconBlockDeneb" }, { "$ref" : "#/components/schemas/BlockContentsElectra" }, { - "$ref" : "#/components/schemas/BlindedBlockElectra" - } ] + "$ref" : "#/components/schemas/BlindedBeaconBlockElectra" + } ] } } } \ No newline at end of file diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockElectra.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockBellatrix.json similarity index 70% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockElectra.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockBellatrix.json index 89ca16c5a4e..183df221bc2 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockElectra.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockBellatrix.json @@ -1,10 +1,10 @@ { - "title" : "SignedBlindedBlockElectra", + "title" : "SignedBlindedBeaconBlockBellatrix", "type" : "object", "required" : [ "message", "signature" ], "properties" : { "message" : { - "$ref" : "#/components/schemas/BlindedBlockElectra" + "$ref" : "#/components/schemas/BlindedBeaconBlockBellatrix" }, "signature" : { "type" : "string", diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockCapella.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockCapella.json similarity index 71% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockCapella.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockCapella.json index ae08a6b409f..c84a847408a 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockCapella.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockCapella.json @@ -1,10 +1,10 @@ { - "title" : "SignedBlindedBlockCapella", + "title" : "SignedBlindedBeaconBlockCapella", "type" : "object", "required" : [ "message", "signature" ], "properties" : { "message" : { - "$ref" : "#/components/schemas/BlindedBlockCapella" + "$ref" : "#/components/schemas/BlindedBeaconBlockCapella" }, "signature" : { "type" : "string", diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockBellatrix.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockDeneb.json similarity index 71% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockBellatrix.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockDeneb.json index ede21a3fed2..99f7ca57520 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockBellatrix.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockDeneb.json @@ -1,10 +1,10 @@ { - "title" : "SignedBlindedBlockBellatrix", + "title" : "SignedBlindedBeaconBlockDeneb", "type" : "object", "required" : [ "message", "signature" ], "properties" : { "message" : { - "$ref" : "#/components/schemas/BlindedBlockBellatrix" + "$ref" : "#/components/schemas/BlindedBeaconBlockDeneb" }, "signature" : { "type" : "string", diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockDeneb.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockElectra.json similarity index 71% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockDeneb.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockElectra.json index ddc21f20966..47bf0ef75ab 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBlockDeneb.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/SignedBlindedBeaconBlockElectra.json @@ -1,10 +1,10 @@ { - "title" : "SignedBlindedBlockDeneb", + "title" : "SignedBlindedBeaconBlockElectra", "type" : "object", "required" : [ "message", "signature" ], "properties" : { "message" : { - "$ref" : "#/components/schemas/BlindedBlockDeneb" + "$ref" : "#/components/schemas/BlindedBeaconBlockElectra" }, "signature" : { "type" : "string", diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/schema/OneOfTest.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/schema/OneOfTest.java index d9a6734f8c2..efa1d5ae1b6 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/schema/OneOfTest.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/schema/OneOfTest.java @@ -137,6 +137,6 @@ void shouldCreateOneOfBlindedBlockDefinition() throws Exception { .containsOnly( "#/components/schemas/BeaconBlockPhase0", "#/components/schemas/BeaconBlockAltair", - "#/components/schemas/BlindedBlockBellatrix"); + "#/components/schemas/BlindedBeaconBlockBellatrix"); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodySchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodySchema.java index 633678af8b7..00602d42578 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodySchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodySchema.java @@ -22,9 +22,13 @@ import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.BeaconBlockBodySchemaAltair; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BeaconBlockBodySchemaBellatrix; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BlindedBeaconBlockBodySchemaBellatrix; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella.BeaconBlockBodySchemaCapella; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella.BlindedBeaconBlockBodySchemaCapella; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BeaconBlockBodySchemaDeneb; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BlindedBeaconBlockBodySchemaDeneb; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BeaconBlockBodySchemaElectra; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BlindedBeaconBlockBodySchemaElectra; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.datastructures.operations.Deposit; @@ -70,6 +74,22 @@ default Optional> toVersionElectra() { return Optional.empty(); } + default Optional> toBlindedVersionBellatrix() { + return Optional.empty(); + } + + default Optional> toBlindedVersionCapella() { + return Optional.empty(); + } + + default Optional> toBlindedVersionDeneb() { + return Optional.empty(); + } + + default Optional> toBlindedVersionElectra() { + return Optional.empty(); + } + /** * getBlindedNodeGeneralizedIndices * diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java index 2823300e8f9..63248b9cece 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java @@ -13,6 +13,7 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTATION_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTER_SLASHING_SCHEMA; import it.unimi.dsi.fastutil.longs.LongList; @@ -34,7 +35,6 @@ import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; @@ -79,7 +79,6 @@ private BeaconBlockBodySchemaAltairImpl( public static BeaconBlockBodySchemaAltairImpl create( final SpecConfig specConfig, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BeaconBlockBodySchemaAltairImpl( @@ -99,9 +98,7 @@ public static BeaconBlockBodySchemaAltairImpl create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), - specConfig.getMaxAttestations())), + schemaRegistry.get(ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, SszListSchema.create(Deposit.SSZ_SCHEMA, specConfig.getMaxDeposits())), diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java index a93f08ce1ac..cbc80a75857 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java @@ -13,6 +13,8 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_SCHEMA; + import it.unimi.dsi.fastutil.longs.LongList; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; @@ -32,13 +34,11 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregateSchema; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; import tech.pegasys.teku.spec.datastructures.execution.versions.bellatrix.ExecutionPayloadBellatrix; -import tech.pegasys.teku.spec.datastructures.execution.versions.bellatrix.ExecutionPayloadSchemaBellatrix; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; @@ -87,11 +87,8 @@ private BeaconBlockBodySchemaBellatrixImpl( public static BeaconBlockBodySchemaBellatrixImpl create( final SpecConfigBellatrix specConfig, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { - final ExecutionPayloadSchemaBellatrix executionPayloadSchemaBellatrix = - new ExecutionPayloadSchemaBellatrix(specConfig); return new BeaconBlockBodySchemaBellatrixImpl( containerName, namedSchema(BlockBodyFields.RANDAO_REVEAL, SszSignatureSchema.INSTANCE), @@ -109,8 +106,7 @@ public static BeaconBlockBodySchemaBellatrixImpl create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), + schemaRegistry.get(SchemaTypes.ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, @@ -122,7 +118,9 @@ public static BeaconBlockBodySchemaBellatrixImpl create( namedSchema( BlockBodyFields.SYNC_AGGREGATE, SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), - namedSchema(BlockBodyFields.EXECUTION_PAYLOAD, executionPayloadSchemaBellatrix)); + namedSchema( + BlockBodyFields.EXECUTION_PAYLOAD, + schemaRegistry.get(EXECUTION_PAYLOAD_SCHEMA).toVersionBellatrixRequired())); } @Override diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java index 7d0d0aac6e9..32e9ef2bae6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java @@ -13,9 +13,12 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTATION_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTER_SLASHING_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_HEADER_SCHEMA; import it.unimi.dsi.fastutil.longs.LongList; +import java.util.Optional; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; import tech.pegasys.teku.infrastructure.ssz.SszList; @@ -39,7 +42,6 @@ import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; @@ -87,10 +89,8 @@ private BlindedBeaconBlockBodySchemaBellatrixImpl( public static BlindedBeaconBlockBodySchemaBellatrixImpl create( final SpecConfigBellatrix specConfig, - final long maxValidatorsPerAttestation, final String containerName, - final SchemaRegistry schemaRegistry, - final ExecutionPayloadHeaderSchemaBellatrix executionPayloadHeaderSchema) { + final SchemaRegistry schemaRegistry) { return new BlindedBeaconBlockBodySchemaBellatrixImpl( containerName, namedSchema(BlockBodyFields.RANDAO_REVEAL, SszSignatureSchema.INSTANCE), @@ -108,9 +108,7 @@ public static BlindedBeaconBlockBodySchemaBellatrixImpl create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), - specConfig.getMaxAttestations())), + schemaRegistry.get(ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, SszListSchema.create(Deposit.SSZ_SCHEMA, specConfig.getMaxDeposits())), @@ -121,7 +119,9 @@ public static BlindedBeaconBlockBodySchemaBellatrixImpl create( namedSchema( BlockBodyFields.SYNC_AGGREGATE, SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), - namedSchema(BlockBodyFields.EXECUTION_PAYLOAD_HEADER, executionPayloadHeaderSchema)); + namedSchema( + BlockBodyFields.EXECUTION_PAYLOAD_HEADER, + schemaRegistry.get(EXECUTION_PAYLOAD_HEADER_SCHEMA).toVersionBellatrixRequired())); } @Override @@ -181,6 +181,11 @@ public ExecutionPayloadHeaderSchemaBellatrix getExecutionPayloadHeaderSchema() { return (ExecutionPayloadHeaderSchemaBellatrix) getFieldSchema9(); } + @Override + public Optional> toBlindedVersionBellatrix() { + return Optional.of(this); + } + @Override public LongList getBlindedNodeGeneralizedIndices() { return GIndexUtil.gIdxComposeAll( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java index 987701b19bc..647bfb08c48 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java @@ -13,6 +13,10 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTATION_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA; + import it.unimi.dsi.fastutil.longs.LongList; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; @@ -32,15 +36,12 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregateSchema; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadCapellaImpl; -import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadSchemaCapella; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChange; -import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChangeSchema; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; @@ -92,8 +93,6 @@ protected BeaconBlockBodySchemaCapellaImpl( public static BeaconBlockBodySchemaCapellaImpl create( final SpecConfigCapella specConfig, - final SignedBlsToExecutionChangeSchema blsToExecutionChangeSchema, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BeaconBlockBodySchemaCapellaImpl( @@ -113,9 +112,7 @@ public static BeaconBlockBodySchemaCapellaImpl create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), - specConfig.getMaxAttestations())), + schemaRegistry.get(ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, SszListSchema.create(Deposit.SSZ_SCHEMA, specConfig.getMaxDeposits())), @@ -127,11 +124,13 @@ public static BeaconBlockBodySchemaCapellaImpl create( BlockBodyFields.SYNC_AGGREGATE, SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), namedSchema( - BlockBodyFields.EXECUTION_PAYLOAD, new ExecutionPayloadSchemaCapella(specConfig)), + BlockBodyFields.EXECUTION_PAYLOAD, + schemaRegistry.get(EXECUTION_PAYLOAD_SCHEMA).toVersionCapellaRequired()), namedSchema( BlockBodyFields.BLS_TO_EXECUTION_CHANGES, SszListSchema.create( - blsToExecutionChangeSchema, specConfig.getMaxBlsToExecutionChanges()))); + schemaRegistry.get(SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA), + specConfig.getMaxBlsToExecutionChanges()))); } @Override diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java index 7db7b2e100a..41a665a8373 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java @@ -13,7 +13,13 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTATION_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTER_SLASHING_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_HEADER_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA; + import it.unimi.dsi.fastutil.longs.LongList; +import java.util.Optional; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; import tech.pegasys.teku.infrastructure.ssz.SszList; @@ -37,13 +43,10 @@ import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChange; -import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChangeSchema; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; -import tech.pegasys.teku.spec.schemas.registry.SchemaTypes; public class BlindedBeaconBlockBodySchemaCapellaImpl extends ContainerSchema11< @@ -91,8 +94,6 @@ private BlindedBeaconBlockBodySchemaCapellaImpl( public static BlindedBeaconBlockBodySchemaCapellaImpl create( final SpecConfigCapella specConfig, - final SignedBlsToExecutionChangeSchema signedBlsToExecutionChangeSchema, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BlindedBeaconBlockBodySchemaCapellaImpl( @@ -107,14 +108,12 @@ public static BlindedBeaconBlockBodySchemaCapellaImpl create( namedSchema( BlockBodyFields.ATTESTER_SLASHINGS, SszListSchema.create( - schemaRegistry.get(SchemaTypes.ATTESTER_SLASHING_SCHEMA), + schemaRegistry.get(ATTESTER_SLASHING_SCHEMA), specConfig.getMaxAttesterSlashings())), namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), - specConfig.getMaxAttestations())), + schemaRegistry.get(ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, SszListSchema.create(Deposit.SSZ_SCHEMA, specConfig.getMaxDeposits())), @@ -127,11 +126,12 @@ public static BlindedBeaconBlockBodySchemaCapellaImpl create( SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), namedSchema( BlockBodyFields.EXECUTION_PAYLOAD_HEADER, - new ExecutionPayloadHeaderSchemaCapella(specConfig)), + schemaRegistry.get(EXECUTION_PAYLOAD_HEADER_SCHEMA).toVersionCapellaRequired()), namedSchema( BlockBodyFields.BLS_TO_EXECUTION_CHANGES, SszListSchema.create( - signedBlsToExecutionChangeSchema, specConfig.getMaxBlsToExecutionChanges()))); + schemaRegistry.get(SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA), + specConfig.getMaxBlsToExecutionChanges()))); } @Override @@ -197,6 +197,11 @@ public ExecutionPayloadHeaderSchemaCapella getExecutionPayloadHeaderSchema() { return (SszListSchema) getFieldSchema10(); } + @Override + public Optional> toBlindedVersionCapella() { + return Optional.of(this); + } + @Override public LongList getBlindedNodeGeneralizedIndices() { return GIndexUtil.gIdxComposeAll( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodySchemaDenebImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodySchemaDenebImpl.java index 37aa90365a6..89328e6bc61 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodySchemaDenebImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodySchemaDenebImpl.java @@ -13,6 +13,12 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTATION_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTER_SLASHING_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_KZG_COMMITMENTS_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA; + import it.unimi.dsi.fastutil.longs.LongList; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; @@ -24,7 +30,6 @@ import tech.pegasys.teku.infrastructure.ssz.tree.GIndexUtil; import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode; import tech.pegasys.teku.spec.config.SpecConfigDeneb; -import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobKzgCommitmentsSchema; import tech.pegasys.teku.spec.datastructures.blocks.Eth1Data; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; @@ -33,20 +38,16 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregateSchema; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadDenebImpl; -import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadSchemaDeneb; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChange; -import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChangeSchema; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; -import tech.pegasys.teku.spec.schemas.registry.SchemaTypes; public class BeaconBlockBodySchemaDenebImpl extends ContainerSchema12< @@ -97,9 +98,6 @@ protected BeaconBlockBodySchemaDenebImpl( public static BeaconBlockBodySchemaDenebImpl create( final SpecConfigDeneb specConfig, - final SignedBlsToExecutionChangeSchema blsToExecutionChangeSchema, - final BlobKzgCommitmentsSchema blobKzgCommitmentsSchema, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BeaconBlockBodySchemaDenebImpl( @@ -114,14 +112,12 @@ public static BeaconBlockBodySchemaDenebImpl create( namedSchema( BlockBodyFields.ATTESTER_SLASHINGS, SszListSchema.create( - schemaRegistry.get(SchemaTypes.ATTESTER_SLASHING_SCHEMA), + schemaRegistry.get(ATTESTER_SLASHING_SCHEMA), specConfig.getMaxAttesterSlashings())), namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), - specConfig.getMaxAttestations())), + schemaRegistry.get(ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, SszListSchema.create(Deposit.SSZ_SCHEMA, specConfig.getMaxDeposits())), @@ -132,12 +128,16 @@ public static BeaconBlockBodySchemaDenebImpl create( namedSchema( BlockBodyFields.SYNC_AGGREGATE, SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), - namedSchema(BlockBodyFields.EXECUTION_PAYLOAD, new ExecutionPayloadSchemaDeneb(specConfig)), + namedSchema( + BlockBodyFields.EXECUTION_PAYLOAD, + schemaRegistry.get(EXECUTION_PAYLOAD_SCHEMA).toVersionDenebRequired()), namedSchema( BlockBodyFields.BLS_TO_EXECUTION_CHANGES, SszListSchema.create( - blsToExecutionChangeSchema, specConfig.getMaxBlsToExecutionChanges())), - namedSchema(BlockBodyFields.BLOB_KZG_COMMITMENTS, blobKzgCommitmentsSchema)); + schemaRegistry.get(SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA), + specConfig.getMaxBlsToExecutionChanges())), + namedSchema( + BlockBodyFields.BLOB_KZG_COMMITMENTS, schemaRegistry.get(BLOB_KZG_COMMITMENTS_SCHEMA))); } @Override diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BlindedBeaconBlockBodySchemaDenebImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BlindedBeaconBlockBodySchemaDenebImpl.java index 15bf7d4f678..fefed226d29 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BlindedBeaconBlockBodySchemaDenebImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BlindedBeaconBlockBodySchemaDenebImpl.java @@ -13,7 +13,13 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTATION_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_KZG_COMMITMENTS_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_HEADER_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA; + import it.unimi.dsi.fastutil.longs.LongList; +import java.util.Optional; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; import tech.pegasys.teku.infrastructure.ssz.SszList; @@ -24,7 +30,6 @@ import tech.pegasys.teku.infrastructure.ssz.tree.GIndexUtil; import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode; import tech.pegasys.teku.spec.config.SpecConfigDeneb; -import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobKzgCommitmentsSchema; import tech.pegasys.teku.spec.datastructures.blocks.Eth1Data; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; @@ -38,9 +43,7 @@ import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChange; -import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChangeSchema; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; @@ -96,9 +99,6 @@ private BlindedBeaconBlockBodySchemaDenebImpl( public static BlindedBeaconBlockBodySchemaDenebImpl create( final SpecConfigDeneb specConfig, - final SignedBlsToExecutionChangeSchema signedBlsToExecutionChangeSchema, - final BlobKzgCommitmentsSchema blobKzgCommitmentsSchema, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BlindedBeaconBlockBodySchemaDenebImpl( @@ -118,9 +118,7 @@ public static BlindedBeaconBlockBodySchemaDenebImpl create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), - specConfig.getMaxAttestations())), + schemaRegistry.get(ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, SszListSchema.create(Deposit.SSZ_SCHEMA, specConfig.getMaxDeposits())), @@ -133,12 +131,14 @@ public static BlindedBeaconBlockBodySchemaDenebImpl create( SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), namedSchema( BlockBodyFields.EXECUTION_PAYLOAD_HEADER, - new ExecutionPayloadHeaderSchemaDeneb(specConfig)), + schemaRegistry.get(EXECUTION_PAYLOAD_HEADER_SCHEMA).toVersionDenebRequired()), namedSchema( BlockBodyFields.BLS_TO_EXECUTION_CHANGES, SszListSchema.create( - signedBlsToExecutionChangeSchema, specConfig.getMaxBlsToExecutionChanges())), - namedSchema(BlockBodyFields.BLOB_KZG_COMMITMENTS, blobKzgCommitmentsSchema)); + schemaRegistry.get(SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA), + specConfig.getMaxBlsToExecutionChanges())), + namedSchema( + BlockBodyFields.BLOB_KZG_COMMITMENTS, schemaRegistry.get(BLOB_KZG_COMMITMENTS_SCHEMA))); } @Override @@ -223,4 +223,9 @@ public LongList getBlindedNodeGeneralizedIndices() { getChildGeneralizedIndex(getFieldIndex(BlockBodyFields.EXECUTION_PAYLOAD_HEADER)), getExecutionPayloadHeaderSchema().getBlindedNodeGeneralizedIndices()); } + + @Override + public Optional> toBlindedVersionDeneb() { + return Optional.of(this); + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BeaconBlockBodySchemaElectraImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BeaconBlockBodySchemaElectraImpl.java index 0aa36cbfc73..ab5eeca408c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BeaconBlockBodySchemaElectraImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BeaconBlockBodySchemaElectraImpl.java @@ -13,6 +13,11 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_KZG_COMMITMENTS_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_REQUESTS_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA; + import it.unimi.dsi.fastutil.longs.LongList; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; @@ -24,7 +29,6 @@ import tech.pegasys.teku.infrastructure.ssz.tree.GIndexUtil; import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode; import tech.pegasys.teku.spec.config.SpecConfigElectra; -import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobKzgCommitmentsSchema; import tech.pegasys.teku.spec.datastructures.blocks.Eth1Data; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; @@ -33,7 +37,6 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregateSchema; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadDenebImpl; -import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadSchemaDeneb; import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests; import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsSchema; import tech.pegasys.teku.spec.datastructures.operations.Attestation; @@ -41,9 +44,7 @@ import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChange; -import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChangeSchema; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.electra.AttestationElectraSchema; import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; @@ -102,10 +103,6 @@ protected BeaconBlockBodySchemaElectraImpl( public static BeaconBlockBodySchemaElectraImpl create( final SpecConfigElectra specConfig, - final SignedBlsToExecutionChangeSchema blsToExecutionChangeSchema, - final BlobKzgCommitmentsSchema blobKzgCommitmentsSchema, - final ExecutionRequestsSchema executionRequestsSchema, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BeaconBlockBodySchemaElectraImpl( @@ -125,9 +122,7 @@ public static BeaconBlockBodySchemaElectraImpl create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationElectraSchema( - maxValidatorsPerAttestation, specConfig.getMaxCommitteesPerSlot()) - .castTypeToAttestationSchema(), + schemaRegistry.get(SchemaTypes.ATTESTATION_SCHEMA), specConfig.getMaxAttestationsElectra())), namedSchema( BlockBodyFields.DEPOSITS, @@ -139,13 +134,18 @@ public static BeaconBlockBodySchemaElectraImpl create( namedSchema( BlockBodyFields.SYNC_AGGREGATE, SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), - namedSchema(BlockBodyFields.EXECUTION_PAYLOAD, new ExecutionPayloadSchemaDeneb(specConfig)), + namedSchema( + BlockBodyFields.EXECUTION_PAYLOAD, + schemaRegistry.get(EXECUTION_PAYLOAD_SCHEMA).toVersionDenebRequired()), namedSchema( BlockBodyFields.BLS_TO_EXECUTION_CHANGES, SszListSchema.create( - blsToExecutionChangeSchema, specConfig.getMaxBlsToExecutionChanges())), - namedSchema(BlockBodyFields.BLOB_KZG_COMMITMENTS, blobKzgCommitmentsSchema), - namedSchema(BlockBodyFields.EXECUTION_REQUESTS, executionRequestsSchema)); + schemaRegistry.get(SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA), + specConfig.getMaxBlsToExecutionChanges())), + namedSchema( + BlockBodyFields.BLOB_KZG_COMMITMENTS, schemaRegistry.get(BLOB_KZG_COMMITMENTS_SCHEMA)), + namedSchema( + BlockBodyFields.EXECUTION_REQUESTS, schemaRegistry.get(EXECUTION_REQUESTS_SCHEMA))); } @Override diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BlindedBeaconBlockBodySchemaElectraImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BlindedBeaconBlockBodySchemaElectraImpl.java index 76c96f447cc..30d3a53e5f2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BlindedBeaconBlockBodySchemaElectraImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra/BlindedBeaconBlockBodySchemaElectraImpl.java @@ -13,7 +13,14 @@ package tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTATION_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_KZG_COMMITMENTS_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_HEADER_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_REQUESTS_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA; + import it.unimi.dsi.fastutil.longs.LongList; +import java.util.Optional; import java.util.function.Function; import tech.pegasys.teku.infrastructure.async.SafeFuture; import tech.pegasys.teku.infrastructure.ssz.SszList; @@ -24,7 +31,6 @@ import tech.pegasys.teku.infrastructure.ssz.tree.GIndexUtil; import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode; import tech.pegasys.teku.spec.config.SpecConfigElectra; -import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobKzgCommitmentsSchema; import tech.pegasys.teku.spec.datastructures.blocks.Eth1Data; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; @@ -40,9 +46,7 @@ import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChange; -import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChangeSchema; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.electra.AttestationElectraSchema; import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; @@ -101,10 +105,6 @@ private BlindedBeaconBlockBodySchemaElectraImpl( public static BlindedBeaconBlockBodySchemaElectraImpl create( final SpecConfigElectra specConfig, - final SignedBlsToExecutionChangeSchema signedBlsToExecutionChangeSchema, - final BlobKzgCommitmentsSchema blobKzgCommitmentsSchema, - final ExecutionRequestsSchema executionRequestsSchema, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BlindedBeaconBlockBodySchemaElectraImpl( @@ -124,10 +124,7 @@ public static BlindedBeaconBlockBodySchemaElectraImpl create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationElectraSchema( - maxValidatorsPerAttestation, specConfig.getMaxCommitteesPerSlot()) - .castTypeToAttestationSchema(), - specConfig.getMaxAttestationsElectra())), + schemaRegistry.get(ATTESTATION_SCHEMA), specConfig.getMaxAttestationsElectra())), namedSchema( BlockBodyFields.DEPOSITS, SszListSchema.create(Deposit.SSZ_SCHEMA, specConfig.getMaxDeposits())), @@ -140,13 +137,16 @@ public static BlindedBeaconBlockBodySchemaElectraImpl create( SyncAggregateSchema.create(specConfig.getSyncCommitteeSize())), namedSchema( BlockBodyFields.EXECUTION_PAYLOAD_HEADER, - new ExecutionPayloadHeaderSchemaDeneb(specConfig)), + schemaRegistry.get(EXECUTION_PAYLOAD_HEADER_SCHEMA).toVersionDenebRequired()), namedSchema( BlockBodyFields.BLS_TO_EXECUTION_CHANGES, SszListSchema.create( - signedBlsToExecutionChangeSchema, specConfig.getMaxBlsToExecutionChanges())), - namedSchema(BlockBodyFields.BLOB_KZG_COMMITMENTS, blobKzgCommitmentsSchema), - namedSchema(BlockBodyFields.EXECUTION_REQUESTS, executionRequestsSchema)); + schemaRegistry.get(SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA), + specConfig.getMaxBlsToExecutionChanges())), + namedSchema( + BlockBodyFields.BLOB_KZG_COMMITMENTS, schemaRegistry.get(BLOB_KZG_COMMITMENTS_SCHEMA)), + namedSchema( + BlockBodyFields.EXECUTION_REQUESTS, schemaRegistry.get(EXECUTION_REQUESTS_SCHEMA))); } @Override @@ -237,4 +237,9 @@ public LongList getBlindedNodeGeneralizedIndices() { getChildGeneralizedIndex(getFieldIndex(BlockBodyFields.EXECUTION_PAYLOAD_HEADER)), getExecutionPayloadHeaderSchema().getBlindedNodeGeneralizedIndices()); } + + @Override + public Optional> toBlindedVersionElectra() { + return Optional.of(this); + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java index 3f9fa086eb6..92651425e3e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java @@ -33,7 +33,6 @@ import tech.pegasys.teku.spec.datastructures.operations.Deposit; import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing; import tech.pegasys.teku.spec.datastructures.operations.SignedVoluntaryExit; -import tech.pegasys.teku.spec.datastructures.operations.versions.phase0.AttestationPhase0Schema; import tech.pegasys.teku.spec.datastructures.type.SszSignature; import tech.pegasys.teku.spec.datastructures.type.SszSignatureSchema; import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; @@ -76,7 +75,6 @@ private BeaconBlockBodySchemaPhase0( public static BeaconBlockBodySchemaPhase0 create( final SpecConfig specConfig, - final long maxValidatorsPerAttestation, final String containerName, final SchemaRegistry schemaRegistry) { return new BeaconBlockBodySchemaPhase0( @@ -96,8 +94,7 @@ public static BeaconBlockBodySchemaPhase0 create( namedSchema( BlockBodyFields.ATTESTATIONS, SszListSchema.create( - new AttestationPhase0Schema(maxValidatorsPerAttestation) - .castTypeToAttestationSchema(), + schemaRegistry.get(SchemaTypes.ATTESTATION_SCHEMA), specConfig.getMaxAttestations())), namedSchema( BlockBodyFields.DEPOSITS, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadHeaderSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadHeaderSchema.java index 6ff1c819864..6afec32ce6c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadHeaderSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadHeaderSchema.java @@ -17,6 +17,9 @@ import java.util.function.Consumer; import tech.pegasys.teku.infrastructure.ssz.schema.SszContainerSchema; import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode; +import tech.pegasys.teku.spec.datastructures.execution.versions.bellatrix.ExecutionPayloadHeaderSchemaBellatrix; +import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadHeaderSchemaCapella; +import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadHeaderSchemaDeneb; public interface ExecutionPayloadHeaderSchema extends SszContainerSchema { @@ -37,4 +40,16 @@ public interface ExecutionPayloadHeaderSchema ExecutionPayloadHeader createExecutionPayloadHeader( Consumer builderConsumer); + + default ExecutionPayloadHeaderSchemaBellatrix toVersionBellatrixRequired() { + throw new UnsupportedOperationException("Not a Bellatrix schema"); + } + + default ExecutionPayloadHeaderSchemaCapella toVersionCapellaRequired() { + throw new UnsupportedOperationException("Not a Capella schema"); + } + + default ExecutionPayloadHeaderSchemaDeneb toVersionDenebRequired() { + throw new UnsupportedOperationException("Not a Deneb schema"); + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadSchema.java index c75e7b8c1ba..88bf465c217 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExecutionPayloadSchema.java @@ -20,8 +20,11 @@ import tech.pegasys.teku.infrastructure.ssz.schema.SszListSchema; import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode; import tech.pegasys.teku.spec.datastructures.builder.BuilderPayloadSchema; +import tech.pegasys.teku.spec.datastructures.execution.versions.bellatrix.ExecutionPayloadSchemaBellatrix; +import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadSchemaCapella; import tech.pegasys.teku.spec.datastructures.execution.versions.capella.Withdrawal; import tech.pegasys.teku.spec.datastructures.execution.versions.capella.WithdrawalSchema; +import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadSchemaDeneb; import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ConsolidationRequest; import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ConsolidationRequestSchema; import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequest; @@ -59,4 +62,16 @@ public interface ExecutionPayloadSchema LongList getBlindedNodeGeneralizedIndices(); ExecutionPayload createExecutionPayload(Consumer builderConsumer); + + default ExecutionPayloadSchemaBellatrix toVersionBellatrixRequired() { + throw new UnsupportedOperationException("Not a Bellatrix schema"); + } + + default ExecutionPayloadSchemaCapella toVersionCapellaRequired() { + throw new UnsupportedOperationException("Not a Capella schema"); + } + + default ExecutionPayloadSchemaDeneb toVersionDenebRequired() { + throw new UnsupportedOperationException("Not a Deneb schema"); + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java index 8e3a1c1482c..c7273bb6caa 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java @@ -149,4 +149,9 @@ public ExecutionPayloadHeader createExecutionPayloadHeader( public SszByteListSchema getExtraDataSchema() { return (SszByteListSchema) getFieldSchema10(); } + + @Override + public ExecutionPayloadHeaderSchemaBellatrix toVersionBellatrixRequired() { + return this; + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java index bd0fc7bb99a..8e61e48b72e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java @@ -186,4 +186,9 @@ public ExecutionPayloadBellatrix createFromBackingNode(final TreeNode node) { public SszByteListSchema getExtraDataSchema() { return (SszByteListSchema) getFieldSchema10(); } + + @Override + public ExecutionPayloadSchemaBellatrix toVersionBellatrixRequired() { + return this; + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java index e754b78109d..72894c9857e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java @@ -178,4 +178,9 @@ public ExecutionPayloadHeaderCapellaImpl createFromExecutionPayload( SszBytes32.of(executionPayload.getTransactions().hashTreeRoot()), SszBytes32.of(executionPayload.getWithdrawals().hashTreeRoot())); } + + @Override + public ExecutionPayloadHeaderSchemaCapella toVersionCapellaRequired() { + return this; + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java index 365d3e98936..aba7ac25def 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java @@ -197,4 +197,9 @@ public SszByteListSchema getExtraDataSchema() { public SszListSchema getWithdrawalsSchema() { return (SszListSchema) getFieldSchema14(); } + + @Override + public ExecutionPayloadSchemaCapella toVersionCapellaRequired() { + return this; + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderSchemaDeneb.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderSchemaDeneb.java index dc1dc227ea1..5b0192ba2fb 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderSchemaDeneb.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderSchemaDeneb.java @@ -164,4 +164,9 @@ public ExecutionPayloadHeaderDenebImpl createFromExecutionPayload( SszUInt64.of(executionPayload.getBlobGasUsed()), SszUInt64.of(executionPayload.getExcessBlobGas())); } + + @Override + public ExecutionPayloadHeaderSchemaDeneb toVersionDenebRequired() { + return this; + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadSchemaDeneb.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadSchemaDeneb.java index c1c0005fdb0..e072e918ab3 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadSchemaDeneb.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadSchemaDeneb.java @@ -203,4 +203,9 @@ public SszByteListSchema getExtraDataSchema() { public SszListSchema getWithdrawalsSchema() { return (SszListSchema) getChildSchema(getFieldIndex(WITHDRAWALS)); } + + @Override + public ExecutionPayloadSchemaDeneb toVersionDenebRequired() { + return this; + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsAltair.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsAltair.java index e22c88c271f..13c69f96e07 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsAltair.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsAltair.java @@ -14,7 +14,10 @@ package tech.pegasys.teku.spec.schemas; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.AGGREGATE_AND_PROOF_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BEACON_BLOCK_BODY_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BEACON_BLOCK_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_AGGREGATE_AND_PROOF_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BEACON_BLOCK_SCHEMA; import com.google.common.base.Preconditions; import java.util.Optional; @@ -29,7 +32,6 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.BeaconBlockBodyBuilderAltair; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.BeaconBlockBodySchemaAltairImpl; import tech.pegasys.teku.spec.datastructures.lightclient.LightClientBootstrapSchema; import tech.pegasys.teku.spec.datastructures.lightclient.LightClientHeaderSchema; import tech.pegasys.teku.spec.datastructures.lightclient.LightClientUpdateResponseSchema; @@ -60,7 +62,7 @@ public class SchemaDefinitionsAltair extends AbstractSchemaDefinitions { private final SignedAggregateAndProofSchema signedAggregateAndProofSchema; private final AggregateAndProofSchema aggregateAndProofSchema; private final BeaconStateSchemaAltair beaconStateSchema; - private final BeaconBlockBodySchemaAltairImpl beaconBlockBodySchema; + private final BeaconBlockBodySchema beaconBlockBodySchema; private final BeaconBlockSchema beaconBlockSchema; private final SignedBeaconBlockSchema signedBeaconBlockSchema; private final SyncCommitteeContributionSchema syncCommitteeContributionSchema; @@ -81,15 +83,9 @@ public SchemaDefinitionsAltair(final SchemaRegistry schemaRegistry) { this.aggregateAndProofSchema = schemaRegistry.get(AGGREGATE_AND_PROOF_SCHEMA); this.signedAggregateAndProofSchema = schemaRegistry.get(SIGNED_AGGREGATE_AND_PROOF_SCHEMA); this.beaconStateSchema = BeaconStateSchemaAltair.create(specConfig); - this.beaconBlockBodySchema = - BeaconBlockBodySchemaAltairImpl.create( - specConfig, - getMaxValidatorsPerAttestation(specConfig), - "BeaconBlockBodyAltair", - schemaRegistry); - this.beaconBlockSchema = new BeaconBlockSchema(beaconBlockBodySchema, "BeaconBlockAltair"); - this.signedBeaconBlockSchema = - new SignedBeaconBlockSchema(beaconBlockSchema, "SignedBeaconBlockAltair"); + this.beaconBlockBodySchema = schemaRegistry.get(BEACON_BLOCK_BODY_SCHEMA); + this.beaconBlockSchema = schemaRegistry.get(BEACON_BLOCK_SCHEMA); + this.signedBeaconBlockSchema = schemaRegistry.get(SIGNED_BEACON_BLOCK_SCHEMA); this.syncCommitteeContributionSchema = SyncCommitteeContributionSchema.create(specConfig); this.contributionAndProofSchema = ContributionAndProofSchema.create(syncCommitteeContributionSchema); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsBellatrix.java index a8c27ddd288..aaf69cf8e18 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsBellatrix.java @@ -14,6 +14,11 @@ package tech.pegasys.teku.spec.schemas; import static com.google.common.base.Preconditions.checkArgument; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLINDED_BEACON_BLOCK_BODY_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLINDED_BEACON_BLOCK_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_HEADER_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLINDED_BEACON_BLOCK_SCHEMA; import java.util.Optional; import tech.pegasys.teku.spec.config.SpecConfigBellatrix; @@ -26,15 +31,13 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BeaconBlockBodyBuilderBellatrix; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BeaconBlockBodySchemaBellatrixImpl; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BlindedBeaconBlockBodySchemaBellatrixImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BlindedBeaconBlockBodySchemaBellatrix; import tech.pegasys.teku.spec.datastructures.builder.BuilderBidSchema; import tech.pegasys.teku.spec.datastructures.builder.BuilderPayloadSchema; import tech.pegasys.teku.spec.datastructures.builder.SignedBuilderBidSchema; import tech.pegasys.teku.spec.datastructures.builder.versions.bellatrix.BuilderBidSchemaBellatrix; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeaderSchema; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; -import tech.pegasys.teku.spec.datastructures.execution.versions.bellatrix.ExecutionPayloadHeaderSchemaBellatrix; import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconStateSchema; import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.bellatrix.BeaconStateBellatrix; import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.bellatrix.BeaconStateSchemaBellatrix; @@ -43,13 +46,11 @@ public class SchemaDefinitionsBellatrix extends SchemaDefinitionsAltair { private final BeaconStateSchemaBellatrix beaconStateSchema; - private final BeaconBlockBodySchemaBellatrixImpl beaconBlockBodySchema; - private final BlindedBeaconBlockBodySchemaBellatrixImpl blindedBeaconBlockBodySchema; - private final BeaconBlockSchema beaconBlockSchema; + private final ExecutionPayloadSchema executionPayloadSchema; + private final BlindedBeaconBlockBodySchemaBellatrix blindedBeaconBlockBodySchema; private final BeaconBlockSchema blindedBeaconBlockSchema; - private final SignedBeaconBlockSchema signedBeaconBlockSchema; private final SignedBeaconBlockSchema signedBlindedBeaconBlockSchema; - private final ExecutionPayloadHeaderSchemaBellatrix executionPayloadHeaderSchema; + private final ExecutionPayloadHeaderSchema executionPayloadHeaderSchema; private final BuilderBidSchema builderBidSchema; private final SignedBuilderBidSchema signedBuilderBidSchema; @@ -57,26 +58,12 @@ public SchemaDefinitionsBellatrix(final SchemaRegistry schemaRegistry) { super(schemaRegistry); final SpecConfigBellatrix specConfig = SpecConfigBellatrix.required(schemaRegistry.getSpecConfig()); - final long maxValidatorsPerAttestation = getMaxValidatorsPerAttestation(specConfig); this.beaconStateSchema = BeaconStateSchemaBellatrix.create(specConfig); - this.executionPayloadHeaderSchema = beaconStateSchema.getLastExecutionPayloadHeaderSchema(); - this.beaconBlockBodySchema = - BeaconBlockBodySchemaBellatrixImpl.create( - specConfig, maxValidatorsPerAttestation, "BeaconBlockBodyBellatrix", schemaRegistry); - this.blindedBeaconBlockBodySchema = - BlindedBeaconBlockBodySchemaBellatrixImpl.create( - specConfig, - maxValidatorsPerAttestation, - "BlindedBlockBodyBellatrix", - schemaRegistry, - executionPayloadHeaderSchema); - this.beaconBlockSchema = new BeaconBlockSchema(beaconBlockBodySchema, "BeaconBlockBellatrix"); - this.blindedBeaconBlockSchema = - new BeaconBlockSchema(blindedBeaconBlockBodySchema, "BlindedBlockBellatrix"); - this.signedBeaconBlockSchema = - new SignedBeaconBlockSchema(beaconBlockSchema, "SignedBeaconBlockBellatrix"); - this.signedBlindedBeaconBlockSchema = - new SignedBeaconBlockSchema(blindedBeaconBlockSchema, "SignedBlindedBlockBellatrix"); + this.executionPayloadSchema = schemaRegistry.get(EXECUTION_PAYLOAD_SCHEMA); + this.executionPayloadHeaderSchema = schemaRegistry.get(EXECUTION_PAYLOAD_HEADER_SCHEMA); + this.blindedBeaconBlockBodySchema = schemaRegistry.get(BLINDED_BEACON_BLOCK_BODY_SCHEMA); + this.blindedBeaconBlockSchema = schemaRegistry.get(BLINDED_BEACON_BLOCK_SCHEMA); + this.signedBlindedBeaconBlockSchema = schemaRegistry.get(SIGNED_BLINDED_BEACON_BLOCK_SCHEMA); this.builderBidSchema = new BuilderBidSchemaBellatrix("BuilderBidBellatrix", executionPayloadHeaderSchema); this.signedBuilderBidSchema = @@ -98,16 +85,6 @@ public static SchemaDefinitionsBellatrix required(final SchemaDefinitions schema return beaconStateSchema; } - @Override - public SignedBeaconBlockSchema getSignedBeaconBlockSchema() { - return signedBeaconBlockSchema; - } - - @Override - public BeaconBlockSchema getBeaconBlockSchema() { - return beaconBlockSchema; - } - @Override public BeaconBlockSchema getBlindedBeaconBlockSchema() { return blindedBeaconBlockSchema; @@ -118,31 +95,16 @@ public BeaconBlockBodySchema getBlindedBeaconBlockBodySchema() { return blindedBeaconBlockBodySchema; } - @Override - public BeaconBlockBodySchema getBeaconBlockBodySchema() { - return beaconBlockBodySchema; - } - @Override public SignedBeaconBlockSchema getSignedBlindedBeaconBlockSchema() { return signedBlindedBeaconBlockSchema; } - @Override - public BlockContainerSchema getBlockContainerSchema() { - return getBeaconBlockSchema().castTypeToBlockContainer(); - } - @Override public BlockContainerSchema getBlindedBlockContainerSchema() { return getBlindedBeaconBlockSchema().castTypeToBlockContainer(); } - @Override - public SignedBlockContainerSchema getSignedBlockContainerSchema() { - return getSignedBeaconBlockSchema().castTypeToSignedBlockContainer(); - } - @Override public SignedBlockContainerSchema getSignedBlindedBlockContainerSchema() { return getSignedBlindedBeaconBlockSchema().castTypeToSignedBlockContainer(); @@ -150,11 +112,13 @@ public SignedBlockContainerSchema getSignedBlindedBlockCon @Override public BeaconBlockBodyBuilder createBeaconBlockBodyBuilder() { - return new BeaconBlockBodyBuilderBellatrix(beaconBlockBodySchema, blindedBeaconBlockBodySchema); + return new BeaconBlockBodyBuilderBellatrix( + getBeaconBlockBodySchema().toVersionBellatrix().orElseThrow(), + blindedBeaconBlockBodySchema); } public ExecutionPayloadSchema getExecutionPayloadSchema() { - return beaconBlockBodySchema.getExecutionPayloadSchema(); + return executionPayloadSchema; } public ExecutionPayloadHeaderSchema getExecutionPayloadHeaderSchema() { diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsCapella.java index b256f056394..b119db05bd1 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsCapella.java @@ -21,24 +21,11 @@ import java.util.Optional; import tech.pegasys.teku.spec.config.SpecConfigCapella; -import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockSchema; -import tech.pegasys.teku.spec.datastructures.blocks.BlockContainer; -import tech.pegasys.teku.spec.datastructures.blocks.BlockContainerSchema; -import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlockSchema; -import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainer; -import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainerSchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella.BeaconBlockBodyBuilderCapella; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella.BeaconBlockBodySchemaCapellaImpl; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella.BlindedBeaconBlockBodySchemaCapellaImpl; import tech.pegasys.teku.spec.datastructures.builder.BuilderBidSchema; import tech.pegasys.teku.spec.datastructures.builder.SignedBuilderBidSchema; import tech.pegasys.teku.spec.datastructures.builder.versions.bellatrix.BuilderBidSchemaBellatrix; -import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeaderSchema; -import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; -import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadHeaderSchemaCapella; -import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadSchemaCapella; import tech.pegasys.teku.spec.datastructures.execution.versions.capella.WithdrawalSchema; import tech.pegasys.teku.spec.datastructures.operations.BlsToExecutionChangeSchema; import tech.pegasys.teku.spec.datastructures.operations.SignedBlsToExecutionChangeSchema; @@ -52,18 +39,6 @@ public class SchemaDefinitionsCapella extends SchemaDefinitionsBellatrix { private final BeaconStateSchemaCapella beaconStateSchema; - - private final ExecutionPayloadSchemaCapella executionPayloadSchemaCapella; - private final ExecutionPayloadHeaderSchemaCapella executionPayloadHeaderSchemaCapella; - - private final BeaconBlockBodySchemaCapellaImpl beaconBlockBodySchema; - private final BlindedBeaconBlockBodySchemaCapellaImpl blindedBeaconBlockBodySchema; - - private final BeaconBlockSchema beaconBlockSchema; - private final BeaconBlockSchema blindedBeaconBlockSchema; - private final SignedBeaconBlockSchema signedBeaconBlockSchema; - private final SignedBeaconBlockSchema signedBlindedBeaconBlockSchema; - private final WithdrawalSchema withdrawalSchema; private final BlsToExecutionChangeSchema blsToExecutionChangeSchema; @@ -78,38 +53,14 @@ public SchemaDefinitionsCapella(final SchemaRegistry schemaRegistry) { super(schemaRegistry); final SpecConfigCapella specConfig = SpecConfigCapella.required(schemaRegistry.getSpecConfig()); this.historicalSummarySchema = schemaRegistry.get(HISTORICAL_SUMMARY_SCHEMA); - this.executionPayloadSchemaCapella = new ExecutionPayloadSchemaCapella(specConfig); this.blsToExecutionChangeSchema = schemaRegistry.get(BLS_TO_EXECUTION_CHANGE_SCHEMA); this.signedBlsToExecutionChangeSchema = schemaRegistry.get(SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA); this.withdrawalSchema = schemaRegistry.get(WITHDRAWAL_SCHEMA); this.beaconStateSchema = BeaconStateSchemaCapella.create(specConfig); - this.executionPayloadHeaderSchemaCapella = - beaconStateSchema.getLastExecutionPayloadHeaderSchema(); - this.beaconBlockBodySchema = - BeaconBlockBodySchemaCapellaImpl.create( - specConfig, - signedBlsToExecutionChangeSchema, - getMaxValidatorsPerAttestation(specConfig), - "BeaconBlockBodyCapella", - schemaRegistry); - this.blindedBeaconBlockBodySchema = - BlindedBeaconBlockBodySchemaCapellaImpl.create( - specConfig, - signedBlsToExecutionChangeSchema, - getMaxValidatorsPerAttestation(specConfig), - "BlindedBlockBodyCapella", - schemaRegistry); - this.beaconBlockSchema = new BeaconBlockSchema(beaconBlockBodySchema, "BeaconBlockCapella"); - this.blindedBeaconBlockSchema = - new BeaconBlockSchema(blindedBeaconBlockBodySchema, "BlindedBlockCapella"); - this.signedBeaconBlockSchema = - new SignedBeaconBlockSchema(beaconBlockSchema, "SignedBeaconBlockCapella"); - this.signedBlindedBeaconBlockSchema = - new SignedBeaconBlockSchema(blindedBeaconBlockSchema, "SignedBlindedBlockCapella"); this.builderBidSchemaCapella = - new BuilderBidSchemaBellatrix("BuilderBidCapella", executionPayloadHeaderSchemaCapella); + new BuilderBidSchemaBellatrix("BuilderBidCapella", getExecutionPayloadHeaderSchema()); this.signedBuilderBidSchemaCapella = new SignedBuilderBidSchema("SignedBuilderBidCapella", builderBidSchemaCapella); } @@ -129,69 +80,11 @@ public static SchemaDefinitionsCapella required(final SchemaDefinitions schemaDe return beaconStateSchema; } - @Override - public BeaconBlockBodySchema getBeaconBlockBodySchema() { - return beaconBlockBodySchema; - } - - @Override - public BeaconBlockBodySchema getBlindedBeaconBlockBodySchema() { - return blindedBeaconBlockBodySchema; - } - - @Override - public BeaconBlockSchema getBeaconBlockSchema() { - return beaconBlockSchema; - } - - @Override - public BeaconBlockSchema getBlindedBeaconBlockSchema() { - return blindedBeaconBlockSchema; - } - - @Override - public SignedBeaconBlockSchema getSignedBeaconBlockSchema() { - return signedBeaconBlockSchema; - } - - @Override - public SignedBeaconBlockSchema getSignedBlindedBeaconBlockSchema() { - return signedBlindedBeaconBlockSchema; - } - - @Override - public BlockContainerSchema getBlockContainerSchema() { - return getBeaconBlockSchema().castTypeToBlockContainer(); - } - - @Override - public BlockContainerSchema getBlindedBlockContainerSchema() { - return getBlindedBeaconBlockSchema().castTypeToBlockContainer(); - } - - @Override - public SignedBlockContainerSchema getSignedBlockContainerSchema() { - return getSignedBeaconBlockSchema().castTypeToSignedBlockContainer(); - } - - @Override - public SignedBlockContainerSchema getSignedBlindedBlockContainerSchema() { - return getSignedBlindedBeaconBlockSchema().castTypeToSignedBlockContainer(); - } - - @Override - public ExecutionPayloadSchema getExecutionPayloadSchema() { - return executionPayloadSchemaCapella; - } - - @Override - public ExecutionPayloadHeaderSchema getExecutionPayloadHeaderSchema() { - return executionPayloadHeaderSchemaCapella; - } - @Override public BeaconBlockBodyBuilder createBeaconBlockBodyBuilder() { - return new BeaconBlockBodyBuilderCapella(beaconBlockBodySchema, blindedBeaconBlockBodySchema); + return new BeaconBlockBodyBuilderCapella( + getBeaconBlockBodySchema().toVersionCapella().orElseThrow(), + getBlindedBeaconBlockBodySchema().toBlindedVersionCapella().orElseThrow()); } public WithdrawalSchema getWithdrawalSchema() { diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsDeneb.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsDeneb.java index 8129cecc1f8..ac70c22db31 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsDeneb.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsDeneb.java @@ -29,17 +29,12 @@ import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobKzgCommitmentsSchema; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSchema; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecarSchema; -import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockSchema; import tech.pegasys.teku.spec.datastructures.blocks.BlockContainer; import tech.pegasys.teku.spec.datastructures.blocks.BlockContainerSchema; -import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlockSchema; import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainer; import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainerSchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BeaconBlockBodyBuilderDeneb; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BeaconBlockBodySchemaDenebImpl; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BlindedBeaconBlockBodySchemaDenebImpl; import tech.pegasys.teku.spec.datastructures.blocks.versions.deneb.BlockContentsSchema; import tech.pegasys.teku.spec.datastructures.blocks.versions.deneb.SignedBlockContentsSchema; import tech.pegasys.teku.spec.datastructures.builder.BlobsBundleSchema; @@ -48,10 +43,6 @@ import tech.pegasys.teku.spec.datastructures.builder.ExecutionPayloadAndBlobsBundleSchema; import tech.pegasys.teku.spec.datastructures.builder.SignedBuilderBidSchema; import tech.pegasys.teku.spec.datastructures.builder.versions.deneb.BuilderBidSchemaDeneb; -import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeaderSchema; -import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; -import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadHeaderSchemaDeneb; -import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadSchemaDeneb; import tech.pegasys.teku.spec.datastructures.networking.libp2p.rpc.BlobSidecarsByRootRequestMessageSchema; import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconStateSchema; import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.deneb.BeaconStateDeneb; @@ -63,19 +54,8 @@ public class SchemaDefinitionsDeneb extends SchemaDefinitionsCapella { private final BeaconStateSchemaDeneb beaconStateSchema; - private final ExecutionPayloadSchemaDeneb executionPayloadSchemaDeneb; - private final ExecutionPayloadHeaderSchemaDeneb executionPayloadHeaderSchemaDeneb; - private final BlobKzgCommitmentsSchema blobKzgCommitmentsSchema; - private final BeaconBlockBodySchemaDenebImpl beaconBlockBodySchema; - private final BlindedBeaconBlockBodySchemaDenebImpl blindedBeaconBlockBodySchema; - - private final BeaconBlockSchema beaconBlockSchema; - private final BeaconBlockSchema blindedBeaconBlockSchema; - private final SignedBeaconBlockSchema signedBeaconBlockSchema; - private final SignedBeaconBlockSchema signedBlindedBeaconBlockSchema; - private final BuilderBidSchema builderBidSchemaDeneb; private final SignedBuilderBidSchema signedBuilderBidSchemaDeneb; @@ -91,38 +71,12 @@ public class SchemaDefinitionsDeneb extends SchemaDefinitionsCapella { public SchemaDefinitionsDeneb(final SchemaRegistry schemaRegistry) { super(schemaRegistry); final SpecConfigDeneb specConfig = SpecConfigDeneb.required(schemaRegistry.getSpecConfig()); - this.executionPayloadSchemaDeneb = new ExecutionPayloadSchemaDeneb(specConfig); this.beaconStateSchema = BeaconStateSchemaDeneb.create(specConfig); - this.executionPayloadHeaderSchemaDeneb = - beaconStateSchema.getLastExecutionPayloadHeaderSchema(); this.blobKzgCommitmentsSchema = schemaRegistry.get(BLOB_KZG_COMMITMENTS_SCHEMA); - this.beaconBlockBodySchema = - BeaconBlockBodySchemaDenebImpl.create( - specConfig, - getSignedBlsToExecutionChangeSchema(), - blobKzgCommitmentsSchema, - getMaxValidatorsPerAttestation(specConfig), - "BeaconBlockBodyDeneb", - schemaRegistry); - this.blindedBeaconBlockBodySchema = - BlindedBeaconBlockBodySchemaDenebImpl.create( - specConfig, - getSignedBlsToExecutionChangeSchema(), - blobKzgCommitmentsSchema, - getMaxValidatorsPerAttestation(specConfig), - "BlindedBlockBodyDeneb", - schemaRegistry); - this.beaconBlockSchema = new BeaconBlockSchema(beaconBlockBodySchema, "BeaconBlockDeneb"); - this.blindedBeaconBlockSchema = - new BeaconBlockSchema(blindedBeaconBlockBodySchema, "BlindedBlockDeneb"); - this.signedBeaconBlockSchema = - new SignedBeaconBlockSchema(beaconBlockSchema, "SignedBeaconBlockDeneb"); - this.signedBlindedBeaconBlockSchema = - new SignedBeaconBlockSchema(blindedBeaconBlockSchema, "SignedBlindedBlockDeneb"); this.builderBidSchemaDeneb = new BuilderBidSchemaDeneb( - "BuilderBidDeneb", executionPayloadHeaderSchemaDeneb, blobKzgCommitmentsSchema); + "BuilderBidDeneb", getExecutionPayloadHeaderSchema(), blobKzgCommitmentsSchema); this.signedBuilderBidSchemaDeneb = new SignedBuilderBidSchema("SignedBuilderBidDeneb", builderBidSchemaDeneb); @@ -130,13 +84,14 @@ public SchemaDefinitionsDeneb(final SchemaRegistry schemaRegistry) { this.blobsInBlockSchema = schemaRegistry.get(BLOBS_IN_BLOCK_SCHEMA); this.blobSidecarSchema = schemaRegistry.get(BLOB_SIDECAR_SCHEMA); this.blockContentsSchema = - BlockContentsSchema.create(specConfig, beaconBlockSchema, blobSchema, "BlockContentsDeneb"); + BlockContentsSchema.create( + specConfig, getBeaconBlockSchema(), blobSchema, "BlockContentsDeneb"); this.signedBlockContentsSchema = SignedBlockContentsSchema.create( - specConfig, signedBeaconBlockSchema, blobSchema, "SignedBlockContentsDeneb"); + specConfig, getSignedBeaconBlockSchema(), blobSchema, "SignedBlockContentsDeneb"); this.blobsBundleSchema = schemaRegistry.get(BLOBS_BUNDLE_SCHEMA); this.executionPayloadAndBlobsBundleSchema = - new ExecutionPayloadAndBlobsBundleSchema(executionPayloadSchemaDeneb, blobsBundleSchema); + new ExecutionPayloadAndBlobsBundleSchema(getExecutionPayloadSchema(), blobsBundleSchema); this.blobSidecarsByRootRequestMessageSchema = schemaRegistry.get(BLOB_SIDECARS_BY_ROOT_REQUEST_MESSAGE_SCHEMA); } @@ -156,66 +111,16 @@ public static SchemaDefinitionsDeneb required(final SchemaDefinitions schemaDefi return beaconStateSchema; } - @Override - public BeaconBlockBodySchema getBeaconBlockBodySchema() { - return beaconBlockBodySchema; - } - - @Override - public BeaconBlockBodySchema getBlindedBeaconBlockBodySchema() { - return blindedBeaconBlockBodySchema; - } - - @Override - public BeaconBlockSchema getBeaconBlockSchema() { - return beaconBlockSchema; - } - - @Override - public BeaconBlockSchema getBlindedBeaconBlockSchema() { - return blindedBeaconBlockSchema; - } - - @Override - public SignedBeaconBlockSchema getSignedBeaconBlockSchema() { - return signedBeaconBlockSchema; - } - - @Override - public SignedBeaconBlockSchema getSignedBlindedBeaconBlockSchema() { - return signedBlindedBeaconBlockSchema; - } - @Override public BlockContainerSchema getBlockContainerSchema() { return getBlockContentsSchema().castTypeToBlockContainer(); } - @Override - public BlockContainerSchema getBlindedBlockContainerSchema() { - return getBlindedBeaconBlockSchema().castTypeToBlockContainer(); - } - @Override public SignedBlockContainerSchema getSignedBlockContainerSchema() { return getSignedBlockContentsSchema().castTypeToSignedBlockContainer(); } - @Override - public SignedBlockContainerSchema getSignedBlindedBlockContainerSchema() { - return getSignedBlindedBeaconBlockSchema().castTypeToSignedBlockContainer(); - } - - @Override - public ExecutionPayloadSchema getExecutionPayloadSchema() { - return executionPayloadSchemaDeneb; - } - - @Override - public ExecutionPayloadHeaderSchema getExecutionPayloadHeaderSchema() { - return executionPayloadHeaderSchemaDeneb; - } - @Override public BuilderBidSchema getBuilderBidSchema() { return builderBidSchemaDeneb; @@ -233,7 +138,9 @@ public BuilderPayloadSchema getBuilderPayloadSchema() { @Override public BeaconBlockBodyBuilder createBeaconBlockBodyBuilder() { - return new BeaconBlockBodyBuilderDeneb(beaconBlockBodySchema, blindedBeaconBlockBodySchema); + return new BeaconBlockBodyBuilderDeneb( + getBeaconBlockBodySchema().toVersionDeneb().orElseThrow(), + getBlindedBeaconBlockBodySchema().toBlindedVersionDeneb().orElseThrow()); } public BlobSchema getBlobSchema() { diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsElectra.java index 1458ba3515c..378aca177f5 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsElectra.java @@ -15,22 +15,18 @@ import static com.google.common.base.Preconditions.checkArgument; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOBS_BUNDLE_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_REQUESTS_SCHEMA; import java.util.Optional; import tech.pegasys.teku.infrastructure.ssz.schema.SszListSchema; import tech.pegasys.teku.spec.config.SpecConfig; import tech.pegasys.teku.spec.config.SpecConfigElectra; -import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockSchema; import tech.pegasys.teku.spec.datastructures.blocks.BlockContainer; import tech.pegasys.teku.spec.datastructures.blocks.BlockContainerSchema; -import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlockSchema; import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainer; import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainerSchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BeaconBlockBodyBuilderElectra; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BeaconBlockBodySchemaElectraImpl; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BlindedBeaconBlockBodySchemaElectraImpl; import tech.pegasys.teku.spec.datastructures.blocks.versions.deneb.BlockContentsSchema; import tech.pegasys.teku.spec.datastructures.blocks.versions.deneb.SignedBlockContentsSchema; import tech.pegasys.teku.spec.datastructures.builder.BuilderBidSchema; @@ -57,14 +53,6 @@ public class SchemaDefinitionsElectra extends SchemaDefinitionsDeneb { private final BeaconStateSchemaElectra beaconStateSchema; - private final BeaconBlockBodySchemaElectraImpl beaconBlockBodySchema; - private final BlindedBeaconBlockBodySchemaElectraImpl blindedBeaconBlockBodySchema; - - private final BeaconBlockSchema beaconBlockSchema; - private final BeaconBlockSchema blindedBeaconBlockSchema; - private final SignedBeaconBlockSchema signedBeaconBlockSchema; - private final SignedBeaconBlockSchema signedBlindedBeaconBlockSchema; - private final BuilderBidSchema builderBidSchemaElectra; private final SignedBuilderBidSchema signedBuilderBidSchemaElectra; @@ -87,35 +75,9 @@ public SchemaDefinitionsElectra(final SchemaRegistry schemaRegistry) { super(schemaRegistry); final SpecConfigElectra specConfig = SpecConfigElectra.required(schemaRegistry.getSpecConfig()); - final long maxValidatorsPerAttestation = getMaxValidatorsPerAttestation(specConfig); - - this.executionRequestsSchema = new ExecutionRequestsSchema(specConfig); + this.executionRequestsSchema = schemaRegistry.get(EXECUTION_REQUESTS_SCHEMA); this.beaconStateSchema = BeaconStateSchemaElectra.create(specConfig); - this.beaconBlockBodySchema = - BeaconBlockBodySchemaElectraImpl.create( - specConfig, - getSignedBlsToExecutionChangeSchema(), - getBlobKzgCommitmentsSchema(), - getExecutionRequestsSchema(), - maxValidatorsPerAttestation, - "BeaconBlockBodyElectra", - schemaRegistry); - this.blindedBeaconBlockBodySchema = - BlindedBeaconBlockBodySchemaElectraImpl.create( - specConfig, - getSignedBlsToExecutionChangeSchema(), - getBlobKzgCommitmentsSchema(), - getExecutionRequestsSchema(), - maxValidatorsPerAttestation, - "BlindedBlockBodyElectra", - schemaRegistry); - this.beaconBlockSchema = new BeaconBlockSchema(beaconBlockBodySchema, "BeaconBlockElectra"); - this.blindedBeaconBlockSchema = - new BeaconBlockSchema(blindedBeaconBlockBodySchema, "BlindedBlockElectra"); - this.signedBeaconBlockSchema = - new SignedBeaconBlockSchema(beaconBlockSchema, "SignedBeaconBlockElectra"); - this.signedBlindedBeaconBlockSchema = - new SignedBeaconBlockSchema(blindedBeaconBlockSchema, "SignedBlindedBlockElectra"); + this.builderBidSchemaElectra = new BuilderBidSchemaElectra( "BuilderBidElectra", @@ -127,10 +89,13 @@ public SchemaDefinitionsElectra(final SchemaRegistry schemaRegistry) { this.blockContentsSchema = BlockContentsSchema.create( - specConfig, beaconBlockSchema, getBlobSchema(), "BlockContentsElectra"); + specConfig, getBeaconBlockSchema(), getBlobSchema(), "BlockContentsElectra"); this.signedBlockContentsSchema = SignedBlockContentsSchema.create( - specConfig, signedBeaconBlockSchema, getBlobSchema(), "SignedBlockContentsElectra"); + specConfig, + getSignedBeaconBlockSchema(), + getBlobSchema(), + "SignedBlockContentsElectra"); this.executionPayloadAndBlobsBundleSchema = new ExecutionPayloadAndBlobsBundleSchema( getExecutionPayloadSchema(), schemaRegistry.get(BLOBS_BUNDLE_SCHEMA)); @@ -159,56 +124,16 @@ public static SchemaDefinitionsElectra required(final SchemaDefinitions schemaDe return beaconStateSchema; } - @Override - public BeaconBlockBodySchema getBeaconBlockBodySchema() { - return beaconBlockBodySchema; - } - - @Override - public BeaconBlockBodySchema getBlindedBeaconBlockBodySchema() { - return blindedBeaconBlockBodySchema; - } - - @Override - public BeaconBlockSchema getBeaconBlockSchema() { - return beaconBlockSchema; - } - - @Override - public BeaconBlockSchema getBlindedBeaconBlockSchema() { - return blindedBeaconBlockSchema; - } - - @Override - public SignedBeaconBlockSchema getSignedBeaconBlockSchema() { - return signedBeaconBlockSchema; - } - - @Override - public SignedBeaconBlockSchema getSignedBlindedBeaconBlockSchema() { - return signedBlindedBeaconBlockSchema; - } - @Override public BlockContainerSchema getBlockContainerSchema() { return getBlockContentsSchema().castTypeToBlockContainer(); } - @Override - public BlockContainerSchema getBlindedBlockContainerSchema() { - return getBlindedBeaconBlockSchema().castTypeToBlockContainer(); - } - @Override public SignedBlockContainerSchema getSignedBlockContainerSchema() { return getSignedBlockContentsSchema().castTypeToSignedBlockContainer(); } - @Override - public SignedBlockContainerSchema getSignedBlindedBlockContainerSchema() { - return getSignedBlindedBeaconBlockSchema().castTypeToSignedBlockContainer(); - } - @Override public BuilderBidSchema getBuilderBidSchema() { return builderBidSchemaElectra; @@ -226,7 +151,9 @@ public BuilderPayloadSchema getBuilderPayloadSchema() { @Override public BeaconBlockBodyBuilder createBeaconBlockBodyBuilder() { - return new BeaconBlockBodyBuilderElectra(beaconBlockBodySchema, blindedBeaconBlockBodySchema); + return new BeaconBlockBodyBuilderElectra( + getBeaconBlockBodySchema().toVersionElectra().orElseThrow(), + getBlindedBeaconBlockBodySchema().toBlindedVersionElectra().orElseThrow()); } @Override diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsPhase0.java index b37e71b5e9e..d84275d06ab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsPhase0.java @@ -14,7 +14,10 @@ package tech.pegasys.teku.spec.schemas; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.AGGREGATE_AND_PROOF_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BEACON_BLOCK_BODY_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BEACON_BLOCK_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_AGGREGATE_AND_PROOF_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BEACON_BLOCK_SCHEMA; import java.util.Optional; import tech.pegasys.teku.spec.config.SpecConfig; @@ -27,7 +30,6 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodyBuilder; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.phase0.BeaconBlockBodyBuilderPhase0; -import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.phase0.BeaconBlockBodySchemaPhase0; import tech.pegasys.teku.spec.datastructures.networking.libp2p.rpc.metadata.versions.phase0.MetadataMessageSchemaPhase0; import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof.AggregateAndProofSchema; import tech.pegasys.teku.spec.datastructures.operations.Attestation; @@ -47,7 +49,7 @@ public class SchemaDefinitionsPhase0 extends AbstractSchemaDefinitions { private final SignedAggregateAndProofSchema signedAggregateAndProofSchema; private final AggregateAndProofSchema aggregateAndProofSchema; private final BeaconStateSchemaPhase0 beaconStateSchema; - private final BeaconBlockBodySchemaPhase0 beaconBlockBodySchema; + private final BeaconBlockBodySchema beaconBlockBodySchema; private final MetadataMessageSchemaPhase0 metadataMessageSchema; private final BeaconBlockSchema beaconBlockSchema; private final SignedBeaconBlockSchema signedBeaconBlockSchema; @@ -62,16 +64,10 @@ public SchemaDefinitionsPhase0(final SchemaRegistry schemaRegistry) { this.aggregateAndProofSchema = schemaRegistry.get(AGGREGATE_AND_PROOF_SCHEMA); this.signedAggregateAndProofSchema = schemaRegistry.get(SIGNED_AGGREGATE_AND_PROOF_SCHEMA); this.beaconStateSchema = BeaconStateSchemaPhase0.create(specConfig); - this.beaconBlockBodySchema = - BeaconBlockBodySchemaPhase0.create( - specConfig, - getMaxValidatorsPerAttestation(specConfig), - "BeaconBlockBodyPhase0", - schemaRegistry); + this.beaconBlockBodySchema = schemaRegistry.get(BEACON_BLOCK_BODY_SCHEMA); this.metadataMessageSchema = new MetadataMessageSchemaPhase0(specConfig.getNetworkingConfig()); - beaconBlockSchema = new BeaconBlockSchema(beaconBlockBodySchema, "BeaconBlockPhase0"); - signedBeaconBlockSchema = - new SignedBeaconBlockSchema(beaconBlockSchema, "SignedBeaconBlockPhase0"); + this.beaconBlockSchema = schemaRegistry.get(BEACON_BLOCK_SCHEMA); + this.signedBeaconBlockSchema = schemaRegistry.get(SIGNED_BEACON_BLOCK_SCHEMA); } @Override diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaRegistryBuilder.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaRegistryBuilder.java index c3bddc64b5e..951fe0b09a1 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaRegistryBuilder.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaRegistryBuilder.java @@ -14,6 +14,8 @@ package tech.pegasys.teku.spec.schemas.registry; import static com.google.common.base.Preconditions.checkArgument; +import static tech.pegasys.teku.spec.SpecMilestone.ALTAIR; +import static tech.pegasys.teku.spec.SpecMilestone.BELLATRIX; import static tech.pegasys.teku.spec.SpecMilestone.CAPELLA; import static tech.pegasys.teku.spec.SpecMilestone.DENEB; import static tech.pegasys.teku.spec.SpecMilestone.ELECTRA; @@ -24,6 +26,10 @@ import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTESTER_SLASHING_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.ATTNETS_ENR_FIELD_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BEACON_BLOCKS_BY_ROOT_REQUEST_MESSAGE_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BEACON_BLOCK_BODY_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BEACON_BLOCK_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLINDED_BEACON_BLOCK_BODY_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLINDED_BEACON_BLOCK_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOBS_BUNDLE_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOBS_IN_BLOCK_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_KZG_COMMITMENTS_SCHEMA; @@ -31,10 +37,15 @@ import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_SIDECARS_BY_ROOT_REQUEST_MESSAGE_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLOB_SIDECAR_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.BLS_TO_EXECUTION_CHANGE_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_HEADER_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_PAYLOAD_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_REQUESTS_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.HISTORICAL_BATCH_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.HISTORICAL_SUMMARY_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.INDEXED_ATTESTATION_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_AGGREGATE_AND_PROOF_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BEACON_BLOCK_SCHEMA; +import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLINDED_BEACON_BLOCK_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SIGNED_BLS_TO_EXECUTION_CHANGE_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.SYNCNETS_ENR_FIELD_SCHEMA; import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.WITHDRAWAL_SCHEMA; @@ -46,14 +57,36 @@ import tech.pegasys.teku.infrastructure.ssz.schema.collections.SszBitvectorSchema; import tech.pegasys.teku.spec.SpecMilestone; import tech.pegasys.teku.spec.config.SpecConfig; +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.SpecConfigElectra; import tech.pegasys.teku.spec.constants.NetworkConstants; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobKzgCommitmentsSchema; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSchema; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecarSchema; +import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockSchema; import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlockHeader; +import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlockSchema; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.BeaconBlockBodySchemaAltairImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BeaconBlockBodySchemaBellatrixImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BlindedBeaconBlockBodySchemaBellatrixImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella.BeaconBlockBodySchemaCapellaImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.capella.BlindedBeaconBlockBodySchemaCapellaImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BeaconBlockBodySchemaDenebImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BlindedBeaconBlockBodySchemaDenebImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BeaconBlockBodySchemaElectraImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra.BlindedBeaconBlockBodySchemaElectraImpl; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.phase0.BeaconBlockBodySchemaPhase0; import tech.pegasys.teku.spec.datastructures.builder.BlobsBundleSchema; +import tech.pegasys.teku.spec.datastructures.execution.versions.bellatrix.ExecutionPayloadHeaderSchemaBellatrix; +import tech.pegasys.teku.spec.datastructures.execution.versions.bellatrix.ExecutionPayloadSchemaBellatrix; +import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadHeaderSchemaCapella; +import tech.pegasys.teku.spec.datastructures.execution.versions.capella.ExecutionPayloadSchemaCapella; import tech.pegasys.teku.spec.datastructures.execution.versions.capella.WithdrawalSchema; +import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadHeaderSchemaDeneb; +import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadSchemaDeneb; +import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsSchema; import tech.pegasys.teku.spec.datastructures.networking.libp2p.rpc.BeaconBlocksByRootRequestMessage.BeaconBlocksByRootRequestMessageSchema; import tech.pegasys.teku.spec.datastructures.networking.libp2p.rpc.BlobSidecarsByRootRequestMessageSchema; import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof.AggregateAndProofSchema; @@ -86,6 +119,16 @@ public static SchemaRegistryBuilder create() { .addProvider(createAttestationSchemaProvider()) .addProvider(createAggregateAndProofSchemaProvider()) .addProvider(createSignedAggregateAndProofSchemaProvider()) + .addProvider(createBeaconBlockBodySchemaProvider()) + .addProvider(createBeaconBlockSchemaProvider()) + .addProvider(createSignedBeaconBlockSchemaProvider()) + + // BELLATRIX + .addProvider(createExecutionPayloadSchemaProvider()) + .addProvider(createExecutionPayloadHeaderSchemaProvider()) + .addProvider(createBlindedBeaconBlockBodySchemaProvider()) + .addProvider(createBlindedBeaconBlockSchemaProvider()) + .addProvider(createSignedBlindedBeaconBlockSchemaProvider()) // CAPELLA .addProvider(createWithdrawalSchemaProvider()) @@ -99,12 +142,178 @@ public static SchemaRegistryBuilder create() { .addProvider(createBlobsInBlockSchemaProvider()) .addProvider(createBlobSidecarSchemaProvider()) .addProvider(createBlobSidecarsByRootRequestMessageSchemaProvider()) - .addProvider(createBlobsBundleSchemaProvider()); + .addProvider(createBlobsBundleSchemaProvider()) + + // ELECTRA + .addProvider(createExecutionRequestsSchemaProvider()); + } + + private static SchemaProvider createBlindedBeaconBlockSchemaProvider() { + return providerBuilder(BLINDED_BEACON_BLOCK_SCHEMA) + .withCreator( + BELLATRIX, + (registry, specConfig) -> + new BeaconBlockSchema( + registry.get(BLINDED_BEACON_BLOCK_BODY_SCHEMA), + BLINDED_BEACON_BLOCK_SCHEMA.getContainerName(registry))) + .build(); + } + + private static SchemaProvider createSignedBlindedBeaconBlockSchemaProvider() { + return providerBuilder(SIGNED_BLINDED_BEACON_BLOCK_SCHEMA) + .withCreator( + BELLATRIX, + (registry, specConfig) -> + new SignedBeaconBlockSchema( + registry.get(BLINDED_BEACON_BLOCK_SCHEMA), + SIGNED_BLINDED_BEACON_BLOCK_SCHEMA.getContainerName(registry))) + .build(); + } + + private static SchemaProvider createBeaconBlockSchemaProvider() { + return providerBuilder(BEACON_BLOCK_SCHEMA) + .withCreator( + PHASE0, + (registry, specConfig) -> + new BeaconBlockSchema( + registry.get(BEACON_BLOCK_BODY_SCHEMA), + BEACON_BLOCK_SCHEMA.getContainerName(registry))) + .build(); + } + + private static SchemaProvider createSignedBeaconBlockSchemaProvider() { + return providerBuilder(SIGNED_BEACON_BLOCK_SCHEMA) + .withCreator( + PHASE0, + (registry, specConfig) -> + new SignedBeaconBlockSchema( + registry.get(BEACON_BLOCK_SCHEMA), + SIGNED_BEACON_BLOCK_SCHEMA.getContainerName(registry))) + .build(); + } + + private static SchemaProvider createExecutionRequestsSchemaProvider() { + return providerBuilder(EXECUTION_REQUESTS_SCHEMA) + .withCreator( + ELECTRA, + (registry, specConfig) -> + new ExecutionRequestsSchema(SpecConfigElectra.required(specConfig))) + .build(); + } + + private static SchemaProvider createBlindedBeaconBlockBodySchemaProvider() { + return providerBuilder(BLINDED_BEACON_BLOCK_BODY_SCHEMA) + .withCreator( + BELLATRIX, + (registry, specConfig) -> + BlindedBeaconBlockBodySchemaBellatrixImpl.create( + SpecConfigBellatrix.required(specConfig), + BLINDED_BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .withCreator( + CAPELLA, + (registry, specConfig) -> + BlindedBeaconBlockBodySchemaCapellaImpl.create( + SpecConfigCapella.required(specConfig), + BLINDED_BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .withCreator( + DENEB, + (registry, specConfig) -> + BlindedBeaconBlockBodySchemaDenebImpl.create( + SpecConfigDeneb.required(specConfig), + BLINDED_BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .withCreator( + ELECTRA, + (registry, specConfig) -> + BlindedBeaconBlockBodySchemaElectraImpl.create( + SpecConfigElectra.required(specConfig), + BLINDED_BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .build(); + } + + private static SchemaProvider createBeaconBlockBodySchemaProvider() { + return providerBuilder(BEACON_BLOCK_BODY_SCHEMA) + .withCreator( + PHASE0, + (registry, specConfig) -> + BeaconBlockBodySchemaPhase0.create( + specConfig, BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), registry)) + .withCreator( + ALTAIR, + (registry, specConfig) -> + BeaconBlockBodySchemaAltairImpl.create( + specConfig, BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), registry)) + .withCreator( + BELLATRIX, + (registry, specConfig) -> + BeaconBlockBodySchemaBellatrixImpl.create( + SpecConfigBellatrix.required(specConfig), + BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .withCreator( + CAPELLA, + (registry, specConfig) -> + BeaconBlockBodySchemaCapellaImpl.create( + SpecConfigCapella.required(specConfig), + BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .withCreator( + DENEB, + (registry, specConfig) -> + BeaconBlockBodySchemaDenebImpl.create( + SpecConfigDeneb.required(specConfig), + BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .withCreator( + ELECTRA, + (registry, specConfig) -> + BeaconBlockBodySchemaElectraImpl.create( + SpecConfigElectra.required(specConfig), + BEACON_BLOCK_BODY_SCHEMA.getContainerName(registry), + registry)) + .build(); + } + + private static SchemaProvider createExecutionPayloadHeaderSchemaProvider() { + return providerBuilder(EXECUTION_PAYLOAD_HEADER_SCHEMA) + .withCreator( + BELLATRIX, + (registry, specConfig) -> + new ExecutionPayloadHeaderSchemaBellatrix(SpecConfigBellatrix.required(specConfig))) + .withCreator( + CAPELLA, + (registry, specConfig) -> + new ExecutionPayloadHeaderSchemaCapella(SpecConfigCapella.required(specConfig))) + .withCreator( + DENEB, + (registry, specConfig) -> + new ExecutionPayloadHeaderSchemaDeneb(SpecConfigDeneb.required(specConfig))) + // ELECTRA is same as DENEB + .build(); + } + + private static SchemaProvider createExecutionPayloadSchemaProvider() { + return providerBuilder(EXECUTION_PAYLOAD_SCHEMA) + .withCreator( + BELLATRIX, + (registry, specConfig) -> + new ExecutionPayloadSchemaBellatrix(SpecConfigBellatrix.required(specConfig))) + .withCreator( + CAPELLA, + (registry, specConfig) -> + new ExecutionPayloadSchemaCapella(SpecConfigCapella.required(specConfig))) + .withCreator( + DENEB, + (registry, specConfig) -> + new ExecutionPayloadSchemaDeneb(SpecConfigDeneb.required(specConfig))) + // ELECTRA is same as DENEB + .build(); } private static SchemaProvider createBlobsBundleSchemaProvider() { - // we can keep this to be constant because the blob list max length is - // getMaxBlobCommitmentsPerBlock return providerBuilder(BLOBS_BUNDLE_SCHEMA) .withCreator( DENEB, @@ -114,8 +323,6 @@ private static SchemaProvider createBlobsBundleSchemaProvider() { } private static SchemaProvider createBlobKzgCommitmentsSchemaProvider() { - // we can keep this to be constant because the kzg commitment list max length is - // getMaxBlobCommitmentsPerBlock return providerBuilder(BLOB_KZG_COMMITMENTS_SCHEMA) .withCreator( DENEB, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaTypes.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaTypes.java index a98b803f30a..7fa104312d1 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaTypes.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaTypes.java @@ -27,12 +27,21 @@ import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobKzgCommitmentsSchema; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSchema; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecarSchema; +import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockSchema; +import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlockSchema; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBodySchema; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BlindedBeaconBlockBodyBellatrix; +import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.bellatrix.BlindedBeaconBlockBodySchemaBellatrix; import tech.pegasys.teku.spec.datastructures.blocks.versions.deneb.BlockContentsSchema; import tech.pegasys.teku.spec.datastructures.blocks.versions.deneb.SignedBlockContentsSchema; import tech.pegasys.teku.spec.datastructures.builder.BlobsBundleSchema; +import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeaderSchema; +import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema; import tech.pegasys.teku.spec.datastructures.execution.versions.capella.WithdrawalSchema; +import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsSchema; import tech.pegasys.teku.spec.datastructures.networking.libp2p.rpc.BeaconBlocksByRootRequestMessage.BeaconBlocksByRootRequestMessageSchema; import tech.pegasys.teku.spec.datastructures.networking.libp2p.rpc.BlobSidecarsByRootRequestMessageSchema; import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof.AggregateAndProofSchema; @@ -73,16 +82,32 @@ public class SchemaTypes { public static final SchemaId SIGNED_AGGREGATE_AND_PROOF_SCHEMA = create("SIGNED_AGGREGATE_AND_PROOF_SCHEMA"); + public static final SchemaId> + BEACON_BLOCK_BODY_SCHEMA = create("BEACON_BLOCK_BODY_SCHEMA"); + public static final SchemaId BEACON_BLOCK_SCHEMA = + create("BEACON_BLOCK_SCHEMA"); + public static final SchemaId SIGNED_BEACON_BLOCK_SCHEMA = + create("SIGNED_BEACON_BLOCK_SCHEMA"); + public static final SchemaId> BEACON_STATE_SCHEMA = create("BEACON_STATE_SCHEMA"); // Altair // Bellatrix - + public static final SchemaId> + EXECUTION_PAYLOAD_SCHEMA = create("EXECUTION_PAYLOAD_SCHEMA"); public static final SchemaId> EXECUTION_PAYLOAD_HEADER_SCHEMA = create("EXECUTION_PAYLOAD_HEADER_SCHEMA"); + public static final SchemaId BLINDED_BEACON_BLOCK_SCHEMA = + create("BLINDED_BEACON_BLOCK_SCHEMA"); + public static final SchemaId< + BlindedBeaconBlockBodySchemaBellatrix> + BLINDED_BEACON_BLOCK_BODY_SCHEMA = create("BLINDED_BEACON_BLOCK_BODY_SCHEMA"); + public static final SchemaId SIGNED_BLINDED_BEACON_BLOCK_SCHEMA = + create("SIGNED_BLINDED_BEACON_BLOCK_SCHEMA"); + // Capella public static final SchemaId WITHDRAWAL_SCHEMA = create("WITHDRAWAL_SCHEMA"); public static final SchemaId BLS_TO_EXECUTION_CHANGE_SCHEMA = @@ -110,6 +135,11 @@ public class SchemaTypes { public static final SchemaId BLOBS_BUNDLE_SCHEMA = create("BLOBS_BUNDLE_SCHEMA"); + // Electra + + public static final SchemaId EXECUTION_REQUESTS_SCHEMA = + create("EXECUTION_REQUESTS_SCHEMA"); + private SchemaTypes() { // Prevent instantiation } diff --git a/ethereum/spec/src/test/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0Test.java b/ethereum/spec/src/test/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0Test.java index c1613970362..8db06f2ca5f 100644 --- a/ethereum/spec/src/test/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0Test.java +++ b/ethereum/spec/src/test/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0Test.java @@ -29,13 +29,11 @@ public void create_minimal() { final BeaconBlockBodySchemaPhase0 specA = BeaconBlockBodySchemaPhase0.create( specConfig, - specConfig.getMaxValidatorsPerCommittee(), "BeaconBlockBodyPhase0", spec.getGenesisSchemaDefinitions().getSchemaRegistry()); final BeaconBlockBodySchemaPhase0 specB = BeaconBlockBodySchemaPhase0.create( specConfig, - specConfig.getMaxValidatorsPerCommittee(), "BeaconBlockBodyPhase0", spec.getGenesisSchemaDefinitions().getSchemaRegistry()); @@ -49,13 +47,11 @@ public void create_mainnet() { final BeaconBlockBodySchemaPhase0 specA = BeaconBlockBodySchemaPhase0.create( specConfig, - specConfig.getMaxValidatorsPerCommittee(), "BeaconBlockBodyPhase0", spec.getGenesisSchemaDefinitions().getSchemaRegistry()); final BeaconBlockBodySchemaPhase0 specB = BeaconBlockBodySchemaPhase0.create( specConfig, - specConfig.getMaxValidatorsPerCommittee(), "BeaconBlockBodyPhase0", spec.getGenesisSchemaDefinitions().getSchemaRegistry());