diff --git a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java index 31f4e777fc1..7673c8a4594 100644 --- a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java +++ b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java @@ -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; @@ -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; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java index deae9ed6326..a8bfabefe9d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java @@ -46,6 +46,11 @@ public Boolean supportsKzgCommitments() { return false; } + @Override + public boolean supportsExecutionRequests() { + return false; + } + @Override public Boolean supportsSignedExecutionPayloadHeader() { return true; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyEip7732.java index 6fb57967995..217394a432d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyEip7732.java @@ -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; @@ -75,6 +76,11 @@ default SszList getBlobKzgCommitments() { throw new UnsupportedOperationException("BlobKzgCommitments removed in Eip7732"); } + @Override + default ExecutionRequests getExecutionRequests() { + throw new UnsupportedOperationException("ExecutionRequests removed in Eip7732"); + } + @Override default Optional toVersionEip7732() { return Optional.of(this); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodySchemaEip7732Impl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodySchemaEip7732Impl.java index 929e9b3e985..4039c9831f5 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodySchemaEip7732Impl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodySchemaEip7732Impl.java @@ -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; @@ -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, @@ -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( @@ -249,4 +251,9 @@ public SignedExecutionPayloadHeaderSchema getSignedExecutionPayloadHeaderSchema( return (SszListSchema) getChildSchema(getFieldIndex(BlockBodyFields.PAYLOAD_ATTESTATIONS)); } + + @Override + public ExecutionRequestsSchema getExecutionRequestsSchema() { + throw new UnsupportedOperationException("ExecutionRequests removed in Eip7732"); + } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BlindedBeaconBlockBodySchemaEip7732Impl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BlindedBeaconBlockBodySchemaEip7732Impl.java index 3255968de98..207b6ec8756 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BlindedBeaconBlockBodySchemaEip7732Impl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BlindedBeaconBlockBodySchemaEip7732Impl.java @@ -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; @@ -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, @@ -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( @@ -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"); + } } 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..a7fb9238aa5 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 @@ -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 extends SszContainerSchema, BuilderPayloadSchema { @@ -41,21 +35,6 @@ public interface ExecutionPayloadSchema WithdrawalSchema getWithdrawalSchemaRequired(); - SszListSchema> - getDepositRequestsSchemaRequired(); - - DepositRequestSchema getDepositRequestSchemaRequired(); - - SszListSchema> - getWithdrawalRequestsSchemaRequired(); - - WithdrawalRequestSchema getWithdrawalRequestSchemaRequired(); - - ConsolidationRequestSchema getConsolidationRequestSchemaRequired(); - - SszListSchema> - getConsolidationRequestsSchemaRequired(); - LongList getBlindedNodeGeneralizedIndices(); ExecutionPayload createExecutionPayload(Consumer builderConsumer); 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..e69c084ba39 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 @@ -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< @@ -118,41 +112,6 @@ public WithdrawalSchema getWithdrawalSchemaRequired() { throw new IllegalStateException("Attempted to get a withdrawal schema from bellatrix"); } - @Override - public SszListSchema> - 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> - 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> - 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))); 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..004bbd10fd0 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 @@ -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< @@ -125,39 +119,6 @@ public WithdrawalSchema getWithdrawalSchemaRequired() { return getWithdrawalSchema(); } - @Override - public SszListSchema> - 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> - 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> - getConsolidationRequestsSchemaRequired() { - throw new IllegalStateException("Attempted to get consolidation requests schema from capella"); - } - public WithdrawalSchema getWithdrawalSchema() { return (WithdrawalSchema) getWithdrawalsSchema().getElementSchema(); } 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..0f909dc564e 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 @@ -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< @@ -133,39 +127,6 @@ public WithdrawalSchema getWithdrawalSchemaRequired() { return getWithdrawalSchema(); } - @Override - public SszListSchema> - 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> - 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> - getConsolidationRequestsSchemaRequired() { - throw new IllegalStateException("Attempted to get consolidation requests schema from deneb"); - } - public WithdrawalSchema getWithdrawalSchema() { return (WithdrawalSchema) getWithdrawalsSchema().getElementSchema(); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadBuilderEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadBuilderEip7732.java index c0a7e764324..2d79c6b4535 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadBuilderEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadBuilderEip7732.java @@ -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) { @@ -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)); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732.java index 7d54ea0d750..bbc02224433 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732.java @@ -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 diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java index 2c2c8f293e0..efa666943f2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java @@ -22,8 +22,8 @@ import tech.pegasys.teku.infrastructure.ssz.SszList; import tech.pegasys.teku.infrastructure.ssz.collections.SszByteList; import tech.pegasys.teku.infrastructure.ssz.collections.SszByteVector; -import tech.pegasys.teku.infrastructure.ssz.containers.Container20; -import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema20; +import tech.pegasys.teku.infrastructure.ssz.containers.Container17; +import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema17; import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32; import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt256; import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64; @@ -31,58 +31,49 @@ import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.datastructures.execution.Transaction; import tech.pegasys.teku.spec.datastructures.execution.versions.capella.Withdrawal; -import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ConsolidationRequest; -import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequest; -import tech.pegasys.teku.spec.datastructures.execution.versions.electra.WithdrawalRequest; public class ExecutionPayloadEip7732Impl - extends Container20< - ExecutionPayloadEip7732Impl, - SszBytes32, - SszByteVector, - SszBytes32, - SszBytes32, - SszByteVector, - SszBytes32, - SszUInt64, - SszUInt64, - SszUInt64, - SszUInt64, - SszByteList, - SszUInt256, - SszBytes32, - SszList, - SszList, - SszUInt64, - SszUInt64, - SszList, - SszList, - SszList> + extends Container17< + ExecutionPayloadEip7732Impl, + SszBytes32, + SszByteVector, + SszBytes32, + SszBytes32, + SszByteVector, + SszBytes32, + SszUInt64, + SszUInt64, + SszUInt64, + SszUInt64, + SszByteList, + SszUInt256, + SszBytes32, + SszList, + SszList, + SszUInt64, + SszUInt64> implements ExecutionPayloadEip7732 { public ExecutionPayloadEip7732Impl( - final ContainerSchema20< - ExecutionPayloadEip7732Impl, - SszBytes32, - SszByteVector, - SszBytes32, - SszBytes32, - SszByteVector, - SszBytes32, - SszUInt64, - SszUInt64, - SszUInt64, - SszUInt64, - SszByteList, - SszUInt256, - SszBytes32, - SszList, - SszList, - SszUInt64, - SszUInt64, - SszList, - SszList, - SszList> + final ContainerSchema17< + ExecutionPayloadEip7732Impl, + SszBytes32, + SszByteVector, + SszBytes32, + SszBytes32, + SszByteVector, + SszBytes32, + SszUInt64, + SszUInt64, + SszUInt64, + SszUInt64, + SszByteList, + SszUInt256, + SszBytes32, + SszList, + SszList, + SszUInt64, + SszUInt64> schema, final TreeNode backingNode) { super(schema, backingNode); @@ -106,10 +97,7 @@ public ExecutionPayloadEip7732Impl( final SszList transactions, final SszList withdrawals, final SszUInt64 blobGasUsed, - final SszUInt64 excessBlobGas, - final SszList depositRequests, - final SszList withdrawalRequests, - final SszList consolidationRequests) { + final SszUInt64 excessBlobGas) { super( schema, parentHash, @@ -128,10 +116,7 @@ public ExecutionPayloadEip7732Impl( transactions, withdrawals, blobGasUsed, - excessBlobGas, - depositRequests, - withdrawalRequests, - consolidationRequests); + excessBlobGas); } @Override @@ -239,28 +224,10 @@ public UInt64 getExcessBlobGas() { return getField16().get(); } - @Override - public SszList getDepositRequests() { - return getField17(); - } - - @Override - public SszList getWithdrawalRequests() { - return getField18(); - } - - @Override - public SszList getConsolidationRequests() { - return getField19(); - } - @Override public List getUnblindedTreeNodes() { return List.of( getTransactions().getBackingNode(), - getWithdrawals().getBackingNode(), - getDepositRequests().getBackingNode(), - getWithdrawalRequests().getBackingNode(), - getConsolidationRequests().getBackingNode()); + getWithdrawals().getBackingNode()); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderBuilderEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderBuilderEip7732.java index 21bb97e5fe5..f1123ebb6b4 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderBuilderEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderBuilderEip7732.java @@ -22,9 +22,9 @@ import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeaderBuilder; -import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionPayloadHeaderBuilderElectra; +import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadHeaderBuilderDeneb; -public class ExecutionPayloadHeaderBuilderEip7732 extends ExecutionPayloadHeaderBuilderElectra { +public class ExecutionPayloadHeaderBuilderEip7732 extends ExecutionPayloadHeaderBuilderDeneb { private ExecutionPayloadHeaderSchemaEip7732 schema; protected Bytes32 parentBlockHash; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderEip7732.java index 94c58a27497..bf45f1ee88f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadHeaderEip7732.java @@ -20,9 +20,9 @@ import tech.pegasys.teku.infrastructure.bytes.Bytes20; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; -import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionPayloadHeaderElectra; +import tech.pegasys.teku.spec.datastructures.execution.versions.deneb.ExecutionPayloadHeaderDeneb; -public interface ExecutionPayloadHeaderEip7732 extends ExecutionPayloadHeaderElectra { +public interface ExecutionPayloadHeaderEip7732 extends ExecutionPayloadHeaderDeneb { static ExecutionPayloadHeaderEip7732 required(final ExecutionPayloadHeader payload) { return payload @@ -127,21 +127,6 @@ default UInt64 getExcessBlobGas() { throw new UnsupportedOperationException("Not supported in Eip7732"); } - @Override - default Bytes32 getDepositRequestsRoot() { - throw new UnsupportedOperationException("Not supported in Eip7732"); - } - - @Override - default Bytes32 getWithdrawalRequestsRoot() { - throw new UnsupportedOperationException("Not supported in Eip7732"); - } - - @Override - default Bytes32 getConsolidationRequestsRoot() { - throw new UnsupportedOperationException("Not supported in Eip7732"); - } - @Override default Optional toVersionEip7732() { return Optional.of(this); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadSchemaEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadSchemaEip7732.java index c04294f5667..d675d1165d8 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadSchemaEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadSchemaEip7732.java @@ -17,8 +17,6 @@ import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.BLOB_GAS_USED; import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.BLOCK_HASH; import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.BLOCK_NUMBER; -import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.CONSOLIDATION_REQUESTS; -import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.DEPOSIT_REQUESTS; import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.EXCESS_BLOB_GAS; import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.EXTRA_DATA; import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.FEE_RECIPIENT; @@ -32,7 +30,6 @@ import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.TIMESTAMP; import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.TRANSACTIONS; import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.WITHDRAWALS; -import static tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadFields.WITHDRAWAL_REQUESTS; import it.unimi.dsi.fastutil.longs.LongList; import java.util.function.Consumer; @@ -40,7 +37,7 @@ import tech.pegasys.teku.infrastructure.ssz.SszList; import tech.pegasys.teku.infrastructure.ssz.collections.SszByteList; import tech.pegasys.teku.infrastructure.ssz.collections.SszByteVector; -import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema20; +import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema17; import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32; import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt256; import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64; @@ -57,15 +54,9 @@ 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 ExecutionPayloadSchemaEip7732 - extends ContainerSchema20< + extends ContainerSchema17< ExecutionPayloadEip7732Impl, SszBytes32, SszByteVector, @@ -83,10 +74,7 @@ public class ExecutionPayloadSchemaEip7732 SszList, SszList, SszUInt64, - SszUInt64, - SszList, - SszList, - SszList> + SszUInt64> implements ExecutionPayloadSchema { private final ExecutionPayloadEip7732Impl defaultExecutionPayload; @@ -115,20 +103,7 @@ public ExecutionPayloadSchemaEip7732(final SpecConfigEip7732 specConfig) { WITHDRAWALS, SszListSchema.create(Withdrawal.SSZ_SCHEMA, specConfig.getMaxWithdrawalsPerPayload())), namedSchema(BLOB_GAS_USED, SszPrimitiveSchemas.UINT64_SCHEMA), - namedSchema(EXCESS_BLOB_GAS, SszPrimitiveSchemas.UINT64_SCHEMA), - namedSchema( - DEPOSIT_REQUESTS, - SszListSchema.create( - DepositRequest.SSZ_SCHEMA, specConfig.getMaxDepositRequestsPerPayload())), - namedSchema( - WITHDRAWAL_REQUESTS, - SszListSchema.create( - WithdrawalRequest.SSZ_SCHEMA, specConfig.getMaxWithdrawalRequestsPerPayload())), - namedSchema( - CONSOLIDATION_REQUESTS, - SszListSchema.create( - ConsolidationRequest.SSZ_SCHEMA, - specConfig.getMaxConsolidationRequestsPerPayload()))); + namedSchema(EXCESS_BLOB_GAS, SszPrimitiveSchemas.UINT64_SCHEMA)); this.defaultExecutionPayload = createFromBackingNode(getDefaultTree()); } @@ -152,63 +127,15 @@ public WithdrawalSchema getWithdrawalSchemaRequired() { return getWithdrawalSchema(); } - @Override - public SszListSchema> - getDepositRequestsSchemaRequired() { - return getDepositRequestsSchema(); - } - - @Override - public DepositRequestSchema getDepositRequestSchemaRequired() { - return getDepositRequestSchema(); - } - - @Override - public SszListSchema> - getWithdrawalRequestsSchemaRequired() { - return getWithdrawalRequestsSchema(); - } - - @Override - public WithdrawalRequestSchema getWithdrawalRequestSchemaRequired() { - return getWithdrawalRequestSchema(); - } - - @Override - public ConsolidationRequestSchema getConsolidationRequestSchemaRequired() { - return getConsolidationRequestSchema(); - } - - @Override - public SszListSchema> - getConsolidationRequestsSchemaRequired() { - return getConsolidationRequestsSchema(); - } - public WithdrawalSchema getWithdrawalSchema() { return (WithdrawalSchema) getWithdrawalsSchema().getElementSchema(); } - public DepositRequestSchema getDepositRequestSchema() { - return (DepositRequestSchema) getDepositRequestsSchema().getElementSchema(); - } - - public WithdrawalRequestSchema getWithdrawalRequestSchema() { - return (WithdrawalRequestSchema) getWithdrawalRequestsSchema().getElementSchema(); - } - - public ConsolidationRequestSchema getConsolidationRequestSchema() { - return (ConsolidationRequestSchema) getConsolidationRequestsSchema().getElementSchema(); - } - @Override public LongList getBlindedNodeGeneralizedIndices() { return LongList.of( getChildGeneralizedIndex(getFieldIndex(TRANSACTIONS)), - getChildGeneralizedIndex(getFieldIndex(WITHDRAWALS)), - getChildGeneralizedIndex(getFieldIndex(DEPOSIT_REQUESTS)), - getChildGeneralizedIndex(getFieldIndex(WITHDRAWAL_REQUESTS)), - getChildGeneralizedIndex(getFieldIndex(CONSOLIDATION_REQUESTS))); + getChildGeneralizedIndex(getFieldIndex(WITHDRAWALS))); } @Override @@ -238,20 +165,4 @@ public SszByteListSchema getExtraDataSchema() { public SszListSchema getWithdrawalsSchema() { return (SszListSchema) getChildSchema(getFieldIndex(WITHDRAWALS)); } - - @SuppressWarnings("unchecked") - public SszListSchema getDepositRequestsSchema() { - return (SszListSchema) getChildSchema(getFieldIndex(DEPOSIT_REQUESTS)); - } - - @SuppressWarnings("unchecked") - public SszListSchema getWithdrawalRequestsSchema() { - return (SszListSchema) getChildSchema(getFieldIndex(WITHDRAWAL_REQUESTS)); - } - - @SuppressWarnings("unchecked") - public SszListSchema getConsolidationRequestsSchema() { - return (SszListSchema) - getChildSchema(getFieldIndex(CONSOLIDATION_REQUESTS)); - } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java index 9f94ea8944d..0a5c87727b7 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java @@ -657,6 +657,12 @@ protected BlockValidationResult verifyAttestationSignatures( .orElse(BlockValidationResult.SUCCESSFUL); } + @Override + public void processExecutionPayloadHeader(final MutableBeaconState state, final BeaconBlock block) + throws BlockProcessingException { + // No processExecutionPayloadHeader until EIP-7732 + } + @Override public void processDeposits(final MutableBeaconState state, final SszList deposits) throws BlockProcessingException { diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AttestationUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AttestationUtil.java index 5c63f083a9f..f137e2499cb 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AttestationUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AttestationUtil.java @@ -40,9 +40,8 @@ import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.IndexedAttestation; -import tech.pegasys.teku.spec.datastructures.operations.IndexedAttestation.IndexedAttestationSchema; -import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestationData; import tech.pegasys.teku.spec.datastructures.operations.IndexedAttestationSchema; +import tech.pegasys.teku.spec.datastructures.operations.PayloadAttestationData; import tech.pegasys.teku.spec.datastructures.state.Checkpoint; import tech.pegasys.teku.spec.datastructures.state.Fork; import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java index dec118ca9d4..ae7471adacf 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java @@ -16,6 +16,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static tech.pegasys.teku.spec.logic.common.helpers.MathHelpers.bytesToUInt64; +import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.IntList; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java index e83608ebc54..2290a442921 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java @@ -18,7 +18,6 @@ import static tech.pegasys.teku.spec.logic.versions.altair.helpers.MiscHelpersAltair.PARTICIPATION_FLAG_WEIGHTS; import java.util.Optional; -import java.util.function.Supplier; import org.apache.tuweni.bytes.Bytes; import tech.pegasys.teku.bls.BLS; import tech.pegasys.teku.infrastructure.ssz.SszList; @@ -33,7 +32,6 @@ import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlock; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.eip7732.BeaconBlockBodyEip7732; -import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSummary; import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader; @@ -44,7 +42,6 @@ import tech.pegasys.teku.spec.datastructures.state.Validator; import tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState; import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.eip7732.MutableBeaconStateEip7732; -import tech.pegasys.teku.spec.logic.common.helpers.BeaconStateMutators.ValidatorExitContext; import tech.pegasys.teku.spec.logic.common.operations.OperationSignatureVerifier; import tech.pegasys.teku.spec.logic.common.operations.validation.OperationValidator; import tech.pegasys.teku.spec.logic.common.statetransition.exceptions.BlockProcessingException; @@ -306,25 +303,5 @@ public ExecutionPayloadHeader extractExecutionPayloadHeader(final BeaconBlockBod return null; } - @Override - protected void processDepositRequests( - final MutableBeaconState state, final Optional executionPayload) - throws BlockProcessingException { - // Removed in EIP-7732 - } - - @Override - protected void processWithdrawalRequests( - final MutableBeaconState state, - final Optional executionPayload, - final Supplier validatorExitContextSupplier) { - // Removed in EIP-7732 - } - - @Override - protected void processConsolidationRequests( - final MutableBeaconState state, final Optional executionPayload) - throws BlockProcessingException { - // Removed in EIP-7732 - } + //EIP7732 TODO: remove processStuff } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/execution/ExecutionPayloadProcessorEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/execution/ExecutionPayloadProcessorEip7732.java index ec837e6a6dd..e9cef5b788c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/execution/ExecutionPayloadProcessorEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/execution/ExecutionPayloadProcessorEip7732.java @@ -199,6 +199,7 @@ public NewPayloadRequest computeNewPayloadRequest( return new NewPayloadRequest(envelope.getPayload(), versionedHashes, parentBeaconBlockRoot); } + @SuppressWarnings("unused") protected void processOperationsNoValidation( final MutableBeaconState state, final ExecutionPayload executionPayload) throws ExecutionPayloadProcessingException { @@ -209,13 +210,7 @@ protected void processOperationsNoValidation( final ExecutionPayloadEip7732 executionPayloadEip7732 = ExecutionPayloadEip7732.required(executionPayload); - // EIP7732 TODO: dirty way to leverage Electra operations - blockProcessorElectra.processDepositRequests( - state, executionPayloadEip7732.getDepositRequests()); - blockProcessorElectra.processWithdrawalRequests( - state, executionPayloadEip7732.getWithdrawalRequests(), validatorExitContextSupplier); - blockProcessorElectra.processConsolidationRequests( - state, executionPayloadEip7732.getConsolidationRequests()); + // EIP7732 TODO: fix after rebase }); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsEip7732.java index 9781f0f8413..88f7bfe6fc0 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/SchemaDefinitionsEip7732.java @@ -48,20 +48,30 @@ import tech.pegasys.teku.spec.datastructures.execution.versions.eip7732.ExecutionPayloadSchemaEip7732; import tech.pegasys.teku.spec.datastructures.networking.libp2p.rpc.ExecutionPayloadEnvelopesByRootRequestMessage.ExecutionPayloadEnvelopesByRootRequestMessageSchema; 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.AttestationElectraSchema; +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; import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.eip7732.MutableBeaconStateEip7732; +import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry; public class SchemaDefinitionsEip7732 extends SchemaDefinitionsElectra { - private final AttestationSchema attestationSchema; + private final IndexedAttestationSchema indexedAttestationSchema; + private final AttesterSlashingSchema attesterSlashingSchema; + private final AttestationSchema attestationSchema; private final SignedAggregateAndProofSchema signedAggregateAndProofSchema; private final AggregateAndProofSchema aggregateAndProofSchema; @@ -96,14 +106,22 @@ public class SchemaDefinitionsEip7732 extends SchemaDefinitionsElectra { executionPayloadEnvelopesByRootRequestMessageSchema; private final PayloadAttestationMessageSchema payloadAttestationMessageSchema; - public SchemaDefinitionsEip7732(final SpecConfigEip7732 specConfig) { - super(specConfig); + public SchemaDefinitionsEip7732(final SchemaRegistry schemaRegistry) { + super(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 = new AttestationElectraSchema( - maxValidatorsPerAttestation, specConfig.getMaxCommitteesPerSlot()); + maxValidatorsPerAttestation, specConfig.getMaxCommitteesPerSlot()) + .castTypeToAttestationSchema(); this.aggregateAndProofSchema = new AggregateAndProofSchema(attestationSchema); this.signedAggregateAndProofSchema = new SignedAggregateAndProofSchema(aggregateAndProofSchema); @@ -202,10 +220,20 @@ public AggregateAndProofSchema getAggregateAndProofSchema() { } @Override - public AttestationSchema getAttestationSchema() { + public AttestationSchema getAttestationSchema() { return attestationSchema; } + @Override + public IndexedAttestationSchema getIndexedAttestationSchema() { + return indexedAttestationSchema; + } + + @Override + public AttesterSlashingSchema getAttesterSlashingSchema() { + return attesterSlashingSchema; + } + @Override public BeaconStateSchema getBeaconStateSchema() { diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java index b210198a42a..e734dcd2506 100644 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java +++ b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java @@ -84,8 +84,8 @@ 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.config.SpecConfigEip7732; +import tech.pegasys.teku.spec.config.SpecConfigElectra; import tech.pegasys.teku.spec.constants.Domain; import tech.pegasys.teku.spec.constants.PayloadStatus; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.Blob; @@ -749,6 +749,12 @@ public List randomExecutionPayloadDepositRequests() { .collect(toList()); } + public List randomDepositRequests() { + return IntStream.rangeClosed(0, randomInt(MAX_EP_RANDOM_DEPOSIT_REQUESTS)) + .mapToObj(__ -> randomDepositRequest()) + .collect(toList()); + } + public List randomWithdrawalRequests() { return IntStream.rangeClosed(0, randomInt(MAX_EP_RANDOM_WITHDRAWAL_REQUESTS)) .mapToObj(__ -> randomWithdrawalRequest()) @@ -1563,7 +1569,7 @@ public IndexedAttestation randomIndexedAttestation(final UInt64... attestingIndi public IndexedAttestation randomIndexedAttestation( final AttestationData data, final UInt64... attestingIndicesInput) { - final IndexedAttestationSchema indexedAttestationSchema = + final IndexedAttestationSchema indexedAttestationSchema = spec.getGenesisSchemaDefinitions().getIndexedAttestationSchema(); final SszUInt64List attestingIndices = indexedAttestationSchema.getAttestingIndicesSchema().of(attestingIndicesInput); @@ -2536,6 +2542,15 @@ public SszList emptyBlobKzgCommitments() { return getBlobKzgCommitmentsSchema().of(); } + public ExecutionRequests randomExecutionRequests() { + return new ExecutionRequestsBuilderElectra( + SpecConfigElectra.required(spec.forMilestone(SpecMilestone.ELECTRA).getConfig())) + .deposits(randomDepositRequests()) + .withdrawals(randomWithdrawalRequests()) + .consolidations(randomConsolidationRequests()) + .build(); + } + public WithdrawalRequest randomWithdrawalRequest() { return getElectraSchemaDefinitions(randomSlot()) .getWithdrawalRequestSchema() diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/BlockProductionDuty.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/BlockProductionDuty.java index 3eda389bf96..399783007b1 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/BlockProductionDuty.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/BlockProductionDuty.java @@ -14,6 +14,7 @@ package tech.pegasys.teku.validator.client.duties; import static com.google.common.base.Preconditions.checkArgument; +import static tech.pegasys.teku.infrastructure.logging.Converter.gweiToEth; import static tech.pegasys.teku.infrastructure.logging.Converter.weiToEth; import static tech.pegasys.teku.infrastructure.logging.ValidatorLogger.VALIDATOR_LOGGER; import static tech.pegasys.teku.infrastructure.unsigned.UInt64.ZERO;