From 404cdf64d0c972c655e2581cc1874b0f214f8887 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 9 May 2025 13:21:58 +0200 Subject: [PATCH 1/4] fix(apps/price_pusher): handle gas overrides properly --- apps/price_pusher/package.json | 2 +- apps/price_pusher/src/evm/command.ts | 1 - apps/price_pusher/src/evm/evm.ts | 13 +++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/price_pusher/package.json b/apps/price_pusher/package.json index a29842140d..ae9f213d9a 100644 --- a/apps/price_pusher/package.json +++ b/apps/price_pusher/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/price-pusher", - "version": "9.3.3", + "version": "9.3.4", "description": "Pyth Price Pusher", "homepage": "https://pyth.network", "main": "lib/index.js", diff --git a/apps/price_pusher/src/evm/command.ts b/apps/price_pusher/src/evm/command.ts index 044b274fcf..c965e7b6ad 100644 --- a/apps/price_pusher/src/evm/command.ts +++ b/apps/price_pusher/src/evm/command.ts @@ -110,7 +110,6 @@ export default { enableMetrics, metricsPort, } = argv; - console.log("***** priceServiceEndpoint *****", priceServiceEndpoint); const logger = pino({ level: logLevel, diff --git a/apps/price_pusher/src/evm/evm.ts b/apps/price_pusher/src/evm/evm.ts index 744fc638a0..9533b238a4 100644 --- a/apps/price_pusher/src/evm/evm.ts +++ b/apps/price_pusher/src/evm/evm.ts @@ -235,6 +235,12 @@ export class EvmPricePusher implements IPricePusher { const priceIdsWith0x = priceIds.map((priceId) => addLeading0x(priceId)); + // Update lastAttempt + this.lastPushAttempt = { + nonce: txNonce, + gasPrice: gasPrice, + }; + try { const { request } = await this.pythContract.simulate.updatePriceFeedsIfNecessary( @@ -383,18 +389,13 @@ export class EvmPricePusher implements IPricePusher { ); throw err; } - - // Update lastAttempt - this.lastPushAttempt = { - nonce: txNonce, - gasPrice: gasPrice, - }; } private async waitForTransactionReceipt(hash: `0x${string}`): Promise { try { const receipt = await this.client.waitForTransactionReceipt({ hash: hash, + timeout: 10000, }); switch (receipt.status) { From 8f6a6d285e940b127fbc836aeb7c7161f99a8fdc Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 9 May 2025 13:23:48 +0200 Subject: [PATCH 2/4] chore: update berachain rpc --- contract_manager/store/chains/EvmChains.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract_manager/store/chains/EvmChains.yaml b/contract_manager/store/chains/EvmChains.yaml index 13a980989c..343393f05c 100644 --- a/contract_manager/store/chains/EvmChains.yaml +++ b/contract_manager/store/chains/EvmChains.yaml @@ -857,7 +857,7 @@ - id: berachain_mainnet mainnet: true networkId: 80094 - rpcUrl: https://fluent-thrilling-scion.furtim-network.quiknode.pro/$ENV_RABECHAIN_API_KEY + rpcUrl: https://rpc.berachain.com type: EvmChain - id: story mainnet: true From 3e1a1edc0895ed4a28f61a55468fd0fcfe458c72 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 9 May 2025 13:54:56 +0200 Subject: [PATCH 3/4] chore: discourage using confidence check --- apps/price_pusher/README.md | 8 ++++---- apps/price_pusher/price-config.beta.sample.yaml | 6 +++--- apps/price_pusher/price-config.stable.sample.yaml | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/price_pusher/README.md b/apps/price_pusher/README.md index 882b6a872f..51f0838fac 100644 --- a/apps/price_pusher/README.md +++ b/apps/price_pusher/README.md @@ -27,7 +27,7 @@ It then pushes a price update to an on-chain Pyth contract if any of the followi - Price deviation: The latest Pyth price feed has changed more than `price_deviation` percent from the on-chain price feed price. - Confidence ratio: The latest Pyth price feed has confidence to price ratio of more than - `confidence_ratio`. + `confidence_ratio`. *We discourage using low values for this because it triggers push for every update in high confidence periods.* The parameters above are configured per price feed in a price configuration YAML file. The structure looks like this: @@ -36,7 +36,7 @@ The parameters above are configured per price feed in a price configuration YAML id: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef # id of a price feed, a 32-byte hex string. time_difference: 60 # Time difference threshold (in seconds) to push a newer price feed. price_deviation: 0.5 # The price deviation (%) threshold to push a newer price feed. - confidence_ratio: 1 # The confidence/price (%) threshold to push a newer price feed. + confidence_ratio: 50 # The confidence/price (%) threshold to push a newer price feed. # Optional block to configure whether this feed can be early updated. If at least one feed meets the # triggering conditions above, all other feeds who meet the early update conditions will be included in @@ -46,7 +46,7 @@ The parameters above are configured per price feed in a price configuration YAML early_update: time_difference: 30 price_deviation: 0.1 - confidence_ratio: 0.5 + confidence_ratio: 5 - ... ``` @@ -65,7 +65,7 @@ the feed. early_update: time_difference: 30 price_deviation: 0.1 - confidence_ratio: 0.5 + confidence_ratio: 5 ``` Two sample YAML configuration files are available in the root of this repo. diff --git a/apps/price_pusher/price-config.beta.sample.yaml b/apps/price_pusher/price-config.beta.sample.yaml index 8861eb844d..28e8a029ae 100644 --- a/apps/price_pusher/price-config.beta.sample.yaml +++ b/apps/price_pusher/price-config.beta.sample.yaml @@ -2,13 +2,13 @@ id: f9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b time_difference: 60 price_deviation: 0.5 - confidence_ratio: 1 + confidence_ratio: 100 - alias: BNB/USD id: ecf553770d9b10965f8fb64771e93f5690a182edc32be4a3236e0caaa6e0581a time_difference: 60 price_deviation: 1 - confidence_ratio: 1 + confidence_ratio: 100 early_update: time_difference: 30 price_deviation: 0.5 - confidence_ratio: 0.1 + confidence_ratio: 10 diff --git a/apps/price_pusher/price-config.stable.sample.yaml b/apps/price_pusher/price-config.stable.sample.yaml index c63bb9400d..7ac2866ae1 100644 --- a/apps/price_pusher/price-config.stable.sample.yaml +++ b/apps/price_pusher/price-config.stable.sample.yaml @@ -2,18 +2,18 @@ id: e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 time_difference: 60 price_deviation: 0.5 - confidence_ratio: 1 + confidence_ratio: 100 - alias: BNB/USD id: 2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f time_difference: 60 price_deviation: 1 - confidence_ratio: 1 + confidence_ratio: 100 early_update: time_difference: 30 price_deviation: 0.5 - confidence_ratio: 0.1 + confidence_ratio: 10 - alias: PYTH/USD id: 0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff time_difference: 60 price_deviation: 0.5 - confidence_ratio: 1 + confidence_ratio: 100 From 8ecb6d15c28e2fa42a7d32faf0c9f644ee43ba9f Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 9 May 2025 14:00:30 +0200 Subject: [PATCH 4/4] fix: remove the timeout that was added by mistake --- apps/price_pusher/src/evm/evm.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/price_pusher/src/evm/evm.ts b/apps/price_pusher/src/evm/evm.ts index 9533b238a4..8dbf9ab05f 100644 --- a/apps/price_pusher/src/evm/evm.ts +++ b/apps/price_pusher/src/evm/evm.ts @@ -395,7 +395,6 @@ export class EvmPricePusher implements IPricePusher { try { const receipt = await this.client.waitForTransactionReceipt({ hash: hash, - timeout: 10000, }); switch (receipt.status) {