Skip to content

Commit

Permalink
Couple of small things
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 10, 2024
1 parent 305ec72 commit af8338f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -237,18 +236,7 @@ private SafeFuture<Void> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit af8338f

Please sign in to comment.