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

Adopt engineGetBlobs #8663

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -47,6 +47,7 @@
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;
import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration;
import tech.pegasys.teku.spec.datastructures.execution.BlobAndProof;
import tech.pegasys.teku.spec.datastructures.execution.BuilderBidOrFallbackData;
import tech.pegasys.teku.spec.datastructures.execution.BuilderPayloadOrFallbackData;
import tech.pegasys.teku.spec.datastructures.execution.ClientVersion;
Expand All @@ -61,6 +62,7 @@
import tech.pegasys.teku.spec.executionlayer.ForkChoiceUpdatedResult;
import tech.pegasys.teku.spec.executionlayer.PayloadBuildingAttributes;
import tech.pegasys.teku.spec.executionlayer.PayloadStatus;
import tech.pegasys.teku.spec.logic.versions.deneb.types.VersionedHash;

public class ExecutionLayerManagerImpl implements ExecutionLayerManager {

Expand Down Expand Up @@ -218,6 +220,12 @@ public SafeFuture<List<ClientVersion>> engineGetClientVersion(final ClientVersio
return executionClientHandler.engineGetClientVersion(clientVersion);
}

@Override
public SafeFuture<List<BlobAndProof>> engineGetBlobs(
final List<VersionedHash> blobVersionedHashes, final UInt64 slot) {
return null;
}

@Override
public SafeFuture<Void> builderRegisterValidators(
final SszList<SignedValidatorRegistration> signedValidatorRegistrations, final UInt64 slot) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Consensys Software Inc., 2024
*
* 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.spec.datastructures.execution;

import tech.pegasys.teku.kzg.KZGProof;
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.Blob;

public record BlobAndProof(Blob blob, KZGProof proof) {}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;
import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration;
import tech.pegasys.teku.spec.datastructures.execution.BlobAndProof;
import tech.pegasys.teku.spec.datastructures.execution.BuilderBidOrFallbackData;
import tech.pegasys.teku.spec.datastructures.execution.BuilderPayloadOrFallbackData;
import tech.pegasys.teku.spec.datastructures.execution.ClientVersion;
Expand All @@ -34,6 +35,7 @@
import tech.pegasys.teku.spec.datastructures.execution.NewPayloadRequest;
import tech.pegasys.teku.spec.datastructures.execution.PowBlock;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState;
import tech.pegasys.teku.spec.logic.versions.deneb.types.VersionedHash;

public interface ExecutionLayerChannel extends ChannelInterface {
String PREVIOUS_STUB_ENDPOINT_PREFIX = "stub";
Expand Down Expand Up @@ -76,6 +78,12 @@
return SafeFuture.completedFuture(List.of());
}

@Override
public SafeFuture<List<BlobAndProof>> engineGetBlobs(
final List<VersionedHash> blobVersionedHashes, final UInt64 slot) {
return SafeFuture.completedFuture(List.of());
}

@Override
public SafeFuture<Void> builderRegisterValidators(
final SszList<SignedValidatorRegistration> signedValidatorRegistrations,
Expand Down Expand Up @@ -115,6 +123,9 @@

SafeFuture<List<ClientVersion>> engineGetClientVersion(ClientVersion clientVersion);

SafeFuture<List<BlobAndProof>> engineGetBlobs(
List<VersionedHash> blobVersionedHashes, UInt64 slot);
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

/**
* This is low level method, use {@link
* ExecutionLayerBlockProductionManager#initiateBlockProduction(ExecutionPayloadContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import tech.pegasys.teku.spec.datastructures.builder.BuilderBid;
import tech.pegasys.teku.spec.datastructures.builder.BuilderPayload;
import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration;
import tech.pegasys.teku.spec.datastructures.execution.BlobAndProof;
import tech.pegasys.teku.spec.datastructures.execution.BlobsBundle;
import tech.pegasys.teku.spec.datastructures.execution.BuilderBidOrFallbackData;
import tech.pegasys.teku.spec.datastructures.execution.BuilderPayloadOrFallbackData;
Expand All @@ -69,6 +70,7 @@
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;
import tech.pegasys.teku.spec.datastructures.util.BlobsUtil;
import tech.pegasys.teku.spec.datastructures.util.DepositRequestsUtil;
import tech.pegasys.teku.spec.logic.versions.deneb.types.VersionedHash;
import tech.pegasys.teku.spec.schemas.SchemaDefinitions;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsBellatrix;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsDeneb;
Expand Down Expand Up @@ -348,6 +350,12 @@ public SafeFuture<List<ClientVersion>> engineGetClientVersion(final ClientVersio
return SafeFuture.completedFuture(List.of(STUB_CLIENT_VERSION));
}

@Override
public SafeFuture<List<BlobAndProof>> engineGetBlobs(
final List<VersionedHash> blobVersionedHashes, final UInt64 slot) {
return null;
}

@Override
public SafeFuture<Void> builderRegisterValidators(
final SszList<SignedValidatorRegistration> signedValidatorRegistrations, final UInt64 slot) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1016,10 +1016,19 @@ public SignedBeaconBlock randomSignedBeaconBlockWithCommitments(final int count)
return randomSignedBeaconBlockWithCommitments(randomBlobKzgCommitments(count));
}

public SignedBeaconBlock randomSignedBeaconBlockWithCommitments(
final UInt64 slot, final int count) {
return randomSignedBeaconBlockWithCommitments(slot, randomBlobKzgCommitments(count));
}

public SignedBeaconBlock randomSignedBeaconBlockWithCommitments(
final SszList<SszKZGCommitment> commitments) {
return randomSignedBeaconBlockWithCommitments(randomUInt64(), commitments);
}

public SignedBeaconBlock randomSignedBeaconBlockWithCommitments(
final UInt64 slot, final SszList<SszKZGCommitment> commitments) {
final UInt64 proposerIndex = randomUInt64();
final UInt64 slot = randomUInt64();
final Bytes32 stateRoot = randomBytes32();
final Bytes32 parentRoot = randomBytes32();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ interface ReceivedBlobSidecarListener {

enum RemoteOrigin {
RPC,
GOSSIP
GOSSIP,
LOCAL_EL
}
}
Loading