Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title" : "BlindedBlockCapella",
"title" : "BlindedBeaconBlockBellatrix",
"type" : "object",
"required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ],
"properties" : {
Expand Down Expand Up @@ -28,7 +28,7 @@
"format" : "byte"
},
"body" : {
"$ref" : "#/components/schemas/BlindedBlockBodyCapella"
"$ref" : "#/components/schemas/BlindedBeaconBlockBodyBellatrix"
}
}
}
Original file line number Diff line number Diff line change
@@ -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" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -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" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -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" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -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" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title" : "BlindedBlockElectra",
"title" : "BlindedBeaconBlockCapella",
"type" : "object",
"required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ],
"properties" : {
Expand Down Expand Up @@ -28,7 +28,7 @@
"format" : "byte"
},
"body" : {
"$ref" : "#/components/schemas/BlindedBlockBodyElectra"
"$ref" : "#/components/schemas/BlindedBeaconBlockBodyCapella"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title" : "BlindedBlockBellatrix",
"title" : "BlindedBeaconBlockDeneb",
"type" : "object",
"required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ],
"properties" : {
Expand Down Expand Up @@ -28,7 +28,7 @@
"format" : "byte"
},
"body" : {
"$ref" : "#/components/schemas/BlindedBlockBodyBellatrix"
"$ref" : "#/components/schemas/BlindedBeaconBlockBodyDeneb"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title" : "BlindedBlockDeneb",
"title" : "BlindedBeaconBlockElectra",
"type" : "object",
"required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ],
"properties" : {
Expand Down Expand Up @@ -28,7 +28,7 @@
"format" : "byte"
},
"body" : {
"$ref" : "#/components/schemas/BlindedBlockBodyDeneb"
"$ref" : "#/components/schemas/BlindedBeaconBlockBodyElectra"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
} ]
}
}
}
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ void shouldCreateOneOfBlindedBlockDefinition() throws Exception {
.containsOnly(
"#/components/schemas/BeaconBlockPhase0",
"#/components/schemas/BeaconBlockAltair",
"#/components/schemas/BlindedBlockBellatrix");
"#/components/schemas/BlindedBeaconBlockBellatrix");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,6 +74,22 @@ default Optional<BeaconBlockBodySchemaElectra<?>> toVersionElectra() {
return Optional.empty();
}

default Optional<BlindedBeaconBlockBodySchemaBellatrix<?>> toBlindedVersionBellatrix() {
return Optional.empty();
}

default Optional<BlindedBeaconBlockBodySchemaCapella<?>> toBlindedVersionCapella() {
return Optional.empty();
}

default Optional<BlindedBeaconBlockBodySchemaDeneb<?>> toBlindedVersionDeneb() {
return Optional.empty();
}

default Optional<BlindedBeaconBlockBodySchemaElectra<?>> toBlindedVersionElectra() {
return Optional.empty();
}

/**
* getBlindedNodeGeneralizedIndices
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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(
Expand All @@ -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())),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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),
Expand All @@ -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,
Expand All @@ -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
Expand Down
Loading