Skip to content
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
@@ -0,0 +1,52 @@
/*
* Copyright Consensys Software Inc., 2026
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.validator.coordinator;

import tech.pegasys.teku.infrastructure.unsigned.UInt64;

/**
* Thrown when the data column sidecars for a submitted execution payload envelope cannot be built.
* Both cases are caused by the submission itself rather than by an internal failure, so the message
* is safe to return to the caller as the reason for a rejected publication.
*/
public class DataColumnSidecarCreationException extends IllegalStateException {

private DataColumnSidecarCreationException(final String message) {
super(message);
}

/**
* The envelope was submitted without blob data ({@code Eth-Blob-Data-Included: false}) but this
* beacon node has nothing cached to attach, typically because block production happened
* elsewhere.
*/
public static DataColumnSidecarCreationException noCachedBlobData(final UInt64 slot) {
return new DataColumnSidecarCreationException(
"No cached blobs and KZG proofs to attach to the execution payload envelope for slot "
+ slot
+ ". Block production likely happened on a different beacon node, resubmit with"
+ " Eth-Blob-Data-Included: true");
}

/**
* The submitted envelope does not carry the execution payload this beacon node built, so the
* blobs cached for the slot belong to a different payload and cannot be attached to it.
*/
public static DataColumnSidecarCreationException cachedPayloadMismatch(final UInt64 slot) {
return new DataColumnSidecarCreationException(
"Signed execution payload envelope for slot "
+ slot
+ " does not match the execution payload built by this beacon node");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import tech.pegasys.teku.spec.datastructures.blobs.DataColumnSidecar;
import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockAndState;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.ExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedBlindedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelopeContents;

Expand All @@ -33,12 +32,6 @@ public SafeFuture<ExecutionPayloadEnvelope> createUnsignedExecutionPayload(
return SafeFuture.completedFuture(null);
}

@Override
public SafeFuture<SignedExecutionPayloadEnvelope> unblindSignedExecutionPayload(
final SignedBlindedExecutionPayloadEnvelope signedBlindedExecutionPayload) {
return SafeFuture.completedFuture(null);
}

@Override
public SafeFuture<List<DataColumnSidecar>> createDataColumnSidecars(
final SignedExecutionPayloadEnvelope signedExecutionPayload) {
Expand All @@ -55,9 +48,6 @@ public SafeFuture<List<DataColumnSidecar>> createDataColumnSidecars(
SafeFuture<ExecutionPayloadEnvelope> createUnsignedExecutionPayload(
UInt64 builderIndex, BeaconBlockAndState blockAndState);

SafeFuture<SignedExecutionPayloadEnvelope> unblindSignedExecutionPayload(
SignedBlindedExecutionPayloadEnvelope signedBlindedExecutionPayload);

SafeFuture<List<DataColumnSidecar>> createDataColumnSidecars(
SignedExecutionPayloadEnvelope signedExecutionPayload);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.Blob;
import tech.pegasys.teku.spec.datastructures.blocks.BeaconBlockAndState;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.ExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedBlindedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelopeContents;
import tech.pegasys.teku.spec.datastructures.execution.BlobAndCellProofs;
Expand Down Expand Up @@ -69,27 +68,28 @@ public SafeFuture<ExecutionPayloadEnvelope> createUnsignedExecutionPayload(
proposalSlot, builderIndex, blockAndState, executionPayloadProposalDataFuture);
}

@Override
public SafeFuture<SignedExecutionPayloadEnvelope> unblindSignedExecutionPayload(
final SignedBlindedExecutionPayloadEnvelope signedBlindedExecutionPayload) {
final UInt64 slot = signedBlindedExecutionPayload.getSlot();
final SchemaDefinitionsGloas schemaDefinitions =
SchemaDefinitionsGloas.required(spec.atSlot(slot).getSchemaDefinitions());
return getCachedGetPayloadResponseFuture(slot)
.thenApply(
getPayloadResponse ->
signedBlindedExecutionPayload.unblind(
schemaDefinitions, getPayloadResponse.getExecutionPayload()));
}

@Override
public SafeFuture<List<DataColumnSidecar>> createDataColumnSidecars(
final SignedExecutionPayloadEnvelope signedExecutionPayload) {
final UInt64 slot = signedExecutionPayload.getMessage().getSlot();
return getCachedGetPayloadResponseFuture(slot)
return SafeFuture.<GetPayloadResponse>of(
() ->
executionLayerBlockProductionManager
.getCachedPayloadResult(slot)
.orElseThrow(() -> DataColumnSidecarCreationException.noCachedBlobData(slot))
.getPayloadResponseFutureFromLocalFlowRequired())
.thenApply(
getPayloadResponse -> {
final BlobsBundle blobsBundle = getPayloadResponse.getBlobsBundle().orElseThrow();
if (!getPayloadResponse
.getExecutionPayload()
.hashTreeRoot()
.equals(signedExecutionPayload.getMessage().getPayload().hashTreeRoot())) {
throw DataColumnSidecarCreationException.cachedPayloadMismatch(slot);
}
final BlobsBundle blobsBundle =
getPayloadResponse
.getBlobsBundle()
.orElseThrow(() -> DataColumnSidecarCreationException.noCachedBlobData(slot));
return createDataColumnSidecars(
signedExecutionPayload, blobsBundle.getBlobs(), blobsBundle.getProofs());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.ExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.PayloadAttestationData;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.PayloadAttestationMessage;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedBlindedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadBid;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelopeContents;
Expand Down Expand Up @@ -1047,20 +1046,6 @@ public SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPay
});
}

@Override
public SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPayload(
final SignedBlindedExecutionPayloadEnvelope signedBlindedExecutionPayload,
final Optional<BroadcastValidationLevel> broadcastValidationLevel) {
return executionPayloadPublisher
.publishSignedExecutionPayload(signedBlindedExecutionPayload, broadcastValidationLevel)
.exceptionally(
ex -> {
final String reason = getRootCauseMessage(ex);
return PublishSignedExecutionPayloadResult.rejected(
signedBlindedExecutionPayload.getBeaconBlockRoot(), reason);
});
}

private Optional<SubmitDataError> fromInternalValidationResult(
final InternalValidationResult internalValidationResult, final int resultIndex) {
if (!internalValidationResult.isReject()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import java.util.Optional;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedBlindedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.epbs.versions.gloas.SignedExecutionPayloadEnvelopeContents;
import tech.pegasys.teku.spec.datastructures.validator.BroadcastValidationLevel;
Expand Down Expand Up @@ -43,15 +42,6 @@ public SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPay
PublishSignedExecutionPayloadResult.success(
signedExecutionPayloadEnvelopeContents.getBeaconBlockRoot()));
}

@Override
public SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPayload(
final SignedBlindedExecutionPayloadEnvelope signedBlindedExecutionPayload,
final Optional<BroadcastValidationLevel> broadcastValidationLevel) {
return SafeFuture.completedFuture(
PublishSignedExecutionPayloadResult.success(
signedBlindedExecutionPayload.getBeaconBlockRoot()));
}
};

default SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPayload(
Expand All @@ -66,8 +56,4 @@ SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPayload(
SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPayload(
SignedExecutionPayloadEnvelopeContents signedExecutionPayloadEnvelopeContents,
Optional<BroadcastValidationLevel> broadcastValidationLevel);

SafeFuture<PublishSignedExecutionPayloadResult> publishSignedExecutionPayload(
SignedBlindedExecutionPayloadEnvelope signedBlindedExecutionPayload,
Optional<BroadcastValidationLevel> broadcastValidationLevel);
}
Loading
Loading