Skip to content

Commit

Permalink
Fixes terminal ui errors (#1040)
Browse files Browse the repository at this point in the history
* skip historical sync more often

* chore: changeset
  • Loading branch information
kyscott18 authored Aug 16, 2024
1 parent 23b0c4f commit 1593d0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-steaks-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ponder/core": patch
---

Fixed a regression introduced in 0.5.9 that caused the terminal ui to error.
9 changes: 7 additions & 2 deletions packages/core/src/sync-historical/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,14 @@ export const createHistoricalSync = async (
// Compute the required interval to sync, accounting for cached
// intervals and start + end block.

// Skip sync if the interval is after the `toBlock`.
if (source.filter.toBlock && source.filter.toBlock < _interval[0])
// Skip sync if the interval is after the `toBlock` or before
// the `fromBlock`.
if (
source.filter.fromBlock > _interval[1] ||
(source.filter.toBlock && source.filter.toBlock < _interval[0])
) {
return;
}
const interval: Interval = [
Math.max(source.filter.fromBlock, _interval[0]),
Math.min(
Expand Down

0 comments on commit 1593d0c

Please sign in to comment.