Skip to content

Commit

Permalink
Handle edge case where RPC has inconsitent edge blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrés Elizondo committed Nov 7, 2024
1 parent c8ae27b commit 1aa8b11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/scripts/pull_and_save_block_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ export class BlockEventsScraper {
if (lastKnownBlock.blockNumber === currentBlockNumber) {
logger.debug('No new block, waiting until next interval');
return;
} else if (lastKnownBlock.blockNumber >= currentBlockNumber) {
logger.debug('RPC node is lagging, waiting until next interval');
return;
}

const blockRangeStart = lastKnownBlock.blockNumber + 1;
Expand Down

0 comments on commit 1aa8b11

Please sign in to comment.