Skip to content

test: enable and rename IPv6 ban tests after PR #523 fixes - #537

Merged
sugh01 merged 6 commits into
bsv-blockchain:mainfrom
sugh01:feature/enable-ipv6-ban-tests
May 23, 2026
Merged

test: enable and rename IPv6 ban tests after PR #523 fixes#537
sugh01 merged 6 commits into
bsv-blockchain:mainfrom
sugh01:feature/enable-ipv6-ban-tests

Conversation

@sugh01

@sugh01 sugh01 commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions

github-actions Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Status: Complete


Current Review:

Found 1 minor issue:

[Minor] Outdated comment on line 416
Line 416 still references TestBanListRPCIPv6SubnetBug (the old test name) but this PR renames it to TestBanListRPCIPv6Subnet. The comment should either be updated to reference the new test name or removed entirely since the bug is now fixed.

Summary:

This PR successfully re-enables two test functions that were previously skipped due to bugs fixed in PR #523:

  • TestBanListRPCIPv6Subnet (formerly TestBanListRPCIPv6SubnetBug)
  • TestIsBannedRPCWithPeerID (formerly TestIsBannedRPCBug)

The test changes correctly reflect the implementation fixes in handlers.go where isIPOrSubnet now handles IPv6 CIDR notation correctly and handleIsBanned accepts both IP and PeerID formats. Test documentation accurately describes the previous bugs and their resolutions.

@sonarqubecloud

sonarqubecloud Bot commented Mar 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Benchmark Comparison Report

Baseline: main (unknown)

Current: PR-537 (9413683a)

Summary

  • Regressions: 0
  • Improvements: 0
  • Unchanged: 144
  • Significance level: p < 0.05
