Merge pull request #1270 from nuttycom/remove_10_block_range_limit

Remove the 10-block range limit for during sandblasting.
This commit is contained in:
Kris Nuttycombe 2023-09-18 10:02:19 -06:00 committed by GitHub
commit 7b64b62483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 15 deletions

View File

@ -49,8 +49,7 @@ extension BlockScannerImpl: BlockScanner {
let previousScannedHeight = lastScannedHeight
let startHeight = previousScannedHeight + 1
// TODO: [#576] remove this arbitrary batch size https://github.com/zcash/ZcashLightClientKit/issues/576
let batchSize = scanBatchSize(startScanHeight: startHeight, network: config.networkType)
let batchSize = UInt32(config.scanningBatchSize)
let scanStartTime = Date()
do {
@ -87,17 +86,4 @@ extension BlockScannerImpl: BlockScanner {
return lastScannedHeight
}
private func scanBatchSize(startScanHeight height: BlockHeight, network: NetworkType) -> UInt32 {
assert(config.scanningBatchSize > 0, "ZcashSDK.DefaultScanningBatch must be larger than 0!")
guard network == .mainnet else { return UInt32(config.scanningBatchSize) }
if height > 1_650_000 {
// librustzcash thread saturation at a number of blocks
// that contains 100 * num_cores Sapling outputs.
return UInt32(max(ProcessInfo().activeProcessorCount, 10))
}
return UInt32(config.scanningBatchSize)
}
}