From 5007d21a85feb264f03a1fcb9f869702d04f9757 Mon Sep 17 00:00:00 2001 From: MozirDmitriy Date: Tue, 17 Feb 2026 16:26:36 +0300 Subject: [PATCH] add test to verify PendingFilter returns blob transactions --- eth/sync_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/eth/sync_test.go b/eth/sync_test.go index 509b836f82..ea84263dd1 100644 --- a/eth/sync_test.go +++ b/eth/sync_test.go @@ -20,11 +20,15 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/txpool" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/eth/protocols/eth" "github.com/ethereum/go-ethereum/eth/protocols/snap" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/holiman/uint256" ) // Tests that snap sync is disabled after a successful sync cycle. @@ -96,3 +100,25 @@ func testSnapSyncDisabling(t *testing.T, ethVer uint, snapVer uint) { } } } + +// TestBlobTransactionSync tests that blob transactions are returned by PendingFilter. +func TestBlobTransactionSync(t *testing.T) { + t.Parallel() + + full := newTestHandler(ethconfig.SnapSync) + defer full.close() + + blobHash := common.Hash{0x01} + tx := types.NewTx(&types.BlobTx{ + To: testAddr, + BlobHashes: []common.Hash{blobHash}, + BlobFeeCap: uint256.MustFromBig(common.Big1), + Sidecar: types.NewBlobTxSidecar(types.BlobSidecarVersion0, nil, nil, nil), + }) + full.txpool.Add([]*types.Transaction{tx}, true) + + pending := full.txpool.Pending(txpool.PendingFilter{}) + if len(pending) == 0 { + t.Fatal("expected pending transactions, got none") + } +}