Skip to content

test: block validation settings test#615

Closed
sugh01 wants to merge 2 commits into
bsv-blockchain:mainfrom
sugh01:blockvalidation-settings-test
Closed

test: block validation settings test#615
sugh01 wants to merge 2 commits into
bsv-blockchain:mainfrom
sugh01:blockvalidation-settings-test

Conversation

@sugh01

@sugh01 sugh01 commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Status: Complete

No issues found.

This PR adds comprehensive settings test coverage for block assembly and block validation components. The tests verify that configuration values propagate correctly through the system.

Test Coverage:

  • Block assembly settings (channel buffers, concurrency, reorg limits, merkle subtree sizing)
  • Block validation settings (catchup configuration, circuit breakers, fork management)
  • Configuration override tests for strings, integers, booleans, and durations
  • Boundary value testing (zero values, large values)
  • Fallback behavior validation

The tests follow project conventions:

  • Use require from testify (per CLAUDE.md)
  • No t.Parallel() usage (appropriate for non-concurrent tests)
  • Table-driven test patterns with clear test case names
  • Helper functions properly defined in existing test files

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Benchmark Comparison Report

Baseline: main (unknown)

Current: PR-615 (82ced32)

Summary

  • Regressions: 0
  • Improvements: 0
  • Unchanged: 151
  • Significance level: p < 0.05
