Skip to content

Commit

Permalink
[#1364] Increase BLOCKS_METADATA_BUFFER_SIZE
Browse files Browse the repository at this point in the history
- Closes #1364
- Filed another related improvement issue #1555
- Changelog update
  • Loading branch information
HonzaR committed Aug 7, 2024
1 parent f4086a1 commit b9eee46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`onCriticalErrorHandler` in case any error occurs
- Block synchronization logic now works above batch of blocks with size 1000 blocks instead of just 100 blocks
except the Zcash sandblasting period in which batch size of 100 blocks is still used
- The internal `FileCompactBlockRepository.BLOCKS_METADATA_BUFFER_SIZE` constant has been raised from 10 to 1000 to
match the block synchronization batch size. The overall speed-up of the entire block synchronization logic is about
50%.
- Checkpoints update

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ internal class FileCompactBlockRepository(
*/
const val BLOCK_FILENAME_SUFFIX = "-compactblock"

// TODO [#1555]: Keep BLOCKS_METADATA_BUFFER_SIZE the same as current SYNC_BATCH_SIZE
// TODO [#1555]: https://github.com/Electric-Coin-Company/zcash-android-wallet-sdk/issues/1555
/**
* The size of block meta data buffer
*
* Note: we should keep this size as close as possible to [CompactBlockProcessor.SYNC_BATCH_SIZE]
*/
const val BLOCKS_METADATA_BUFFER_SIZE = 10
const val BLOCKS_METADATA_BUFFER_SIZE = 1000

/**
* @param blockCacheRoot The root directory for the compact block cache (contains the database and a
Expand Down

0 comments on commit b9eee46

Please sign in to comment.