From f97ef50978fcae26c64ccba64d1f43ed9f2792fd Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 17 Dec 2024 14:03:31 -0600 Subject: [PATCH] fix: update hash format and use better sector/page size --- lib/db/sqlite/firo_cache_coordinator.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/db/sqlite/firo_cache_coordinator.dart b/lib/db/sqlite/firo_cache_coordinator.dart index 038668248..a002dc222 100644 --- a/lib/db/sqlite/firo_cache_coordinator.dart +++ b/lib/db/sqlite/firo_cache_coordinator.dart @@ -95,7 +95,8 @@ abstract class FiroCacheCoordinator { void Function(int countFetched, int totalCount)? progressUpdated, ) async { await _setLocks[network]!.protect(() async { - const sectorSize = 12000; // TODO adjust this? + const sectorSize = + 1500; // chosen as a somewhat decent value. Could be changed in the future if wanted/needed final prevMeta = await FiroCacheCoordinator.getLatestSetInfoForGroupId( groupId, network, @@ -128,7 +129,7 @@ abstract class FiroCacheCoordinator { final start = (i * sectorSize); final data = await client.getSparkAnonymitySetBySector( coinGroupId: groupId, - latestBlock: meta.blockHash.toHexReversedFromBase64, + latestBlock: meta.blockHash, startIndex: start, endIndex: start + sectorSize, ); @@ -140,7 +141,7 @@ abstract class FiroCacheCoordinator { if (remainder > 0) { final data = await client.getSparkAnonymitySetBySector( coinGroupId: groupId, - latestBlock: meta.blockHash.toHexReversedFromBase64, + latestBlock: meta.blockHash, startIndex: numberOfCoinsToFetch - remainder, endIndex: numberOfCoinsToFetch, );