diff --git a/indexer/services/ender/__tests__/caches/block-cache.test.ts b/indexer/services/ender/__tests__/caches/block-cache.test.ts index f9c22a8dde..303b61541b 100644 --- a/indexer/services/ender/__tests__/caches/block-cache.test.ts +++ b/indexer/services/ender/__tests__/caches/block-cache.test.ts @@ -60,7 +60,7 @@ describe('block-cache', () => { [true, 'block.height == currentBlockHeight', '2', false], [false, 'block.height == currentBlockHeight + 1', '3', false], [false, 'block.height == currentBlockHeight + 1 with refresh', '4', true], - [false, 'block.height >= currentBlockHeight + 1 with refresh', '5', true], + [true, 'block.height >= currentBlockHeight + 1 with refresh', '5', true], ])('returns %s when %s', async ( skip: boolean, _condition: string, diff --git a/indexer/services/ender/src/caches/block-cache.ts b/indexer/services/ender/src/caches/block-cache.ts index 38ca2891a7..27bcbab224 100644 --- a/indexer/services/ender/src/caches/block-cache.ts +++ b/indexer/services/ender/src/caches/block-cache.ts @@ -54,6 +54,12 @@ export async function shouldSkipBlock( }); return true; } else if (isNextBlock(blockHeight)) { + logger.info({ + at: 'block-cache#shouldSkipBlock', + message: 'Block will be processed', + blockHeight, + currentBlockHeight, + }); return false; } else if (canRefreshCache) { const previousBlockHeight: string = getCurrentBlockHeight(); @@ -78,7 +84,7 @@ export async function shouldSkipBlock( currentlyProcessingBlockHeight: blockHeight, alreadyProcessedBlockHeight: getCurrentBlockHeight(), }); - return false; + return true; } function blockAlreadyProcessed(blockHeight: string): boolean {