Skip to content

p2p silent mode#589

Merged
gokutheengineer merged 3 commits into
bsv-blockchain:mainfrom
gokutheengineer:gokhan/p2p-silent-mode
Mar 26, 2026
Merged

p2p silent mode#589
gokutheengineer merged 3 commits into
bsv-blockchain:mainfrom
gokutheengineer:gokhan/p2p-silent-mode

Conversation

@gokutheengineer

Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions

github-actions Bot commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Status: Complete

Current Review:
No issues found. This PR adds a new silent listen mode for P2P that suppresses all network advertisement while still receiving data. The implementation is clean, well-tested, and documented.

Key Changes:

  • Adds ListenModeSilent constant alongside existing ListenModeFull and ListenModeListenOnly
  • Suppresses DHT, address advertisement, and node_status publishing in silent mode
  • Maintains local WebSocket forwarding for monitoring
  • Comprehensive test coverage for all silent mode behaviors
  • Documentation table clearly explains behavioral differences between modes

@gokutheengineer gokutheengineer requested a review from icellan March 23, 2026 13:19
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Comparison Report

Baseline: main (unknown)

Current: PR-589 (4461cf3)

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.400µ 1.422µ ~ 0.200
SplitSyncedParentMap_SetIfNotExists/256_buckets-4 62.22n 61.72n ~ 0.700
SplitSyncedParentMap_SetIfNotExists/16_buckets-4 61.63n 61.64n ~ 1.000
SplitSyncedParentMap_SetIfNotExists/1_bucket-4 61.71n 61.67n ~ 0.100
SplitSyncedParentMap_ConcurrentSetIfNotExists/256_buckets... 31.61n 29.03n ~ 0.100
SplitSyncedParentMap_ConcurrentSetIfNotExists/16_buckets_... 51.24n 52.42n ~ 0.400
SplitSyncedParentMap_ConcurrentSetIfNotExists/1_bucket_pa... 124.8n 145.5n ~ 0.100
MiningCandidate_Stringify_Short-4 258.6n 258.9n ~ 0.500
MiningCandidate_Stringify_Long-4 1.871µ 1.884µ ~ 0.200
MiningSolution_Stringify-4 941.2n 941.2n ~ 1.000
BlockInfo_MarshalJSON-4 1.771µ 1.759µ ~ 0.100
NewFromBytes-4 127.1n 127.0n ~ 1.000
Mine_EasyDifficulty-4 58.02µ 58.72µ ~ 0.100
Mine_WithAddress-4 5.755µ 5.203µ ~ 0.400
DirectSubtreeAdd/4_per_subtree-4 67.56n 66.09n ~ 1.000
DirectSubtreeAdd/64_per_subtree-4 30.53n 30.28n ~ 0.300
DirectSubtreeAdd/256_per_subtree-4 29.31n 29.25n ~ 0.600
DirectSubtreeAdd/1024_per_subtree-4 28.27n 28.22n ~ 1.000
DirectSubtreeAdd/2048_per_subtree-4 27.88n 27.87n ~ 0.800
SubtreeProcessorAdd/4_per_subtree-4 314.7n 311.2n ~ 0.100
SubtreeProcessorAdd/64_per_subtree-4 309.3n 305.8n ~ 0.200
SubtreeProcessorAdd/256_per_subtree-4 310.5n 309.6n ~ 0.700
SubtreeProcessorAdd/1024_per_subtree-4 310.5n 307.5n ~ 0.200
SubtreeProcessorAdd/2048_per_subtree-4 312.8n 300.2n ~ 0.100
SubtreeProcessorRotate/4_per_subtree-4 319.8n 317.5n ~ 1.000
SubtreeProcessorRotate/64_per_subtree-4 311.5n 308.1n ~ 0.100
SubtreeProcessorRotate/256_per_subtree-4 311.6n 305.8n ~ 0.200
SubtreeProcessorRotate/1024_per_subtree-4 313.1n 308.6n ~ 0.100
SubtreeNodeAddOnly/4_per_subtree-4 64.52n 63.51n ~ 0.100
SubtreeNodeAddOnly/64_per_subtree-4 39.77n 38.96n ~ 0.100
SubtreeNodeAddOnly/256_per_subtree-4 38.52n 37.87n ~ 0.100
SubtreeNodeAddOnly/1024_per_subtree-4 37.66n 37.01n ~ 0.100
SubtreeCreationOnly/4_per_subtree-4 146.0n 139.1n ~ 0.100
SubtreeCreationOnly/64_per_subtree-4 669.1n 654.9n ~ 0.700
SubtreeCreationOnly/256_per_subtree-4 2.257µ 2.283µ ~ 0.700
SubtreeCreationOnly/1024_per_subtree-4 8.139µ 8.346µ ~ 0.100
SubtreeCreationOnly/2048_per_subtree-4 15.54µ 15.79µ ~ 0.100
SubtreeProcessorOverheadBreakdown/64_per_subtree-4 308.4n 305.9n ~ 0.200
SubtreeProcessorOverheadBreakdown/1024_per_subtree-4 303.9n 308.6n ~ 0.200
ParallelGetAndSetIfNotExists/1k_nodes-4 942.4µ 982.8µ ~ 0.100
ParallelGetAndSetIfNotExists/10k_nodes-4 1.840m 1.978m ~ 0.100
ParallelGetAndSetIfNotExists/50k_nodes-4 8.267m 8.376m ~ 0.100
ParallelGetAndSetIfNotExists/100k_nodes-4 16.08m 16.47m ~ 0.100
SequentialGetAndSetIfNotExists/1k_nodes-4 761.5µ 788.6µ ~ 0.100
SequentialGetAndSetIfNotExists/10k_nodes-4 3.239m 3.126m ~ 0.100
SequentialGetAndSetIfNotExists/50k_nodes-4 11.50m 11.11m ~ 0.100
SequentialGetAndSetIfNotExists/100k_nodes-4 21.46m 21.05m ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/1k_nodes-4 980.4µ 1002.3µ ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/10k_nodes-4 4.705m 4.771m ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/100k_nodes-4 19.07m 19.25m ~ 0.200
ProcessOwnBlockSubtreeNodesSequential/1k_nodes-4 812.3µ 841.6µ ~ 0.100
ProcessOwnBlockSubtreeNodesSequential/10k_nodes-4 6.308m 6.224m ~ 1.000
ProcessOwnBlockSubtreeNodesSequential/100k_nodes-4 41.41m 41.54m ~ 1.000
DiskTxMap_SetIfNotExists-4 3.565µ 3.721µ ~ 0.100
DiskTxMap_SetIfNotExists_Parallel-4 3.504µ 3.608µ ~ 0.200
DiskTxMap_ExistenceOnly-4 310.9n 329.3n ~ 0.100
Queue-4 198.0n 197.9n ~ 1.000
AtomicPointer-4 4.540n 4.456n ~ 0.700
ReorgOptimizations/DedupFilterPipeline/Old/10K-4 827.1µ 895.3µ ~ 0.100
ReorgOptimizations/DedupFilterPipeline/New/10K-4 806.4µ 867.2µ ~ 0.100
ReorgOptimizations/AllMarkFalse/Old/10K-4 104.3µ 110.6µ ~ 0.100
ReorgOptimizations/AllMarkFalse/New/10K-4 62.50µ 62.37µ ~ 0.700
ReorgOptimizations/HashSlicePool/Old/10K-4 62.25µ 63.00µ ~ 0.400
ReorgOptimizations/HashSlicePool/New/10K-4 12.13µ 11.32µ ~ 0.700
ReorgOptimizations/NodeFlags/Old/10K-4 5.435µ 5.146µ ~ 0.100
ReorgOptimizations/NodeFlags/New/10K-4 1.905µ 1.806µ ~ 0.100
ReorgOptimizations/DedupFilterPipeline/Old/100K-4 11.65m 10.98m ~ 0.100
ReorgOptimizations/DedupFilterPipeline/New/100K-4 10.48m 10.86m ~ 0.100
ReorgOptimizations/AllMarkFalse/Old/100K-4 1.124m 1.138m ~ 0.400
ReorgOptimizations/AllMarkFalse/New/100K-4 682.6µ 677.6µ ~ 0.700
ReorgOptimizations/HashSlicePool/Old/100K-4 682.7µ 717.7µ ~ 0.100
ReorgOptimizations/HashSlicePool/New/100K-4 290.8µ 318.3µ ~ 0.700
ReorgOptimizations/NodeFlags/Old/100K-4 54.43µ 56.04µ ~ 1.000
ReorgOptimizations/NodeFlags/New/100K-4 19.77µ 19.91µ ~ 0.700
TxMapSetIfNotExists-4 51.52n 51.21n ~ 0.100
TxMapSetIfNotExistsDuplicate-4 37.58n 37.84n ~ 0.300
ChannelSendReceive-4 662.6n 676.0n ~ 0.100
BlockAssembler_AddTx-4 0.02949n 0.03043n ~ 0.700
AddNode-4 12.63 12.35 ~ 0.400
AddNodeWithMap-4 13.14 12.83 ~ 0.200
CalcBlockWork-4 507.2n 503.6n ~ 0.700
CalculateWork-4 679.3n 671.5n ~ 0.100
BuildBlockLocatorString_Helpers/Size_10-4 1.278µ 1.263µ ~ 0.700
BuildBlockLocatorString_Helpers/Size_100-4 14.06µ 12.99µ ~ 0.400
BuildBlockLocatorString_Helpers/Size_1000-4 120.0µ 119.5µ ~ 0.100
CatchupWithHeaderCache-4 104.2m 104.2m ~ 1.000
_prepareTxsPerLevel-4 424.8m 407.4m ~ 0.100
_prepareTxsPerLevelOrdered-4 4.153m 3.991m ~ 1.000
_prepareTxsPerLevel_Comparison/Original-4 427.2m 434.1m ~ 0.400
_prepareTxsPerLevel_Comparison/Optimized-4 4.327m 4.052m ~ 0.700
SubtreeProcessor/100_tx_64_per_subtree-4 86.38m 88.23m ~ 0.200
SubtreeProcessor/500_tx_64_per_subtree-4 422.5m 429.1m ~ 1.000
SubtreeProcessor/500_tx_256_per_subtree-4 433.1m 438.6m ~ 0.400
SubtreeProcessor/1k_tx_64_per_subtree-4 827.1m 840.8m ~ 0.200
SubtreeProcessor/1k_tx_256_per_subtree-4 851.6m 864.2m ~ 0.100
StreamingProcessorPhases/FilterValidated/100_tx-4 2.982m 3.026m ~ 0.100
StreamingProcessorPhases/ClassifyProcess/100_tx-4 263.6µ 256.4µ ~ 0.100
StreamingProcessorPhases/FilterValidated/500_tx-4 14.05m 14.21m ~ 0.700
StreamingProcessorPhases/ClassifyProcess/500_tx-4 700.5µ 688.6µ ~ 0.100
StreamingProcessorPhases/FilterValidated/1k_tx-4 27.90m 28.75m ~ 0.100
StreamingProcessorPhases/ClassifyProcess/1k_tx-4 1.247m 1.222m ~ 0.100
SubtreeSizes/10k_tx_4_per_subtree-4 1.334m 1.287m ~ 0.100
SubtreeSizes/10k_tx_16_per_subtree-4 326.2µ 322.5µ ~ 0.700
SubtreeSizes/10k_tx_64_per_subtree-4 76.61µ 74.78µ ~ 0.100
SubtreeSizes/10k_tx_256_per_subtree-4 18.87µ 18.62µ ~ 0.100
SubtreeSizes/10k_tx_512_per_subtree-4 9.242µ 9.224µ ~ 0.700
SubtreeSizes/10k_tx_1024_per_subtree-4 4.602µ 4.587µ ~ 0.700
SubtreeSizes/10k_tx_2k_per_subtree-4 2.293µ 2.312µ ~ 0.400
BlockSizeScaling/10k_tx_64_per_subtree-4 73.01µ 73.71µ ~ 0.400
BlockSizeScaling/10k_tx_256_per_subtree-4 18.33µ 18.44µ ~ 1.000
BlockSizeScaling/10k_tx_1024_per_subtree-4 4.523µ 4.560µ ~ 1.000
BlockSizeScaling/50k_tx_64_per_subtree-4 396.1µ 386.2µ ~ 0.200
BlockSizeScaling/50k_tx_256_per_subtree-4 91.71µ 93.38µ ~ 1.000
BlockSizeScaling/50k_tx_1024_per_subtree-4 22.99µ 22.55µ ~ 0.700
SubtreeAllocations/small_subtrees_exists_check-4 164.2µ 162.6µ ~ 0.200
SubtreeAllocations/small_subtrees_data_fetch-4 167.4µ 166.3µ ~ 0.700
SubtreeAllocations/small_subtrees_full_validation-4 320.5µ 321.8µ ~ 0.400
SubtreeAllocations/medium_subtrees_exists_check-4 9.543µ 9.488µ ~ 0.700
SubtreeAllocations/medium_subtrees_data_fetch-4 9.873µ 9.968µ ~ 0.700
SubtreeAllocations/medium_subtrees_full_validation-4 18.21µ 18.14µ ~ 0.700
SubtreeAllocations/large_subtrees_exists_check-4 2.262µ 2.269µ ~ 0.700
SubtreeAllocations/large_subtrees_data_fetch-4 2.362µ 2.370µ ~ 1.000
SubtreeAllocations/large_subtrees_full_validation-4 4.719µ 4.685µ ~ 0.200
_BufferPoolAllocation/16KB-4 3.694µ 3.317µ ~ 0.700
_BufferPoolAllocation/32KB-4 7.421µ 8.253µ ~ 0.400
_BufferPoolAllocation/64KB-4 14.68µ 16.74µ ~ 0.100
_BufferPoolAllocation/128KB-4 30.44µ 30.03µ ~ 0.700
_BufferPoolAllocation/512KB-4 119.1µ 110.5µ ~ 0.100
_BufferPoolConcurrent/32KB-4 19.19µ 18.61µ ~ 0.100
_BufferPoolConcurrent/64KB-4 29.64µ 25.30µ ~ 0.100
_BufferPoolConcurrent/512KB-4 135.3µ 133.8µ ~ 0.200
_SubtreeDeserializationWithBufferSizes/16KB-4 595.7µ 589.2µ ~ 0.200
_SubtreeDeserializationWithBufferSizes/32KB-4 587.3µ 585.2µ ~ 0.100
_SubtreeDeserializationWithBufferSizes/64KB-4 585.9µ 585.8µ ~ 0.700
_SubtreeDeserializationWithBufferSizes/128KB-4 590.9µ 585.7µ ~ 0.400
_SubtreeDeserializationWithBufferSizes/512KB-4 587.1µ 586.9µ ~ 0.400
_SubtreeDataDeserializationWithBufferSizes/16KB-4 44.30m 43.34m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/32KB-4 43.87m 43.29m ~ 0.200
_SubtreeDataDeserializationWithBufferSizes/64KB-4 44.05m 42.87m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/128KB-4 43.38m 42.62m ~ 0.100
_SubtreeDataDeserializationWithBufferSizes/512KB-4 43.21m 42.61m ~ 0.100
_PooledVsNonPooled/Pooled-4 828.6n 830.1n ~ 0.400
_PooledVsNonPooled/NonPooled-4 6.302µ 6.483µ ~ 1.000
_MemoryFootprint/Current_512KB_32concurrent-4 6.524µ 6.497µ ~ 0.700
_MemoryFootprint/Proposed_32KB_32concurrent-4 8.949µ 8.900µ ~ 0.400
_MemoryFootprint/Alternative_64KB_32concurrent-4 9.097µ 9.020µ ~ 1.000
GetUtxoHashes-4 467.5n 464.6n ~ 1.000
GetUtxoHashes_ManyOutputs-4 90.18µ 90.72µ ~ 0.700
_NewMetaDataFromBytes-4 237.5n 237.1n ~ 0.800
_Bytes-4 858.5n 858.9n ~ 1.000
_MetaBytes-4 581.1n 570.2n ~ 0.700

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

@gokutheengineer gokutheengineer merged commit be499db into bsv-blockchain:main Mar 26, 2026
24 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.

2 participants