Skip to content

Commit

Permalink
use processed reference slot
Browse files Browse the repository at this point in the history
  • Loading branch information
mschneider committed Aug 7, 2024
1 parent 321056d commit 0afee18
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ts/client/scripts/sb-on-demand-crank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async function setupBackgroundRefresh(
const startedAt = Date.now();
const [block, slot] = await Promise.all([
client.connection.getLatestBlockhash('finalized'),
client.connection.getSlot('finalized'),
client.connection.getSlot('processed'),
]);

await updateFilteredOraclesAis(
Expand Down Expand Up @@ -373,8 +373,7 @@ async function filterForStaleOracles(
// maxStaleness will usually be 250 (=100s)
// one iteration takes 10s, retry is every 20s
// this allows for 2 retries until the oracle becomes stale
slot - res.lastUpdatedSlot >
item.decodedPullFeed.maxStaleness * 0.3
diff > item.decodedPullFeed.maxStaleness * 0.3
) {
console.log(
`[filter stale] ${item.oracle.name}, candidate, ${item.decodedPullFeed.maxStaleness}, ${slot}, ${res.lastUpdatedSlot}, ${diff}`,
Expand Down

0 comments on commit 0afee18

Please sign in to comment.