All benchmark results (sec/op)
Benchmark Baseline Current Change p-value
_NewBlockFromBytes-4 1.424µ 1.425µ ~ 0.700
SplitSyncedParentMap_SetIfNotExists/256_buckets-4 61.92n 61.59n ~ 0.100
SplitSyncedParentMap_SetIfNotExists/16_buckets-4 61.54n 61.73n ~ 0.400
SplitSyncedParentMap_SetIfNotExists/1_bucket-4 61.72n 61.61n ~ 0.100
SplitSyncedParentMap_ConcurrentSetIfNotExists/256_buckets... 38.86n 37.25n ~ 1.000
SplitSyncedParentMap_ConcurrentSetIfNotExists/16_buckets_... 60.38n 65.32n ~ 0.700
SplitSyncedParentMap_ConcurrentSetIfNotExists/1_bucket_pa... 184.5n 141.6n ~ 0.100
MiningCandidate_Stringify_Short-4 259.5n 263.0n ~ 0.700
MiningCandidate_Stringify_Long-4 1.930µ 1.933µ ~ 1.000
MiningSolution_Stringify-4 962.4n 1018.0n ~ 0.100
BlockInfo_MarshalJSON-4 1.796µ 1.869µ ~ 0.100
NewFromBytes-4 127.6n 126.6n ~ 0.400
Mine_EasyDifficulty-4 58.12µ 58.00µ ~ 0.700
Mine_WithAddress-4 4.628µ 4.868µ ~ 0.100
BlockAssembler_AddTx-4 0.02836n 0.03145n ~ 0.700
AddNode-4 10.46 10.37 ~ 0.700
AddNodeWithMap-4 11.14 11.03 ~ 0.400
DirectSubtreeAdd/4_per_subtree-4 63.30n 64.59n ~ 0.700
DirectSubtreeAdd/64_per_subtree-4 32.96n 32.04n ~ 0.400
DirectSubtreeAdd/256_per_subtree-4 31.27n 30.86n ~ 0.100
DirectSubtreeAdd/1024_per_subtree-4 29.86n 29.78n ~ 0.700
DirectSubtreeAdd/2048_per_subtree-4 29.52n 29.33n ~ 0.200
SubtreeProcessorAdd/4_per_subtree-4 315.2n 306.0n ~ 0.400
SubtreeProcessorAdd/64_per_subtree-4 319.2n 304.4n ~ 0.100
SubtreeProcessorAdd/256_per_subtree-4 307.8n 304.7n ~ 0.100
SubtreeProcessorAdd/1024_per_subtree-4 313.4n 307.2n ~ 0.100
SubtreeProcessorAdd/2048_per_subtree-4 313.8n 305.1n ~ 0.100
SubtreeProcessorRotate/4_per_subtree-4 313.4n 313.7n ~ 0.400
SubtreeProcessorRotate/64_per_subtree-4 314.4n 309.7n ~ 0.100
SubtreeProcessorRotate/256_per_subtree-4 315.9n 310.7n ~ 0.200
SubtreeProcessorRotate/1024_per_subtree-4 309.9n 309.1n ~ 0.400
SubtreeNodeAddOnly/4_per_subtree-4 66.75n 64.83n ~ 0.100
SubtreeNodeAddOnly/64_per_subtree-4 39.64n 39.46n ~ 0.400
SubtreeNodeAddOnly/256_per_subtree-4 38.48n 37.75n ~ 0.200
SubtreeNodeAddOnly/1024_per_subtree-4 37.87n 37.28n ~ 0.100
SubtreeCreationOnly/4_per_subtree-4 152.2n 142.5n ~ 0.100
SubtreeCreationOnly/64_per_subtree-4 682.4n 652.2n ~ 0.200
SubtreeCreationOnly/256_per_subtree-4 2.320µ 2.251µ ~ 0.100
SubtreeCreationOnly/1024_per_subtree-4 8.351µ 8.092µ ~ 0.100
SubtreeCreationOnly/2048_per_subtree-4 15.84µ 15.46µ ~ 0.400
SubtreeProcessorOverheadBreakdown/64_per_subtree-4 318.6n 303.6n ~ 0.100
SubtreeProcessorOverheadBreakdown/1024_per_subtree-4 315.6n 303.5n ~ 0.100
ParallelGetAndSetIfNotExists/1k_nodes-4 958.7µ 954.8µ ~ 0.100
ParallelGetAndSetIfNotExists/10k_nodes-4 1.916m 1.879m ~ 0.100
ParallelGetAndSetIfNotExists/50k_nodes-4 8.471m 8.271m ~ 0.700
ParallelGetAndSetIfNotExists/100k_nodes-4 16.51m 16.22m ~ 0.100
SequentialGetAndSetIfNotExists/1k_nodes-4 780.3µ 782.7µ ~ 1.000
SequentialGetAndSetIfNotExists/10k_nodes-4 3.238m 3.065m ~ 0.100
SequentialGetAndSetIfNotExists/50k_nodes-4 11.83m 11.00m ~ 0.100
SequentialGetAndSetIfNotExists/100k_nodes-4 21.82m 21.12m ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/1k_nodes-4 1019.0µ 994.4µ ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/10k_nodes-4 4.897m 4.734m ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/100k_nodes-4 19.68m 19.37m ~ 0.400
ProcessOwnBlockSubtreeNodesSequential/1k_nodes-4 822.7µ 820.6µ ~ 0.400
ProcessOwnBlockSubtreeNodesSequential/10k_nodes-4 6.875m 6.268m ~ 0.100
ProcessOwnBlockSubtreeNodesSequential/100k_nodes-4 43.91m 41.25m ~ 0.100
DiskTxMap_SetIfNotExists-4 4.378µ 4.288µ ~ 0.200
DiskTxMap_SetIfNotExists_Parallel-4 4.086µ 4.209µ ~ 0.200
DiskTxMap_ExistenceOnly-4 394.8n 389.9n ~ 1.000
Queue-4 209.7n 212.2n ~ 0.100
AtomicPointer-4 8.152n 8.145n ~ 0.700
ReorgOptimizations/DedupFilterPipeline/Old/10K-4 829.1µ 819.8µ ~ 1.000
ReorgOptimizations/DedupFilterPipeline/New/10K-4 783.4µ 788.5µ ~ 1.000
ReorgOptimizations/AllMarkFalse/Old/10K-4 118.5µ 115.3µ ~ 0.100
ReorgOptimizations/AllMarkFalse/New/10K-4 58.40µ 58.39µ ~ 1.000
ReorgOptimizations/HashSlicePool/Old/10K-4 59.16µ 60.39µ ~ 0.400
ReorgOptimizations/HashSlicePool/New/10K-4 11.79µ 11.81µ ~ 0.300
ReorgOptimizations/NodeFlags/Old/10K-4 5.350µ 5.723µ ~ 0.100
ReorgOptimizations/NodeFlags/New/10K-4 1.866µ 2.027µ ~ 0.100
ReorgOptimizations/DedupFilterPipeline/Old/100K-4 13.70m 13.44m ~ 1.000
ReorgOptimizations/DedupFilterPipeline/New/100K-4 13.27m 12.50m ~ 0.100
ReorgOptimizations/AllMarkFalse/Old/100K-4 1.245m 1.264m ~ 0.700
ReorgOptimizations/AllMarkFalse/New/100K-4 727.0µ 723.0µ ~ 0.700
ReorgOptimizations/HashSlicePool/Old/100K-4 605.7µ 588.6µ ~ 0.400
ReorgOptimizations/HashSlicePool/New/100K-4 304.5µ 311.6µ ~ 0.700
ReorgOptimizations/NodeFlags/Old/100K-4 51.34µ 52.02µ ~ 0.100
ReorgOptimizations/NodeFlags/New/100K-4 17.15µ 17.54µ ~ 0.100
TxMapSetIfNotExists-4 50.86n 49.99n ~ 0.700
TxMapSetIfNotExistsDuplicate-4 43.47n 43.64n ~ 0.400
ChannelSendReceive-4 669.0n 674.6n ~ 0.100
CalcBlockWork-4 547.4n 547.3n ~ 1.000
CalculateWork-4 741.3n 727.6n ~ 0.400
BuildBlockLocatorString_Helpers/Size_10-4 1.375µ 1.361µ ~ 0.100
BuildBlockLocatorString_Helpers/Size_100-4 12.87µ 12.84µ ~ 1.000
BuildBlockLocatorString_Helpers/Size_1000-4 151.3µ 154.0µ ~ 1.000
CatchupWithHeaderCache-4 104.5m 104.7m ~ 0.700
_prepareTxsPerLevel-4 407.2m 408.7m ~ 0.200
_prepareTxsPerLevelOrdered-4 3.859m 4.136m ~ 0.700
_prepareTxsPerLevel_Comparison/Original-4 416.1m 420.7m ~ 0.400
_prepareTxsPerLevel_Comparison/Optimized-4 3.791m 4.194m ~ 0.200
SubtreeProcessor/100_tx_64_per_subtree-4 80.59m 81.69m ~ 0.700
SubtreeProcessor/500_tx_64_per_subtree-4 393.2m 382.8m ~ 0.100
SubtreeProcessor/500_tx_256_per_subtree-4 427.7m 399.3m ~ 0.100
SubtreeProcessor/1k_tx_64_per_subtree-4 782.8m 773.3m ~ 0.200
SubtreeProcessor/1k_tx_256_per_subtree-4 780.1m 783.1m ~ 1.000
StreamingProcessorPhases/FilterValidated/100_tx-4 2.726m 2.714m ~ 1.000
StreamingProcessorPhases/ClassifyProcess/100_tx-4 239.5µ 239.9µ ~ 0.700
StreamingProcessorPhases/FilterValidated/500_tx-4 13.19m 13.34m ~ 0.200
StreamingProcessorPhases/ClassifyProcess/500_tx-4 615.1µ 603.1µ ~ 0.200
StreamingProcessorPhases/FilterValidated/1k_tx-4 27.18m 26.56m ~ 0.400
StreamingProcessorPhases/ClassifyProcess/1k_tx-4 1.088m 1.071m ~ 0.100
SubtreeSizes/10k_tx_4_per_subtree-4 1.306m 1.320m ~ 1.000
SubtreeSizes/10k_tx_16_per_subtree-4 315.8µ 321.5µ ~ 0.700
SubtreeSizes/10k_tx_64_per_subtree-4 74.37µ 75.04µ ~ 0.700
SubtreeSizes/10k_tx_256_per_subtree-4 18.53µ 18.65µ ~ 0.700
SubtreeSizes/10k_tx_512_per_subtree-4 9.277µ 9.357µ ~ 0.400
SubtreeSizes/10k_tx_1024_per_subtree-4 4.619µ 4.582µ ~ 0.700
SubtreeSizes/10k_tx_2k_per_subtree-4 2.290µ 2.299µ ~ 0.400
BlockSizeScaling/10k_tx_64_per_subtree-4 72.90µ 74.28µ ~ 0.700
BlockSizeScaling/10k_tx_256_per_subtree-4 18.50µ 18.55µ ~ 1.000
BlockSizeScaling/10k_tx_1024_per_subtree-4 4.602µ 4.601µ ~ 1.000
BlockSizeScaling/50k_tx_64_per_subtree-4 383.9µ 386.0µ ~ 0.700
BlockSizeScaling/50k_tx_256_per_subtree-4 92.13µ 92.94µ ~ 0.400
BlockSizeScaling/50k_tx_1024_per_subtree-4 22.46µ 23.00µ ~ 0.100
SubtreeAllocations/small_subtrees_exists_check-4 154.8µ 155.0µ ~ 1.000
SubtreeAllocations/small_subtrees_data_fetch-4 167.3µ 167.6µ ~ 1.000
SubtreeAllocations/small_subtrees_full_validation-4 320.2µ 325.3µ ~ 0.700
SubtreeAllocations/medium_subtrees_exists_check-4 9.219µ 9.187µ ~ 1.000
SubtreeAllocations/medium_subtrees_data_fetch-4 9.815µ 9.788µ ~ 0.700
SubtreeAllocations/medium_subtrees_full_validation-4 18.33µ 18.66µ ~ 0.100
SubtreeAllocations/large_subtrees_exists_check-4 2.201µ 2.182µ ~ 0.100
SubtreeAllocations/large_subtrees_data_fetch-4 2.366µ 2.384µ ~ 0.100
SubtreeAllocations/large_subtrees_full_validation-4 4.659µ 4.688µ ~ 0.100
_BufferPoolAllocation/16KB-4 6.349µ 5.581µ ~ 0.400
_BufferPoolAllocation/32KB-4 12.68µ 11.63µ ~ 0.400
_BufferPoolAllocation/64KB-4 21.59µ 25.52µ ~ 0.100
_BufferPoolAllocation/128KB-4 41.26µ 43.92µ ~ 0.700
_BufferPoolAllocation/512KB-4 178.3µ 190.8µ ~ 0.100
_BufferPoolConcurrent/32KB-4 25.69µ 24.26µ ~ 0.200
_BufferPoolConcurrent/64KB-4 39.00µ 42.45µ ~ 0.200
_BufferPoolConcurrent/512KB-4 252.7µ 257.8µ ~ 1.000
_SubtreeDeserializationWithBufferSizes/16KB-4 967.0µ 1021.0µ ~ 1.000
_SubtreeDeserializationWithBufferSizes/32KB-4 1012.5µ 917.6µ ~ 0.100
_SubtreeDeserializationWithBufferSizes/64KB-4 912.0µ 933.9µ ~ 1.000
_SubtreeDeserializationWithBufferSizes/128KB-4 1023.4µ 982.8µ ~ 1.000
_SubtreeDeserializationWithBufferSizes/512KB-4 1.036m 1.067m ~ 1.000
_SubtreeDataDeserializationWithBufferSizes/16KB-4 43.18m 42.97m ~ 0.400
_SubtreeDataDeserializationWithBufferSizes/32KB-4 43.92m 42.06m ~ 0.700
_SubtreeDataDeserializationWithBufferSizes/64KB-4 42.76m 44.69m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/128KB-4 43.00m 44.40m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/512KB-4 42.11m 43.63m ~ 0.200
_PooledVsNonPooled/Pooled-4 847.4n 860.5n ~ 0.200
_PooledVsNonPooled/NonPooled-4 11.63µ 10.77µ ~ 0.100
_MemoryFootprint/Current_512KB_32concurrent-4 14.84µ 13.25µ ~ 0.100
_MemoryFootprint/Proposed_32KB_32concurrent-4 16.45µ 17.87µ ~ 0.400
_MemoryFootprint/Alternative_64KB_32concurrent-4 16.67µ 18.02µ ~ 0.100
GetUtxoHashes-4 253.8n 252.8n ~ 1.000
GetUtxoHashes_ManyOutputs-4 49.13µ 49.17µ ~ 1.000
_NewMetaDataFromBytes-4 238.1n 240.7n ~ 0.100
_Bytes-4 644.9n 654.2n ~ 0.400
_MetaBytes-4 592.4n 600.9n ~ 0.100

Threshold: >10% with p < 0.05 | Generated: 2026-03-26 14:21 UTC

@oskarszoon oskarszoon mentioned this pull request May 14, 2026
@sugh01 sugh01 closed this May 26, 2026
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.

2 participants