Skip to content

fix(subtreevalidation): repair test compile break on main from #799/#1065 cross-merge#1076

Merged
oskarszoon merged 1 commit into
bsv-blockchain:mainfrom
oskarszoon:fix/subtreevalidation-test-compile
Jun 11, 2026
Merged

fix(subtreevalidation): repair test compile break on main from #799/#1065 cross-merge#1076
oskarszoon merged 1 commit into
bsv-blockchain:mainfrom
oskarszoon:fix/subtreevalidation-test-compile

Conversation

@oskarszoon

Copy link
Copy Markdown
Contributor

What

Main does not compile in services/subtreevalidation test code. Cross-PR semantic conflict:

No textual conflict, both merged green individually. Result: go vet / golangci-lint fails on main, and every PR that syncs with main inherits the failure (first noticed on #1074, a docs PR).

Fix

Pass nil for the new parameter at the three call sites, matching the pattern in the already-updated tests in the same package (SubtreeValidation_test.go uses nilConsumer, nilConsumer, nil, nil).

Verification

  • go vet ./services/subtreevalidation/: clean (fails on current main)
  • go test -race -tags testtxmetacache -run "TestLegacyUnconfirmedParent_RealValidatorIntegration|TestCheckSubtreeFromBlockLegacyUnconfirmedParents" ./services/subtreevalidation/: pass

…and New signatures

PR bsv-blockchain#799 added a policyRejectedTx Kafka producer/consumer parameter to
validator.New and subtreevalidation.New. PR bsv-blockchain#1065 added these test files
on a branch based before bsv-blockchain#799 merged, calling the old signatures. Both
merged without textual conflict, leaving main uncompilable in
services/subtreevalidation test code — every PR syncing with main now
fails golangci-lint/vet.

Pass nil for the new parameter at the three call sites, matching the
pattern used by the already-updated tests in the same package.
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Status: Complete

Current Review:

No issues found. This is a correct, minimal test-only fix for the cross-PR semantic conflict described.

  • The new nil in validator.New(...) correctly fills the policyRejectedTxKafkaProducerClient slot (position 7), consistent with the validator package's own tests which use nil, nil, nil, blockAssemblyClient, nil.
  • The new nil in both subtreevalidation.New(...) calls correctly fills the policyRejectedTxConsumerClient slot, producing nilConsumer, nilConsumer, nil, nil — identical to the existing call sites in SubtreeValidation_test.go.

Parameter ordering verified against the current signatures in services/validator/Validator.go:196 and services/subtreevalidation/Server.go:175. Changes are scoped to test files only.

@oskarszoon oskarszoon enabled auto-merge (squash) June 11, 2026 14:26
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Comparison Report

Baseline: main (unknown)

Current: PR-1076 (bc7bb9e)

Summary

  • Regressions: 0
  • Improvements: 0
  • Unchanged: 83
  • Significance level: p < 0.05
All benchmark results (sec/op)
Benchmark Baseline Current Change p-value
_NewBlockFromBytes-4 1.608µ 1.610µ ~ 1.000
SplitSyncedParentMap_SetIfNotExists/256_buckets-4 71.05n 71.16n ~ 0.400
SplitSyncedParentMap_SetIfNotExists/16_buckets-4 71.20n 71.32n ~ 0.700
SplitSyncedParentMap_SetIfNotExists/1_bucket-4 71.11n 71.12n ~ 1.000
SplitSyncedParentMap_ConcurrentSetIfNotExists/256_buckets... 33.07n 33.04n ~ 1.000
SplitSyncedParentMap_ConcurrentSetIfNotExists/16_buckets_... 56.12n 56.80n ~ 0.400
SplitSyncedParentMap_ConcurrentSetIfNotExists/1_bucket_pa... 127.0n 125.1n ~ 0.200
MiningCandidate_Stringify_Short-4 218.0n 218.9n ~ 0.400
MiningCandidate_Stringify_Long-4 1.606µ 1.631µ ~ 0.100
MiningSolution_Stringify-4 846.3n 848.8n ~ 1.000
BlockInfo_MarshalJSON-4 1.734µ 1.722µ ~ 0.100
NewFromBytes-4 146.1n 150.8n ~ 0.700
AddTxBatchColumnar_Validation-4 2.467µ 2.492µ ~ 1.000
OffsetValidationLoop-4 636.8n 635.2n ~ 1.000
Mine_EasyDifficulty-4 61.09µ 61.07µ ~ 0.700
Mine_WithAddress-4 7.131µ 7.105µ ~ 1.000
BlockAssembler_AddTx-4 0.02848n 0.02654n ~ 1.000
AddNode-4 10.69 10.63 ~ 1.000
AddNodeWithMap-4 11.87 11.79 ~ 0.400
DiskTxMap_SetIfNotExists-4 3.688µ 3.568µ ~ 1.000
DiskTxMap_SetIfNotExists_Parallel-4 3.380µ 3.387µ ~ 1.000
DiskTxMap_ExistenceOnly-4 373.1n 377.4n ~ 1.000
Queue-4 198.3n 204.4n ~ 0.100
AtomicPointer-4 4.533n 4.423n ~ 1.000
TxMapSetIfNotExists-4 52.30n 53.07n ~ 0.100
TxMapSetIfNotExistsDuplicate-4 40.23n 39.85n ~ 0.700
ChannelSendReceive-4 585.2n 599.6n ~ 0.100
DirectSubtreeAdd/4_per_subtree-4 58.71n 57.42n ~ 0.100
DirectSubtreeAdd/64_per_subtree-4 29.03n 28.98n ~ 0.400
DirectSubtreeAdd/256_per_subtree-4 27.80n 28.53n ~ 0.200
DirectSubtreeAdd/1024_per_subtree-4 26.60n 26.52n ~ 0.700
DirectSubtreeAdd/2048_per_subtree-4 26.11n 26.16n ~ 0.300
SubtreeProcessorAdd/4_per_subtree-4 242.3n 241.1n ~ 0.400
SubtreeProcessorAdd/64_per_subtree-4 238.3n 239.0n ~ 0.500
SubtreeProcessorAdd/256_per_subtree-4 235.4n 239.6n ~ 0.100
SubtreeProcessorAdd/1024_per_subtree-4 233.8n 230.1n ~ 0.700
SubtreeProcessorAdd/2048_per_subtree-4 225.9n 226.4n ~ 0.100
SubtreeProcessorRotate/4_per_subtree-4 228.8n 228.0n ~ 0.300
SubtreeProcessorRotate/64_per_subtree-4 230.3n 227.1n ~ 0.200
SubtreeProcessorRotate/256_per_subtree-4 228.0n 226.6n ~ 0.700
SubtreeProcessorRotate/1024_per_subtree-4 227.5n 230.0n ~ 0.200
SubtreeNodeAddOnly/4_per_subtree-4 55.65n 55.43n ~ 0.300
SubtreeNodeAddOnly/64_per_subtree-4 36.08n 36.27n ~ 0.100
SubtreeNodeAddOnly/256_per_subtree-4 35.08n 35.18n ~ 0.100
SubtreeNodeAddOnly/1024_per_subtree-4 34.49n 34.61n ~ 0.400
SubtreeCreationOnly/4_per_subtree-4 111.2n 110.6n ~ 0.700
SubtreeCreationOnly/64_per_subtree-4 353.7n 368.6n ~ 0.700
SubtreeCreationOnly/256_per_subtree-4 1.239µ 1.287µ ~ 0.100
SubtreeCreationOnly/1024_per_subtree-4 3.824µ 3.798µ ~ 1.000
SubtreeCreationOnly/2048_per_subtree-4 7.000µ 6.978µ ~ 1.000
SubtreeProcessorOverheadBreakdown/64_per_subtree-4 228.3n 230.1n ~ 0.700
SubtreeProcessorOverheadBreakdown/1024_per_subtree-4 227.8n 231.1n ~ 0.100
ParallelGetAndSetIfNotExists/1k_nodes-4 8.948m 11.455m ~ 0.100
ParallelGetAndSetIfNotExists/10k_nodes-4 13.37m 12.72m ~ 0.100
ParallelGetAndSetIfNotExists/50k_nodes-4 16.78m 16.14m ~ 0.100
ParallelGetAndSetIfNotExists/100k_nodes-4 20.18m 20.17m ~ 0.400
SequentialGetAndSetIfNotExists/1k_nodes-4 8.605m 8.786m ~ 0.100
SequentialGetAndSetIfNotExists/10k_nodes-4 14.28m 14.34m ~ 1.000
SequentialGetAndSetIfNotExists/50k_nodes-4 29.18m 29.70m ~ 0.100
SequentialGetAndSetIfNotExists/100k_nodes-4 45.18m 46.11m ~ 0.400
ProcessOwnBlockSubtreeNodesParallel/1k_nodes-4 9.463m 11.693m ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/10k_nodes-4 17.32m 20.01m ~ 0.100
ProcessOwnBlockSubtreeNodesParallel/100k_nodes-4 20.96m 20.56m ~ 0.100
ProcessOwnBlockSubtreeNodesSequential/1k_nodes-4 12.60m 13.59m ~ 1.000
ProcessOwnBlockSubtreeNodesSequential/10k_nodes-4 18.50m 17.64m ~ 0.100
ProcessOwnBlockSubtreeNodesSequential/100k_nodes-4 86.18m 78.83m ~ 0.100
CalcBlockWork-4 537.6n 514.5n ~ 1.000
CalculateWork-4 697.2n 706.7n ~ 0.100
CheckOldBlockIDs/on-chain-prefetch/1000-4 70.68µ 65.37µ ~ 1.000
CheckOldBlockIDs/off-chain-prefetch/1000-4 48.55µ 48.89µ ~ 1.000
CheckOldBlockIDs/on-chain-prefetch/10000-4 435.1µ 435.0µ ~ 1.000
CheckOldBlockIDs/off-chain-prefetch/10000-4 349.4µ 345.8µ ~ 1.000
BuildBlockLocatorString_Helpers/Size_10-4 1.408µ 1.367µ ~ 0.100
BuildBlockLocatorString_Helpers/Size_100-4 13.80µ 13.09µ ~ 0.100
BuildBlockLocatorString_Helpers/Size_1000-4 134.3µ 129.0µ ~ 0.100
CatchupWithHeaderCache-4 104.6m 104.7m ~ 0.400
StoreBlock_Sequential/BelowCSVHeight-4 315.5µ 316.4µ ~ 0.200
StoreBlock_Sequential/AboveCSVHeight-4 316.8µ 318.2µ ~ 0.700
GetUtxoHashes-4 280.5n 281.0n ~ 1.000
GetUtxoHashes_ManyOutputs-4 46.56µ 46.36µ ~ 0.400
_NewMetaDataFromBytes-4 215.8n 214.4n ~ 1.000
_Bytes-4 393.9n 403.3n ~ 0.100
_MetaBytes-4 138.7n 139.5n ~ 0.200

Threshold: >10% with p < 0.05 | Generated: 2026-06-11 14:32 UTC

@oskarszoon oskarszoon merged commit 5dd44a0 into bsv-blockchain:main Jun 11, 2026
34 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.

3 participants