From 52057c1a1a9838a91192a17026a8335873f4239c Mon Sep 17 00:00:00 2001 From: gmbronco <83549293+gmbronco@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:31:41 +0100 Subject: [PATCH] smaller log ranges for wallet balances syncing --- modules/user/lib/user-sync-gauge-balance.service.ts | 4 ++-- modules/user/lib/user-sync-wallet-balance.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/user/lib/user-sync-gauge-balance.service.ts b/modules/user/lib/user-sync-gauge-balance.service.ts index 82a529140..fcf8eb2a5 100644 --- a/modules/user/lib/user-sync-gauge-balance.service.ts +++ b/modules/user/lib/user-sync-gauge-balance.service.ts @@ -139,8 +139,8 @@ export class UserSyncGaugeBalanceService implements UserStakedBalanceService { therefore we check all transfer events since the last synced block */ - // Split the range into smaller chunks to avoid RPC limits, setting up to 50 times max block range - const toBlock = Math.min(startBlock + 50 * this.rpcMaxBlockRange, latestBlock); + // Split the range into smaller chunks to avoid RPC limits, setting up to 5 times max block range + const toBlock = Math.min(startBlock + 5 * this.rpcMaxBlockRange, latestBlock); console.log(`user-sync-staked-balances-${this.chainId} block range from ${startBlock} to ${toBlock}`); console.log(`user-sync-staked-balances-${this.chainId} getLogs for ${gaugeAddresses.length} gauges.`); diff --git a/modules/user/lib/user-sync-wallet-balance.service.ts b/modules/user/lib/user-sync-wallet-balance.service.ts index 94adb817c..d971d87e4 100644 --- a/modules/user/lib/user-sync-wallet-balance.service.ts +++ b/modules/user/lib/user-sync-wallet-balance.service.ts @@ -156,8 +156,8 @@ export class UserSyncWalletBalanceService { return; } - // Split the range into smaller chunks to avoid RPC limits, setting up to 50 times max block range - const toBlock = Math.min(fromBlock + 50 * this.rpcMaxBlockRange, latestBlock); + // Split the range into smaller chunks to avoid RPC limits, setting up to 5 times max block range + const toBlock = Math.min(fromBlock + 5 * this.rpcMaxBlockRange, latestBlock); console.log(`UserWalletBalanceService: syncing balances from ${fromBlock} to ${toBlock}`); console.log(`user-sync-wallet-balances-for-all-pools-${this.chainId} getLogs of ${poolAddresses.length} pools`);