Skip to content

Commit

Permalink
Rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Oct 21, 2024
1 parent 5cdcc94 commit 9e1fe74
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsSchema;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashingSchema;
import tech.pegasys.teku.spec.datastructures.operations.Deposit;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestation;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestationSchema;
Expand All @@ -49,6 +48,8 @@
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 BeaconBlockBodySchemaEip7732Impl
extends ContainerSchema12<
Expand Down Expand Up @@ -99,12 +100,12 @@ protected BeaconBlockBodySchemaEip7732Impl(

public static BeaconBlockBodySchemaEip7732Impl create(
final SpecConfigEip7732 specConfig,
final AttesterSlashingSchema<?> attesterSlashingSchema,
final SignedBlsToExecutionChangeSchema blsToExecutionChangeSchema,
final long maxValidatorsPerAttestation,
final ExecutionPayloadHeaderSchema<?> executionPayloadHeaderSchema,
final PayloadAttestationSchema payloadAttestationSchema,
final String containerName) {
final String containerName,
final SchemaRegistry schemaRegistry) {
return new BeaconBlockBodySchemaEip7732Impl(
containerName,
namedSchema(BlockBodyFields.RANDAO_REVEAL, SszSignatureSchema.INSTANCE),
Expand All @@ -117,7 +118,7 @@ public static BeaconBlockBodySchemaEip7732Impl create(
namedSchema(
BlockBodyFields.ATTESTER_SLASHINGS,
SszListSchema.create(
attesterSlashingSchema.castTypeToAttesterSlashingSchema(),
schemaRegistry.get(SchemaTypes.ATTESTER_SLASHING_SCHEMA),
specConfig.getMaxAttesterSlashingsElectra())),
namedSchema(
BlockBodyFields.ATTESTATIONS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsSchema;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashingSchema;
import tech.pegasys.teku.spec.datastructures.operations.Deposit;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestation;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestationSchema;
Expand All @@ -47,6 +46,8 @@
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 BlindedBeaconBlockBodySchemaEip7732Impl
extends ContainerSchema12<
Expand Down Expand Up @@ -97,12 +98,12 @@ protected BlindedBeaconBlockBodySchemaEip7732Impl(

public static BlindedBeaconBlockBodySchemaEip7732Impl create(
final SpecConfigEip7732 specConfig,
final AttesterSlashingSchema<?> attesterSlashingSchema,
final SignedBlsToExecutionChangeSchema blsToExecutionChangeSchema,
final long maxValidatorsPerAttestation,
final ExecutionPayloadHeaderSchema<?> executionPayloadHeaderSchema,
final PayloadAttestationSchema payloadAttestationSchema,
final String containerName) {
final String containerName,
final SchemaRegistry schemaRegistry) {
return new BlindedBeaconBlockBodySchemaEip7732Impl(
containerName,
namedSchema(BlockBodyFields.RANDAO_REVEAL, SszSignatureSchema.INSTANCE),
Expand All @@ -115,7 +116,7 @@ public static BlindedBeaconBlockBodySchemaEip7732Impl create(
namedSchema(
BlockBodyFields.ATTESTER_SLASHINGS,
SszListSchema.create(
attesterSlashingSchema.castTypeToAttesterSlashingSchema(),
schemaRegistry.get(SchemaTypes.ATTESTER_SLASHING_SCHEMA),
specConfig.getMaxAttesterSlashingsElectra())),
namedSchema(
BlockBodyFields.ATTESTATIONS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,11 @@
import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof.AggregateAndProofSchema;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.AttestationSchema;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashingSchema;
import tech.pegasys.teku.spec.datastructures.operations.IndexedAttestation;
import tech.pegasys.teku.spec.datastructures.operations.IndexedAttestationSchema;
import tech.pegasys.teku.spec.datastructures.operations.IndexedPayloadAttestationSchema;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestation;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestationMessageSchema;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestationSchema;
import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof.SignedAggregateAndProofSchema;
import tech.pegasys.teku.spec.datastructures.operations.versions.electra.AttesterSlashingElectraSchema;
import tech.pegasys.teku.spec.datastructures.operations.versions.electra.IndexedAttestationElectraSchema;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconStateSchema;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.eip7732.BeaconStateEip7732;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.eip7732.BeaconStateSchemaEip7732;
Expand All @@ -67,8 +61,6 @@
import tech.pegasys.teku.spec.schemas.registry.SchemaTypes;

public class SchemaDefinitionsEip7732 extends SchemaDefinitionsElectra {
private final IndexedAttestationSchema<IndexedAttestation> indexedAttestationSchema;
private final AttesterSlashingSchema<AttesterSlashing> attesterSlashingSchema;
private final AttestationSchema<Attestation> attestationSchema;
private final SignedAggregateAndProofSchema signedAggregateAndProofSchema;
private final AggregateAndProofSchema aggregateAndProofSchema;
Expand Down Expand Up @@ -108,12 +100,6 @@ public SchemaDefinitionsEip7732(final SchemaRegistry schemaRegistry) {
final SpecConfigEip7732 specConfig = SpecConfigEip7732.required(schemaRegistry.getSpecConfig());

final long maxValidatorsPerAttestation = getMaxValidatorPerAttestation(specConfig);
this.indexedAttestationSchema =
new IndexedAttestationElectraSchema(maxValidatorsPerAttestation)
.castTypeToIndexedAttestationSchema();
this.attesterSlashingSchema =
new AttesterSlashingElectraSchema(indexedAttestationSchema)
.castTypeToAttesterSlashingSchema();

this.attestationSchema = schemaRegistry.get(SchemaTypes.ATTESTATION_SCHEMA);
this.aggregateAndProofSchema = new AggregateAndProofSchema(attestationSchema);
Expand All @@ -127,21 +113,21 @@ public SchemaDefinitionsEip7732(final SchemaRegistry schemaRegistry) {
this.beaconBlockBodySchema =
BeaconBlockBodySchemaEip7732Impl.create(
specConfig,
attesterSlashingSchema,
getSignedBlsToExecutionChangeSchema(),
maxValidatorsPerAttestation,
executionPayloadHeaderSchemaEip7732,
payloadAttestationSchema,
"BeaconBlockBodyEip7732");
"BeaconBlockBodyEip7732",
schemaRegistry);
this.blindedBeaconBlockBodySchema =
BlindedBeaconBlockBodySchemaEip7732Impl.create(
specConfig,
attesterSlashingSchema,
getSignedBlsToExecutionChangeSchema(),
maxValidatorsPerAttestation,
executionPayloadHeaderSchemaEip7732,
payloadAttestationSchema,
"BlindedBlockBodyEip7732");
"BlindedBlockBodyEip7732",
schemaRegistry);
this.beaconBlockSchema = new BeaconBlockSchema(beaconBlockBodySchema, "BeaconBlockEip7732");
this.blindedBeaconBlockSchema =
new BeaconBlockSchema(blindedBeaconBlockBodySchema, "BlindedBlockEip7732");
Expand Down Expand Up @@ -219,16 +205,6 @@ public AttestationSchema<Attestation> getAttestationSchema() {
return attestationSchema;
}

@Override
public IndexedAttestationSchema<IndexedAttestation> getIndexedAttestationSchema() {
return indexedAttestationSchema;
}

@Override
public AttesterSlashingSchema<AttesterSlashing> getAttesterSlashingSchema() {
return attesterSlashingSchema;
}

@Override
public BeaconStateSchema<? extends BeaconStateEip7732, ? extends MutableBeaconStateEip7732>
getBeaconStateSchema() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public SchemaDefinitionsElectra(final SchemaRegistry schemaRegistry) {
this.builderBidSchemaElectra =
new BuilderBidSchemaElectra(
"BuilderBidElectra",
getExecutionPayloadHeaderSchema(),
super.getExecutionPayloadHeaderSchema(),
getBlobKzgCommitmentsSchema(),
executionRequestsSchema);
this.signedBuilderBidSchemaElectra =
Expand Down

0 comments on commit 9e1fe74

Please sign in to comment.