Skip to content

Commit

Permalink
Rebase on master changes
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 30, 2024
1 parent fec2b70 commit a2765a4
Show file tree
Hide file tree
Showing 23 changed files with 151 additions and 385 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadContext;
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadResult;
import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsBuilderElectra;
import tech.pegasys.teku.spec.datastructures.execution.versions.eip7732.ExecutionPayloadHeaderEip7732;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsBuilderElectra;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing;
import tech.pegasys.teku.spec.datastructures.operations.ProposerSlashing;
Expand All @@ -66,7 +66,6 @@
import tech.pegasys.teku.spec.schemas.SchemaDefinitions;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsBellatrix;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsDeneb;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsEip7732;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsElectra;
import tech.pegasys.teku.statetransition.OperationPool;
import tech.pegasys.teku.statetransition.attestation.AggregatingAttestationPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public Boolean supportsKzgCommitments() {
return false;
}

@Override
public boolean supportsExecutionRequests() {
return false;
}

@Override
public Boolean supportsSignedExecutionPayloadHeader() {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSummary;
import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader;
import tech.pegasys.teku.spec.datastructures.execution.versions.eip7732.ExecutionPayloadEip7732;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests;
import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestation;
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;

Expand Down Expand Up @@ -75,6 +76,11 @@ default SszList<SszKZGCommitment> getBlobKzgCommitments() {
throw new UnsupportedOperationException("BlobKzgCommitments removed in Eip7732");
}

@Override
default ExecutionRequests getExecutionRequests() {
throw new UnsupportedOperationException("ExecutionRequests removed in Eip7732");
}

@Override
default Optional<BeaconBlockBodyEip7732> toVersionEip7732() {
return Optional.of(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema;
import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader;
import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeaderSchema;
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.AttesterSlashing.AttesterSlashingSchema;
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 Down Expand Up @@ -98,7 +99,7 @@ protected BeaconBlockBodySchemaEip7732Impl(

public static BeaconBlockBodySchemaEip7732Impl create(
final SpecConfigEip7732 specConfig,
final AttesterSlashingSchema attesterSlashingSchema,
final AttesterSlashingSchema<?> attesterSlashingSchema,
final SignedBlsToExecutionChangeSchema blsToExecutionChangeSchema,
final long maxValidatorsPerAttestation,
final ExecutionPayloadHeaderSchema<?> executionPayloadHeaderSchema,
Expand All @@ -116,7 +117,8 @@ public static BeaconBlockBodySchemaEip7732Impl create(
namedSchema(
BlockBodyFields.ATTESTER_SLASHINGS,
SszListSchema.create(
attesterSlashingSchema, specConfig.getMaxAttesterSlashingsElectra())),
attesterSlashingSchema.castTypeToAttesterSlashingSchema(),
specConfig.getMaxAttesterSlashingsElectra())),
namedSchema(
BlockBodyFields.ATTESTATIONS,
SszListSchema.create(
Expand Down Expand Up @@ -249,4 +251,9 @@ public SignedExecutionPayloadHeaderSchema getSignedExecutionPayloadHeaderSchema(
return (SszListSchema<PayloadAttestation, ?>)
getChildSchema(getFieldIndex(BlockBodyFields.PAYLOAD_ATTESTATIONS));
}

@Override
public ExecutionRequestsSchema getExecutionRequestsSchema() {
throw new UnsupportedOperationException("ExecutionRequests removed in Eip7732");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeaderSchema;
import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader;
import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeaderSchema;
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.AttesterSlashing.AttesterSlashingSchema;
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 Down Expand Up @@ -96,7 +97,7 @@ protected BlindedBeaconBlockBodySchemaEip7732Impl(

public static BlindedBeaconBlockBodySchemaEip7732Impl create(
final SpecConfigEip7732 specConfig,
final AttesterSlashingSchema attesterSlashingSchema,
final AttesterSlashingSchema<?> attesterSlashingSchema,
final SignedBlsToExecutionChangeSchema blsToExecutionChangeSchema,
final long maxValidatorsPerAttestation,
final ExecutionPayloadHeaderSchema<?> executionPayloadHeaderSchema,
Expand All @@ -114,7 +115,8 @@ public static BlindedBeaconBlockBodySchemaEip7732Impl create(
namedSchema(
BlockBodyFields.ATTESTER_SLASHINGS,
SszListSchema.create(
attesterSlashingSchema, specConfig.getMaxAttesterSlashingsElectra())),
attesterSlashingSchema.castTypeToAttesterSlashingSchema(),
specConfig.getMaxAttesterSlashingsElectra())),
namedSchema(
BlockBodyFields.ATTESTATIONS,
SszListSchema.create(
Expand Down Expand Up @@ -229,4 +231,9 @@ public ExecutionPayloadHeaderSchema<?> getExecutionPayloadHeaderSchema() {
getChildSchema(getFieldIndex(BlockBodyFields.SIGNED_EXECUTION_PAYLOAD_HEADER)))
.getMessageSchema();
}

@Override
public ExecutionRequestsSchema getExecutionRequestsSchema() {
throw new UnsupportedOperationException("ExecutionRequests removed in Eip7732");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
import tech.pegasys.teku.spec.datastructures.builder.BuilderPayloadSchema;
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.electra.ConsolidationRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ConsolidationRequestSchema;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequestSchema;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequestSchema;

public interface ExecutionPayloadSchema<T extends ExecutionPayload>
extends SszContainerSchema<T>, BuilderPayloadSchema<T> {
Expand All @@ -41,21 +35,6 @@ public interface ExecutionPayloadSchema<T extends ExecutionPayload>

WithdrawalSchema getWithdrawalSchemaRequired();

SszListSchema<DepositRequest, ? extends SszList<DepositRequest>>
getDepositRequestsSchemaRequired();

DepositRequestSchema getDepositRequestSchemaRequired();

SszListSchema<WithdrawalRequest, ? extends SszList<WithdrawalRequest>>
getWithdrawalRequestsSchemaRequired();

WithdrawalRequestSchema getWithdrawalRequestSchemaRequired();

ConsolidationRequestSchema getConsolidationRequestSchemaRequired();

SszListSchema<ConsolidationRequest, ? extends SszList<ConsolidationRequest>>
getConsolidationRequestsSchemaRequired();

LongList getBlindedNodeGeneralizedIndices();

ExecutionPayload createExecutionPayload(Consumer<ExecutionPayloadBuilder> builderConsumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
import tech.pegasys.teku.spec.datastructures.execution.TransactionSchema;
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.electra.ConsolidationRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ConsolidationRequestSchema;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequestSchema;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequestSchema;

public class ExecutionPayloadSchemaBellatrix
extends ContainerSchema14<
Expand Down Expand Up @@ -118,41 +112,6 @@ public WithdrawalSchema getWithdrawalSchemaRequired() {
throw new IllegalStateException("Attempted to get a withdrawal schema from bellatrix");
}

@Override
public SszListSchema<DepositRequest, ? extends SszList<DepositRequest>>
getDepositRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get a deposit requests schema from bellatrix");
}

@Override
public DepositRequestSchema getDepositRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a deposit request schema from bellatrix");
}

@Override
public SszListSchema<WithdrawalRequest, ? extends SszList<WithdrawalRequest>>
getWithdrawalRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get withdrawal requests schema from bellatrix");
}

@Override
public WithdrawalRequestSchema getWithdrawalRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a withdrawal request schema from bellatrix");
}

@Override
public SszListSchema<ConsolidationRequest, ? extends SszList<ConsolidationRequest>>
getConsolidationRequestsSchemaRequired() {
throw new IllegalStateException(
"Attempted to get consolidation requests schema from bellatrix");
}

@Override
public ConsolidationRequestSchema getConsolidationRequestSchemaRequired() {
throw new IllegalStateException(
"Attempted to get a consolidation request schema from bellatrix");
}

@Override
public LongList getBlindedNodeGeneralizedIndices() {
return LongList.of(getChildGeneralizedIndex(getFieldIndex(TRANSACTIONS)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSchema;
import tech.pegasys.teku.spec.datastructures.execution.Transaction;
import tech.pegasys.teku.spec.datastructures.execution.TransactionSchema;
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;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequestSchema;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequestSchema;

public class ExecutionPayloadSchemaCapella
extends ContainerSchema15<
Expand Down Expand Up @@ -125,39 +119,6 @@ public WithdrawalSchema getWithdrawalSchemaRequired() {
return getWithdrawalSchema();
}

@Override
public SszListSchema<DepositRequest, ? extends SszList<DepositRequest>>
getDepositRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get a deposit requests schema from capella");
}

@Override
public DepositRequestSchema getDepositRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a deposit request schema from capella");
}

@Override
public SszListSchema<WithdrawalRequest, ? extends SszList<WithdrawalRequest>>
getWithdrawalRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get withdrawal requests schema from capella");
}

@Override
public WithdrawalRequestSchema getWithdrawalRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a withdrawal request schema from capella");
}

@Override
public ConsolidationRequestSchema getConsolidationRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a consolidation request schema from capella");
}

@Override
public SszListSchema<ConsolidationRequest, ? extends SszList<ConsolidationRequest>>
getConsolidationRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get consolidation requests schema from capella");
}

public WithdrawalSchema getWithdrawalSchema() {
return (WithdrawalSchema) getWithdrawalsSchema().getElementSchema();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@
import tech.pegasys.teku.spec.datastructures.execution.TransactionSchema;
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.electra.ConsolidationRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ConsolidationRequestSchema;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequestSchema;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequest;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequestSchema;

public class ExecutionPayloadSchemaDeneb
extends ContainerSchema17<
Expand Down Expand Up @@ -133,39 +127,6 @@ public WithdrawalSchema getWithdrawalSchemaRequired() {
return getWithdrawalSchema();
}

@Override
public SszListSchema<DepositRequest, ? extends SszList<DepositRequest>>
getDepositRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get a deposit requests schema from deneb");
}

@Override
public DepositRequestSchema getDepositRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a deposit request schema from deneb");
}

@Override
public SszListSchema<WithdrawalRequest, ? extends SszList<WithdrawalRequest>>
getWithdrawalRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get withdrawal requests schema from deneb");
}

@Override
public WithdrawalRequestSchema getWithdrawalRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a withdrawal request schema from deneb");
}

@Override
public ConsolidationRequestSchema getConsolidationRequestSchemaRequired() {
throw new IllegalStateException("Attempted to get a consolidation request schema from deneb");
}

@Override
public SszListSchema<ConsolidationRequest, ? extends SszList<ConsolidationRequest>>
getConsolidationRequestsSchemaRequired() {
throw new IllegalStateException("Attempted to get consolidation requests schema from deneb");
}

public WithdrawalSchema getWithdrawalSchema() {
return (WithdrawalSchema) getWithdrawalsSchema().getElementSchema();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt256;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionPayloadBuilderElectra;
import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadBuilderDeneb;

public class ExecutionPayloadBuilderEip7732 extends ExecutionPayloadBuilderElectra {
public class ExecutionPayloadBuilderEip7732 extends ExecutionPayloadBuilderDeneb {
private ExecutionPayloadSchemaEip7732 schema;

public ExecutionPayloadBuilderEip7732 schema(final ExecutionPayloadSchemaEip7732 schema) {
Expand Down Expand Up @@ -63,9 +63,6 @@ public ExecutionPayload build() {
.collect(schema.getTransactionsSchema().collector()),
schema.getWithdrawalsSchema().createFromElements(withdrawals),
SszUInt64.of(blobGasUsed),
SszUInt64.of(excessBlobGas),
schema.getDepositRequestsSchema().createFromElements(depositRequests),
schema.getWithdrawalRequestsSchema().createFromElements(withdrawalRequests),
schema.getConsolidationRequestsSchema().createFromElements(consolidationRequests));
SszUInt64.of(excessBlobGas));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import java.util.Optional;
import tech.pegasys.teku.spec.SpecMilestone;
import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionPayloadElectra;
import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadDeneb;

public interface ExecutionPayloadEip7732 extends ExecutionPayload, ExecutionPayloadElectra {
public interface ExecutionPayloadEip7732 extends ExecutionPayload, ExecutionPayloadDeneb {

static ExecutionPayloadEip7732 required(final ExecutionPayload payload) {
return payload
Expand Down
Loading

0 comments on commit a2765a4

Please sign in to comment.