diff --git a/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlobSidecarsByRootIntegrationTest.java b/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlobSidecarsByRootIntegrationTest.java index 3ed1ccd442a..7eac1c2b46f 100644 --- a/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlobSidecarsByRootIntegrationTest.java +++ b/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BlobSidecarsByRootIntegrationTest.java @@ -59,22 +59,13 @@ public void requestBlobSidecars_shouldFailBeforeDenebMilestone() { .hasMessageContaining("BlobSidecarsByRoot method is not supported"); } - @TestTemplate - public void requestBlobSidecar_shouldFailBeforeDenebMilestone() { - assumeThat(specMilestone).isLessThan(SpecMilestone.DENEB); - assertThatThrownBy( - () -> requestBlobSidecarByRoot(peer, new BlobIdentifier(Bytes32.ZERO, UInt64.ZERO))) - .hasRootCauseInstanceOf(UnsupportedOperationException.class) - .hasMessageContaining("BlobSidecarsByRoot method is not supported"); - } - @TestTemplate public void requestBlobSidecars_shouldReturnEmptyBlobSidecarsAfterDenebMilestone() throws ExecutionException, InterruptedException, TimeoutException { assumeThat(specMilestone).isGreaterThanOrEqualTo(DENEB); - final Optional blobSidecar = - requestBlobSidecarByRoot(peer, new BlobIdentifier(Bytes32.ZERO, UInt64.ZERO)); - assertThat(blobSidecar).isEmpty(); + final List blobSidecars = + requestBlobSidecarsByRoot(peer, List.of(new BlobIdentifier(Bytes32.ZERO, UInt64.ZERO))); + assertThat(blobSidecars).isEmpty(); } @TestTemplate @@ -117,13 +108,4 @@ private List requestBlobSidecarsByRoot( assertThat(peer.getOutstandingRequests()).isEqualTo(0); return blobSidecars; } - - private Optional requestBlobSidecarByRoot( - final Eth2Peer peer, final BlobIdentifier blobIdentifier) - throws ExecutionException, InterruptedException, TimeoutException { - final Optional blobSidecar = - waitFor(peer.requestBlobSidecarByRoot(blobIdentifier)); - assertThat(peer.getOutstandingRequests()).isEqualTo(0); - return blobSidecar; - } } diff --git a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java index e7623132140..2e6fc8e4279 100644 --- a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java +++ b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java @@ -18,7 +18,6 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Suppliers; -import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Optional; @@ -37,7 +36,6 @@ import tech.pegasys.teku.networking.eth2.rpc.beaconchain.BeaconChainMethods; import tech.pegasys.teku.networking.eth2.rpc.beaconchain.methods.BlobSidecarsByRangeListenerValidatingProxy; import tech.pegasys.teku.networking.eth2.rpc.beaconchain.methods.BlobSidecarsByRootListenerValidatingProxy; -import tech.pegasys.teku.networking.eth2.rpc.beaconchain.methods.BlobSidecarsByRootValidator; import tech.pegasys.teku.networking.eth2.rpc.beaconchain.methods.BlocksByRangeListenerWrapper; import tech.pegasys.teku.networking.eth2.rpc.beaconchain.methods.MetadataMessagesFactory; import tech.pegasys.teku.networking.eth2.rpc.beaconchain.methods.StatusMessageFactory; @@ -280,32 +278,6 @@ public SafeFuture> requestBlockByRoot(final Bytes32 List.of(blockRoot))); } - @Override - public SafeFuture> requestBlobSidecarByRoot( - final BlobIdentifier blobIdentifier) { - return rpcMethods - .blobSidecarsByRoot() - .map( - method -> { - final List blobIdentifiers = - Collections.singletonList(blobIdentifier); - return requestOptionalItem( - method, - new BlobSidecarsByRootRequestMessage( - blobSidecarsByRootRequestMessageSchema.get(), blobIdentifiers)) - .thenPeek( - maybeBlobSidecar -> - maybeBlobSidecar.ifPresent( - blobSidecar -> { - final BlobSidecarsByRootValidator validator = - new BlobSidecarsByRootValidator( - this, spec, kzg, blobIdentifiers); - validator.validate(blobSidecar); - })); - }) - .orElse(failWithUnsupportedMethodException("BlobSidecarsByRoot")); - } - @Override public SafeFuture requestBlocksByRange( final UInt64 startSlot, diff --git a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/Eth2Peer.java b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/Eth2Peer.java index 4b5a2fe8086..cf3cc86934b 100644 --- a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/Eth2Peer.java +++ b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/Eth2Peer.java @@ -100,8 +100,6 @@ SafeFuture requestBlobSidecarsByRoot( SafeFuture> requestBlockByRoot(Bytes32 blockRoot); - SafeFuture> requestBlobSidecarByRoot(BlobIdentifier blobIdentifier); - SafeFuture requestMetadata(); SafeFuture requestSingleItem( diff --git a/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/peers/Eth2PeerTest.java b/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/peers/Eth2PeerTest.java index 770aa8d7757..65fe3943ec6 100644 --- a/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/peers/Eth2PeerTest.java +++ b/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/peers/Eth2PeerTest.java @@ -200,35 +200,6 @@ public void shouldSendRequest_BlobSidecarsByRoot() { assertThat(request.getMaximumResponseChunks()).isEqualTo(3); } - @Test - @SuppressWarnings({"unchecked", "FutureReturnValueIgnored"}) - public void shouldSendRequest_BlobSidecarByRoot() { - - final Eth2RpcMethod blobSidecarsByRootMethod = - mock(Eth2RpcMethod.class); - - final RpcStreamController rpcStreamController = - mock(RpcStreamController.class); - - when(rpcMethods.blobSidecarsByRoot()).thenReturn(Optional.of(blobSidecarsByRootMethod)); - - when(peer.sendRequest(any(), any(), any())) - .thenReturn(SafeFuture.completedFuture(rpcStreamController)); - - final BlobIdentifier blobIdentifier = dataStructureUtil.randomBlobIdentifier(); - - peer.requestBlobSidecarByRoot(blobIdentifier); - - final ArgumentCaptor requestCaptor = - ArgumentCaptor.forClass(BlobSidecarsByRootRequestMessage.class); - - verify(delegate, times(1)).sendRequest(any(), requestCaptor.capture(), any()); - - final BlobSidecarsByRootRequestMessage request = requestCaptor.getValue(); - - assertThat(request.getMaximumResponseChunks()).isEqualTo(1); - } - @Test @SuppressWarnings({"unchecked", "FutureReturnValueIgnored"}) public void shouldNotUpdateRequestWhenWithinDeneb_BlobSidecarsByRange() { diff --git a/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/peers/RespondingEth2Peer.java b/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/peers/RespondingEth2Peer.java index 26631ad504e..eb758cc6d4d 100644 --- a/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/peers/RespondingEth2Peer.java +++ b/networking/eth2/src/testFixtures/java/tech/pegasys/teku/networking/eth2/peers/RespondingEth2Peer.java @@ -275,16 +275,6 @@ public SafeFuture> requestBlockByRoot(final Bytes32 return createPendingBlockRequest(handler); } - @Override - public SafeFuture> requestBlobSidecarByRoot( - final BlobIdentifier blobIdentifier) { - final PendingRequestHandler, BlobSidecar> handler = - PendingRequestHandler.createForSingleBlobSidecarRequest( - () -> findBlobSidecarByBlobIdentifier(blobIdentifier)); - - return createPendingBlobSidecarRequest(handler); - } - private SafeFuture createPendingBlockRequest( final PendingRequestHandler handler) { final PendingRequestHandler filteredHandler =