From d95ca2e056ab2b6e702fb1ab2b992050386ac608 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Mon, 8 Sep 2025 12:33:17 +0200 Subject: [PATCH] cmd/devp2p/internal/ethtest: fix possible infinite wait (#32551) TestBlobTxWithoutSidecar test could run infinitely in case of a client not requesting the good transaction. This adds a timeout to make the test fail in this case. Fixes https://github.com/ethereum/go-ethereum/issues/32422 Signed-off-by: Csaba Kiraly --- cmd/devp2p/internal/ethtest/suite.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/devp2p/internal/ethtest/suite.go b/cmd/devp2p/internal/ethtest/suite.go index 47d00761f3..47327b6844 100644 --- a/cmd/devp2p/internal/ethtest/suite.go +++ b/cmd/devp2p/internal/ethtest/suite.go @@ -1133,7 +1133,10 @@ func (s *Suite) testBadBlobTx(t *utesting.T, tx *types.Transaction, badTx *types // transmit the same tx but with correct sidecar from the good peer. var req *eth.GetPooledTransactionsPacket - req, err = readUntil[eth.GetPooledTransactionsPacket](context.Background(), conn) + ctx, cancel := context.WithTimeout(context.Background(), 12*time.Second) + defer cancel() + + req, err = readUntil[eth.GetPooledTransactionsPacket](ctx, conn) if err != nil { errc <- fmt.Errorf("reading pooled tx request failed: %v", err) return