From af8338febfd4876aeece313430245b5b621526aa Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Tue, 10 Sep 2024 11:56:27 +0300 Subject: [PATCH] Couple of small things --- .../BlockOperationSelectorFactory.java | 14 +------- .../eip7732/helpers/MiscHelpersEip7732.java | 32 ------------------- 2 files changed, 1 insertion(+), 45 deletions(-) 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 8edc09340f0..5321e6ec167 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 @@ -64,7 +64,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.statetransition.OperationPool; import tech.pegasys.teku.statetransition.attestation.AggregatingAttestationPool; import tech.pegasys.teku.statetransition.attestation.AttestationForkChecker; @@ -237,18 +236,7 @@ private SafeFuture setExecutionData( // pre-Merge Execution Payload / Execution Payload Header if (executionPayloadContext.isEmpty()) { - if (bodyBuilder.supportsSignedExecutionPayloadHeader()) { - // ePBS - final ExecutionPayloadHeader header = - schemaDefinitions.getExecutionPayloadHeaderSchema().getHeaderOfDefaultPayload(); - final SignedExecutionPayloadHeader bid = - SchemaDefinitionsEip7732.required(schemaDefinitions) - .getSignedExecutionPayloadHeaderSchema() - .create(header, BLSSignature.empty()); - bodyBuilder.signedExecutionPayloadHeader(bid); - } else { - bodyBuilder.executionPayload(schemaDefinitions.getExecutionPayloadSchema().getDefault()); - } + bodyBuilder.executionPayload(schemaDefinitions.getExecutionPayloadSchema().getDefault()); return SafeFuture.COMPLETE; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/helpers/MiscHelpersEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/helpers/MiscHelpersEip7732.java index 85c11793c28..2b39c9dd531 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/helpers/MiscHelpersEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/helpers/MiscHelpersEip7732.java @@ -13,18 +13,13 @@ package tech.pegasys.teku.spec.logic.versions.eip7732.helpers; -import java.util.List; import java.util.Optional; -import org.apache.tuweni.bytes.Bytes32; import tech.pegasys.teku.infrastructure.ssz.tree.GIndexUtil; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.config.SpecConfigEip7732; import tech.pegasys.teku.spec.config.SpecConfigElectra; import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecar; import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.eip7732.BeaconBlockBodySchemaEip7732; -import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; -import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState; -import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.eip7732.BeaconStateEip7732; import tech.pegasys.teku.spec.logic.common.helpers.MiscHelpers; import tech.pegasys.teku.spec.logic.versions.electra.helpers.MiscHelpersElectra; import tech.pegasys.teku.spec.schemas.SchemaDefinitionsEip7732; @@ -59,33 +54,6 @@ public byte removeFlag(final byte participationFlags, final int flagIndex) { return (byte) (participationFlags & ~flag); } - // add the blob kzg commitments root for an empty list - @Override - public boolean isMergeTransitionComplete(final BeaconState genericState) { - final ExecutionPayloadHeader header = - schemaDefinitions - .getExecutionPayloadHeaderSchema() - .createExecutionPayloadHeader( - builder -> - builder - .parentBlockHash(() -> Bytes32.ZERO) - .parentBlockRoot(() -> Bytes32.ZERO) - .blockHash(Bytes32.ZERO) - .gasLimit(UInt64.ZERO) - .builderIndex(() -> UInt64.ZERO) - .slot(() -> UInt64.ZERO) - .value(() -> UInt64.ZERO) - .blobKzgCommitmentsRoot( - () -> - schemaDefinitions - .getBlobKzgCommitmentsSchema() - .createFromElements(List.of()) - .hashTreeRoot())); - return !BeaconStateEip7732.required(genericState) - .getLatestExecutionPayloadHeader() - .equals(header); - } - @Override public int getBlobSidecarKzgCommitmentGeneralizedIndex(final UInt64 blobSidecarIndex) { final long blobKzgCommitmentsRootGeneralizedIndex =