All benchmark results (sec/op)
Benchmark Baseline Current Change p-value
_NewBlockFromBytes-4 1.595µ 1.599µ ~ 1.000
SplitSyncedParentMap_SetIfNotExists/256_buckets-4 71.16n 71.09n ~ 0.700
SplitSyncedParentMap_SetIfNotExists/16_buckets-4 71.13n 71.55n ~ 0.200
SplitSyncedParentMap_SetIfNotExists/1_bucket-4 71.73n 71.03n ~ 0.100
SplitSyncedParentMap_ConcurrentSetIfNotExists/256_buckets... 32.25n 34.26n ~ 0.100
SplitSyncedParentMap_ConcurrentSetIfNotExists/16_buckets_... 53.51n 53.67n ~ 1.000
SplitSyncedParentMap_ConcurrentSetIfNotExists/1_bucket_pa... 129.2n 128.4n ~ 0.700
MiningCandidate_Stringify_Short-4 216.2n 216.5n ~ 0.800
MiningCandidate_Stringify_Long-4 1.606µ 1.630µ ~ 0.100
MiningSolution_Stringify-4 841.0n 840.7n ~ 1.000
BlockInfo_MarshalJSON-4 1.710µ 1.712µ ~ 1.000
NewFromBytes-4 128.4n 158.2n ~ 0.300
AddTxBatchColumnar_Validation-4 2.516µ 2.495µ ~ 0.700
OffsetValidationLoop-4 638.3n 635.3n ~ 0.400
Mine_EasyDifficulty-4 60.36µ 60.73µ ~ 0.200
Mine_WithAddress-4 6.845µ 6.809µ ~ 0.400
BlockAssembler_AddTx-4 0.02622n 0.02583n ~ 0.400
AddNode-4 10.50 10.68 ~ 0.400
AddNodeWithMap-4 10.98 11.66 ~ 0.400
DiskTxMap_SetIfNotExists-4 3.676µ 3.576µ ~ 1.000
DiskTxMap_SetIfNotExists_Parallel-4 3.266µ 3.246µ ~ 0.100
DiskTxMap_ExistenceOnly-4 314.6n 320.5n ~ 0.400
Queue-4 191.5n 186.8n ~ 0.100
AtomicPointer-4 4.118n 4.433n ~ 0.200
ReorgOptimizations/DedupFilterPipeline/Old/10K-4 851.2µ 853.2µ ~ 0.700
ReorgOptimizations/DedupFilterPipeline/New/10K-4 800.1µ 798.2µ ~ 0.400
ReorgOptimizations/AllMarkFalse/Old/10K-4 112.4µ 119.7µ ~ 0.400
ReorgOptimizations/AllMarkFalse/New/10K-4 62.07µ 62.71µ ~ 0.100
ReorgOptimizations/HashSlicePool/Old/10K-4 54.87µ 55.57µ ~ 1.000
ReorgOptimizations/HashSlicePool/New/10K-4 11.31µ 11.02µ ~ 0.700
ReorgOptimizations/NodeFlags/Old/10K-4 5.126µ 4.673µ ~ 0.100
ReorgOptimizations/NodeFlags/New/10K-4 1.749µ 1.618µ ~ 0.100
ReorgOptimizations/DedupFilterPipeline/Old/100K-4 9.602m 9.389m ~ 0.200
ReorgOptimizations/DedupFilterPipeline/New/100K-4 10.23m 10.23m ~ 1.000
ReorgOptimizations/AllMarkFalse/Old/100K-4 1.083m 1.071m ~ 0.100
ReorgOptimizations/AllMarkFalse/New/100K-4 679.0µ 684.8µ ~ 0.700
ReorgOptimizations/HashSlicePool/Old/100K-4 547.4µ 552.1µ ~ 0.700
ReorgOptimizations/HashSlicePool/New/100K-4 306.2µ 308.3µ ~ 0.100
ReorgOptimizations/NodeFlags/Old/100K-4 45.49µ 50.24µ ~ 0.100
ReorgOptimizations/NodeFlags/New/100K-4 17.44µ 17.41µ ~ 1.000
TxMapSetIfNotExists-4 52.08n 52.50n ~ 0.300
TxMapSetIfNotExistsDuplicate-4 39.91n 39.93n ~ 0.700
ChannelSendReceive-4 593.9n 629.8n ~ 0.100
DirectSubtreeAdd/4_per_subtree-4 56.19n 57.15n ~ 1.000
DirectSubtreeAdd/64_per_subtree-4 29.02n 29.23n ~ 0.400
DirectSubtreeAdd/256_per_subtree-4 28.11n 27.74n ~ 0.200
DirectSubtreeAdd/1024_per_subtree-4 26.49n 26.49n ~ 0.800
DirectSubtreeAdd/2048_per_subtree-4 26.10n 26.17n ~ 0.200
SubtreeProcessorAdd/4_per_subtree-4 287.5n 301.8n ~ 0.200
SubtreeProcessorAdd/64_per_subtree-4 286.1n 286.3n ~ 0.700
SubtreeProcessorAdd/256_per_subtree-4 284.7n 282.5n ~ 0.700
SubtreeProcessorAdd/1024_per_subtree-4 278.3n 276.2n ~ 0.200
SubtreeProcessorAdd/2048_per_subtree-4 278.5n 282.4n ~ 0.100
SubtreeProcessorRotate/4_per_subtree-4 280.5n 285.4n ~ 0.100
SubtreeProcessorRotate/64_per_subtree-4 279.5n 279.2n ~ 1.000
SubtreeProcessorRotate/256_per_subtree-4 281.8n 275.4n ~ 0.100
SubtreeProcessorRotate/1024_per_subtree-4 280.9n 275.6n ~ 0.100
SubtreeNodeAddOnly/4_per_subtree-4 55.27n 54.96n ~ 0.400
SubtreeNodeAddOnly/64_per_subtree-4 35.92n 35.98n ~ 0.600
SubtreeNodeAddOnly/256_per_subtree-4 35.07n 34.97n ~ 0.300
SubtreeNodeAddOnly/1024_per_subtree-4 34.52n 34.37n ~ 0.400
SubtreeCreationOnly/4_per_subtree-4 109.5n 114.7n ~ 0.100
SubtreeCreationOnly/64_per_subtree-4 347.7n 344.9n ~ 0.700
SubtreeCreationOnly/256_per_subtree-4 1.212µ 1.218µ ~ 0.700
SubtreeCreationOnly/1024_per_subtree-4 3.778µ 3.850µ ~ 0.100
SubtreeCreationOnly/2048_per_subtree-4 6.774µ 6.751µ ~ 1.000
SubtreeProcessorOverheadBreakdown/64_per_subtree-4 277.6n 280.1n ~ 0.700
SubtreeProcessorOverheadBreakdown/1024_per_subtree-4 277.8n 281.8n ~ 0.100
ParallelGetAndSetIfNotExists/1k_nodes-4 2.003m 1.987m ~ 1.000
ParallelGetAndSetIfNotExists/10k_nodes-4 5.068m 5.143m ~ 0.100
ParallelGetAndSetIfNotExists/50k_nodes-4 6.988m 7.160m ~ 0.100
ParallelGetAndSetIfNotExists/100k_nodes-4 9.494m 9.505m ~ 1.000
SequentialGetAndSetIfNotExists/1k_nodes-4 1.786m 1.767m ~ 1.000
SequentialGetAndSetIfNotExists/10k_nodes-4 4.428m 4.434m ~ 0.700
SequentialGetAndSetIfNotExists/50k_nodes-4 13.46m 13.62m ~ 0.400
SequentialGetAndSetIfNotExists/100k_nodes-4 24.97m 25.04m ~ 0.700
ProcessOwnBlockSubtreeNodesParallel/1k_nodes-4 2.031m 2.047m ~ 0.700
ProcessOwnBlockSubtreeNodesParallel/10k_nodes-4 8.294m 8.307m ~ 1.000
ProcessOwnBlockSubtreeNodesParallel/100k_nodes-4 13.04m 13.33m ~ 0.100
ProcessOwnBlockSubtreeNodesSequential/1k_nodes-4 1.818m 1.871m ~ 0.100
ProcessOwnBlockSubtreeNodesSequential/10k_nodes-4 7.993m 8.091m ~ 0.100
ProcessOwnBlockSubtreeNodesSequential/100k_nodes-4 43.08m 42.91m ~ 0.700
CalcBlockWork-4 471.4n 467.6n ~ 0.700
CalculateWork-4 622.0n 624.1n ~ 0.400
BuildBlockLocatorString_Helpers/Size_10-4 1.359µ 1.371µ ~ 0.100
BuildBlockLocatorString_Helpers/Size_100-4 15.69µ 16.51µ ~ 0.400
BuildBlockLocatorString_Helpers/Size_1000-4 129.0µ 131.2µ ~ 0.100
CatchupWithHeaderCache-4 104.5m 104.5m ~ 0.700
_prepareTxsPerLevel-4 417.2m 412.2m ~ 0.700
_prepareTxsPerLevelOrdered-4 3.694m 4.064m ~ 0.100
_prepareTxsPerLevel_Comparison/Original-4 414.1m 415.5m ~ 1.000
_prepareTxsPerLevel_Comparison/Optimized-4 3.729m 3.742m ~ 0.700
SubtreeSizes/10k_tx_4_per_subtree-4 1.308m 1.315m ~ 1.000
SubtreeSizes/10k_tx_16_per_subtree-4 307.7µ 317.5µ ~ 0.100
SubtreeSizes/10k_tx_64_per_subtree-4 74.54µ 74.44µ ~ 1.000
SubtreeSizes/10k_tx_256_per_subtree-4 18.62µ 18.80µ ~ 0.100
SubtreeSizes/10k_tx_512_per_subtree-4 9.306µ 9.198µ ~ 0.200
SubtreeSizes/10k_tx_1024_per_subtree-4 4.623µ 4.566µ ~ 0.100
SubtreeSizes/10k_tx_2k_per_subtree-4 2.313µ 2.298µ ~ 0.200
BlockSizeScaling/10k_tx_64_per_subtree-4 74.88µ 72.89µ ~ 0.200
BlockSizeScaling/10k_tx_256_per_subtree-4 18.61µ 18.33µ ~ 0.400
BlockSizeScaling/10k_tx_1024_per_subtree-4 4.618µ 4.609µ ~ 0.400
BlockSizeScaling/50k_tx_64_per_subtree-4 388.1µ 386.6µ ~ 1.000
BlockSizeScaling/50k_tx_256_per_subtree-4 93.83µ 92.39µ ~ 0.400
BlockSizeScaling/50k_tx_1024_per_subtree-4 22.75µ 22.99µ ~ 0.100
SubtreeAllocations/small_subtrees_exists_check-4 157.6µ 158.1µ ~ 0.700
SubtreeAllocations/small_subtrees_data_fetch-4 161.7µ 161.1µ ~ 0.700
SubtreeAllocations/small_subtrees_full_validation-4 320.2µ 319.3µ ~ 1.000
SubtreeAllocations/medium_subtrees_exists_check-4 9.579µ 9.430µ ~ 0.400
SubtreeAllocations/medium_subtrees_data_fetch-4 9.346µ 9.269µ ~ 0.300
SubtreeAllocations/medium_subtrees_full_validation-4 18.88µ 18.69µ ~ 0.100
SubtreeAllocations/large_subtrees_exists_check-4 2.270µ 2.253µ ~ 0.200
SubtreeAllocations/large_subtrees_data_fetch-4 2.276µ 2.278µ ~ 1.000
SubtreeAllocations/large_subtrees_full_validation-4 4.710µ 4.693µ ~ 0.700
_BufferPoolAllocation/16KB-4 3.763µ 4.665µ ~ 0.700
_BufferPoolAllocation/32KB-4 8.725µ 7.270µ ~ 0.100
_BufferPoolAllocation/64KB-4 18.53µ 13.89µ ~ 0.100
_BufferPoolAllocation/128KB-4 37.94µ 24.50µ ~ 0.100
_BufferPoolAllocation/512KB-4 115.44µ 95.81µ ~ 0.100
_BufferPoolConcurrent/32KB-4 19.97µ 18.11µ ~ 0.200
_BufferPoolConcurrent/64KB-4 28.51µ 29.38µ ~ 0.400
_BufferPoolConcurrent/512KB-4 144.3µ 145.8µ ~ 0.700
_SubtreeDeserializationWithBufferSizes/16KB-4 614.2µ 611.0µ ~ 0.700
_SubtreeDeserializationWithBufferSizes/32KB-4 609.5µ 610.7µ ~ 0.700
_SubtreeDeserializationWithBufferSizes/64KB-4 595.0µ 602.9µ ~ 0.100
_SubtreeDeserializationWithBufferSizes/128KB-4 587.2µ 585.4µ ~ 0.400
_SubtreeDeserializationWithBufferSizes/512KB-4 590.6µ 588.1µ ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/16KB-4 37.69m 36.65m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/32KB-4 37.89m 36.68m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/64KB-4 37.69m 36.81m ~ 0.700
_SubtreeDataDeserializationWithBufferSizes/128KB-4 37.78m 36.74m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/512KB-4 37.44m 36.28m ~ 0.100
_PooledVsNonPooled/Pooled-4 842.5n 834.7n ~ 0.400
_PooledVsNonPooled/NonPooled-4 7.385µ 7.279µ ~ 0.700
_MemoryFootprint/Current_512KB_32concurrent-4 7.580µ 7.115µ ~ 0.200
_MemoryFootprint/Proposed_32KB_32concurrent-4 9.374µ 10.569µ ~ 0.100
_MemoryFootprint/Alternative_64KB_32concurrent-4 9.012µ 9.759µ ~ 0.100
StoreBlock_Sequential/BelowCSVHeight-4 326.0µ 319.7µ ~ 0.100
StoreBlock_Sequential/AboveCSVHeight-4 322.3µ 322.5µ ~ 0.400
GetUtxoHashes-4 291.5n 273.7n ~ 0.200
GetUtxoHashes_ManyOutputs-4 47.02µ 45.81µ ~ 0.100
_NewMetaDataFromBytes-4 223.3n 215.3n ~ 0.700
_Bytes-4 415.5n 415.0n ~ 1.000
_MetaBytes-4 147.1n 142.9n ~ 0.100

