Skip to content

Commit 9515bd1

Browse files
eth: fix lint
1 parent e94a428 commit 9515bd1

File tree

5 files changed

+52
-25
lines changed

5 files changed

+52
-25
lines changed

core/stateless/witness_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -258,22 +258,6 @@ func TestValidateWitnessPreState_MultipleHeaders(t *testing.T) {
258258
}
259259
}
260260

261-
// TestWitnessVerificationConstants tests the verification constants
262-
func TestWitnessVerificationConstants(t *testing.T) {
263-
// These constants should match the ones defined in eth/fetcher/witness_manager.go
264-
const (
265-
witnessPageWarningThreshold = 10
266-
witnessVerificationPeers = 2
267-
)
268-
269-
if witnessPageWarningThreshold != 10 {
270-
t.Errorf("Expected witnessPageWarningThreshold to be 10, got %d", witnessPageWarningThreshold)
271-
}
272-
if witnessVerificationPeers != 2 {
273-
t.Errorf("Expected witnessVerificationPeers to be 2, got %d", witnessVerificationPeers)
274-
}
275-
}
276-
277261
// TestSimplifiedWitnessVerification tests the simplified verification logic
278262
func TestSimplifiedWitnessVerification(t *testing.T) {
279263
tests := []struct {

eth/fetcher/block_fetcher_race_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func TestBlockFetcherConcurrentMapAccess(t *testing.T) {
5353
dropPeer,
5454
false, // no block tracking
5555
false, // no witness requirement
56+
0, // no gas ceiling
5657
)
5758

5859
// Start the fetcher
@@ -250,6 +251,7 @@ func TestWitnessManagerConcurrentAccess(t *testing.T) {
250251
getBlock,
251252
getHeader,
252253
chainHeight,
254+
0,
253255
)
254256

255257
// Start the witness manager
@@ -490,6 +492,7 @@ func TestBlockFetcherMapStateConsistency(t *testing.T) {
490492
dropPeer,
491493
false,
492494
false,
495+
0,
493496
)
494497

495498
fetcher.Start()
@@ -548,6 +551,7 @@ func TestWitnessManagerStateConsistency(t *testing.T) {
548551
getBlock,
549552
getHeader,
550553
chainHeight,
554+
0,
551555
)
552556

553557
block := createTestBlock(101)
@@ -623,6 +627,7 @@ func TestBlockFetcherMemoryLeaks(t *testing.T) {
623627
dropPeer,
624628
false,
625629
false,
630+
0,
626631
)
627632

628633
fetcher.Start()
@@ -679,6 +684,7 @@ func TestWitnessManagerMemoryLeaks(t *testing.T) {
679684
getBlock,
680685
getHeader,
681686
chainHeight,
687+
0,
682688
)
683689

684690
// Add and remove many entries to test cleanup
@@ -733,6 +739,7 @@ func TestWitnessManagerMapAccessRace(t *testing.T) {
733739
getBlock,
734740
getHeader,
735741
chainHeight,
742+
0,
736743
)
737744

738745
// Start the manager

eth/fetcher/block_fetcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func newTester(light bool) *fetcherTester {
109109
blocks: map[common.Hash]*types.Block{genesis.Hash(): genesis},
110110
drops: make(map[string]bool),
111111
}
112-
tester.fetcher = NewBlockFetcher(light, tester.getHeader, tester.getBlock, tester.verifyHeader, tester.broadcastBlock, tester.chainHeight, tester.insertHeaders, tester.insertChain, tester.dropPeer, false, false)
112+
tester.fetcher = NewBlockFetcher(light, tester.getHeader, tester.getBlock, tester.verifyHeader, tester.broadcastBlock, tester.chainHeight, tester.insertHeaders, tester.insertChain, tester.dropPeer, false, false, 0)
113113
tester.fetcher.Start()
114114

115115
return tester

eth/fetcher/witness_manager.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ type witnessVerificationResult struct {
7272
timestamp time.Time
7373
}
7474

75-
// witnessVerificationRequest represents a pending verification request
76-
type witnessVerificationRequest struct {
77-
hash common.Hash
78-
pageCount uint64
79-
peer string
80-
callback func(bool) // Called with true if peer is honest, false if dishonest
81-
}
82-
8375
// witnessManager handles the logic specific to fetching and managing witnesses
8476
// for blocks, isolating it from the main BlockFetcher loop.
8577
type witnessManager struct {

0 commit comments

Comments
 (0)