Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions for execution requests to blinded block body #8706

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
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.versions.electra.ExecutionRequests;
import tech.pegasys.teku.spec.datastructures.operations.Attestation;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing;
import tech.pegasys.teku.spec.datastructures.operations.Deposit;
Expand Down Expand Up @@ -87,6 +88,10 @@ default Optional<SszList<SszKZGCommitment>> getOptionalBlobKzgCommitments() {
return Optional.empty();
}

default Optional<ExecutionRequests> getOptionalExecutionRequests() {
return Optional.empty();
}

default boolean isBlinded() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public enum BlockBodyFields implements SszFieldName {
EXECUTION_PAYLOAD_HEADER,
BLS_TO_EXECUTION_CHANGES,
BLOB_KZG_COMMITMENTS,
CONSOLIDATIONS,
EXECUTION_REQUESTS;

private final String sszFieldName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ public ExecutionPayloadSchema<?> getExecutionPayloadSchema() {
getChildSchema(getFieldIndex(BlockBodyFields.BLOB_KZG_COMMITMENTS));
}

@Override
public ExecutionRequestsSchema getExecutionRequestsSchema() {
return (ExecutionRequestsSchema)
getChildSchema(getFieldIndex(BlockBodyFields.EXECUTION_REQUESTS));
}

@Override
public long getBlobKzgCommitmentsGeneralizedIndex() {
return getChildGeneralizedIndex(getFieldIndex(BlockBodyFields.BLOB_KZG_COMMITMENTS));
Expand All @@ -234,9 +240,4 @@ public LongList getBlindedNodeGeneralizedIndices() {
getChildGeneralizedIndex(getFieldIndex(BlockBodyFields.EXECUTION_PAYLOAD)),
getExecutionPayloadSchema().getBlindedNodeGeneralizedIndices());
}

@Override
public ExecutionRequestsSchema getExecutionRequestsSchema() {
return (ExecutionRequestsSchema) getFieldSchema12();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Optional;
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody;
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.deneb.BlindedBeaconBlockBodyDeneb;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests;

public interface BlindedBeaconBlockBodyElectra extends BlindedBeaconBlockBodyDeneb {
static BlindedBeaconBlockBodyElectra required(final BeaconBlockBody body) {
Expand All @@ -27,6 +28,13 @@ static BlindedBeaconBlockBodyElectra required(final BeaconBlockBody body) {
+ body.getClass().getSimpleName()));
}

ExecutionRequests getExecutionRequests();

@Override
default Optional<ExecutionRequests> getOptionalExecutionRequests() {
return Optional.of(getExecutionRequests());
}

@Override
default Optional<BlindedBeaconBlockBodyElectra> toBlindedVersionElectra() {
return Optional.of(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public SszList<SszKZGCommitment> getBlobKzgCommitments() {
return getField11();
}

@Override
public ExecutionRequests getExecutionRequests() {
return getField12();
}

@Override
public BlindedBeaconBlockBodySchemaElectraImpl getSchema() {
return (BlindedBeaconBlockBodySchemaElectraImpl) super.getSchema();
Expand Down