diff --git a/apps/price_pusher/package.json b/apps/price_pusher/package.json index 9154bfdf4..9eab91c87 100644 --- a/apps/price_pusher/package.json +++ b/apps/price_pusher/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/price-pusher", - "version": "8.0.3", + "version": "8.0.4", "description": "Pyth Price Pusher", "homepage": "https://pyth.network", "main": "lib/index.js", diff --git a/apps/price_pusher/src/solana/solana.ts b/apps/price_pusher/src/solana/solana.ts index 3df7a6b32..49d686a81 100644 --- a/apps/price_pusher/src/solana/solana.ts +++ b/apps/price_pusher/src/solana/solana.ts @@ -15,6 +15,8 @@ import { SearcherClient } from "jito-ts/dist/sdk/block-engine/searcher"; import { sliceAccumulatorUpdateData } from "@pythnetwork/price-service-sdk"; import { Logger } from "pino"; +const HEALTH_CHECK_TIMEOUT_SECONDS = 60; + export class SolanaPriceListener extends ChainPriceListener { constructor( private pythSolanaReceiver: PythSolanaReceiver, @@ -35,7 +37,17 @@ export class SolanaPriceListener extends ChainPriceListener { const blockTime = await this.pythSolanaReceiver.connection.getBlockTime( slot ); - if (blockTime === null || blockTime < Date.now() / 1000 - 50) { + if ( + blockTime === null || + blockTime < Date.now() / 1000 - HEALTH_CHECK_TIMEOUT_SECONDS + ) { + if (blockTime !== null) { + this.logger.info( + `Solana connection is behind by ${ + Date.now() / 1000 - blockTime + } seconds` + ); + } throw new Error("Solana connection is unhealthy"); } }