From d7fddf418e3638eb9bf6996d3fa22e6495b26ce0 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Sat, 11 Apr 2026 16:39:15 +0200 Subject: [PATCH] =?UTF-8?q?eth:=20fix=20lint=20issues=20=E2=80=94=20goimpo?= =?UTF-8?q?rts=20ordering=20and=20fuzzer=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix goimports violations: align callback field comments in tx_fetcher.go, sort import of eth/txtracker after eth/protocols in handler.go. Add missing onAccepted parameter (nil) to the txfetcher fuzzer. --- eth/fetcher/tx_fetcher.go | 10 +++++----- eth/handler.go | 2 +- tests/fuzzers/txfetcher/txfetcher_fuzzer.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 6e916747da..ba48c6cc8d 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -180,11 +180,11 @@ type TxFetcher struct { alternates map[common.Hash]map[string]struct{} // In-flight transaction alternate origins if retrieval fails // Callbacks - validateMeta func(common.Hash, byte) error // Validate a tx metadata based on the local txpool - addTxs func([]*types.Transaction) []error // Insert a batch of transactions into local txpool - fetchTxs func(string, []common.Hash) error // Retrieves a set of txs from a remote peer - dropPeer func(string) // Drops a peer in case of announcement violation - onAccepted func(peer string, hashes []common.Hash) // Optional: notified with accepted tx hashes per peer + validateMeta func(common.Hash, byte) error // Validate a tx metadata based on the local txpool + addTxs func([]*types.Transaction) []error // Insert a batch of transactions into local txpool + fetchTxs func(string, []common.Hash) error // Retrieves a set of txs from a remote peer + dropPeer func(string) // Drops a peer in case of announcement violation + onAccepted func(peer string, hashes []common.Hash) // Optional: notified with accepted tx hashes per peer step chan struct{} // Notification channel when the fetcher loop iterates clock mclock.Clock // Monotonic clock or simulated clock for tests diff --git a/eth/handler.go b/eth/handler.go index 69469fddd0..d809053533 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -36,9 +36,9 @@ import ( "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/eth/fetcher" - "github.com/ethereum/go-ethereum/eth/txtracker" "github.com/ethereum/go-ethereum/eth/protocols/eth" "github.com/ethereum/go-ethereum/eth/protocols/snap" + "github.com/ethereum/go-ethereum/eth/txtracker" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" diff --git a/tests/fuzzers/txfetcher/txfetcher_fuzzer.go b/tests/fuzzers/txfetcher/txfetcher_fuzzer.go index bcceaff383..69674d0e62 100644 --- a/tests/fuzzers/txfetcher/txfetcher_fuzzer.go +++ b/tests/fuzzers/txfetcher/txfetcher_fuzzer.go @@ -84,7 +84,7 @@ func fuzz(input []byte) int { return make([]error, len(txs)) }, func(string, []common.Hash) error { return nil }, - nil, + nil, nil, clock, func() time.Time { nanoTime := int64(clock.Now())