Threshold: >10% with p < 0.05 | Generated: 2026-05-22 15:05 UTC

@sugh01
sugh01 requested a review from ordishs May 22, 2026 14:50
@sonarqubecloud

Copy link
Copy Markdown

@liam
liam self-requested a review May 22, 2026 15:53

@ordishs ordishs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified the underlying fixes against services/rpc/handlers.go:

  • isIPOrSubnet (handlers.go:2715–2730) no longer port-strips before ParseCIDR, so IPv6 CIDR works.
  • handleIsBanned (handlers.go:2042–2088) calls p2pClient.IsBanned unconditionally (both IP and PeerID) and only invokes the legacy client when isIPOrSubnet is true.

The renamed tests accurately describe current behaviour.

Suggestion (non-blocking)

There's a stale comment at test/e2e/daemon/ready/banlist_e2e_test.go:416 inside TestBanListRPCE2E that wasn't updated:

// Note: IPv6 subnet bans via RPC have a known bug - see TestBanListRPCIPv6SubnetBug

It still references the old test name and still claims the bug exists. Worth either updating to point at the renamed test, e.g.:

// IPv6 subnet bans via RPC are exercised by TestBanListRPCIPv6Subnet

…or just deleting it, since the surrounding test already covers IPv6 single addresses.

Minor (optional)

TestIsBannedRPCWithPeerID only exercises the PeerID branch of handleIsBanned. The IP-input branch (which now fans out to both p2pClient and the legacy client) is only covered indirectly via TestBanListRPCE2E/listbanned. A small isbanned <ip> assertion would tighten coverage, but the test name is honest about its scope so this is not blocking.

@sugh01
sugh01 merged commit f44080f into bsv-blockchain:main May 23, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants