From 944f59ee838ac7c537179e94ba95c6a18092d267 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:39:56 +0000 Subject: [PATCH 1/4] feat(price_pusher): add gas-price override option for EVM price pusher Co-Authored-By: Ali Behjati --- apps/price_pusher/src/evm/command.ts | 9 ++++++++- apps/price_pusher/src/evm/evm.ts | 9 ++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/price_pusher/src/evm/command.ts b/apps/price_pusher/src/evm/command.ts index 37bd5daede..40f0967c41 100644 --- a/apps/price_pusher/src/evm/command.ts +++ b/apps/price_pusher/src/evm/command.ts @@ -61,6 +61,11 @@ export default { type: "number", required: false, } as Options, + "gas-price": { + description: "Override the gas price that would be received from the RPC", + type: "number", + required: false, + } as Options, "update-fee-multiplier": { description: "Multiplier for the fee to update the price. It is useful in networks " + @@ -94,6 +99,7 @@ export default { overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, gasLimit, + gasPrice, updateFeeMultiplier, logLevel, controllerLogLevel, @@ -167,7 +173,8 @@ export default { overrideGasPriceMultiplierCap, updateFeeMultiplier, gasLimit, - gasStation + gasStation, + gasPrice ); const controller = new Controller( diff --git a/apps/price_pusher/src/evm/evm.ts b/apps/price_pusher/src/evm/evm.ts index 7101a1792c..737f96e56c 100644 --- a/apps/price_pusher/src/evm/evm.ts +++ b/apps/price_pusher/src/evm/evm.ts @@ -136,7 +136,8 @@ export class EvmPricePusher implements IPricePusher { private overrideGasPriceMultiplierCap: number, private updateFeeMultiplier: number, private gasLimit?: number, - private customGasStation?: CustomGasStation + private customGasStation?: CustomGasStation, + private gasPrice?: number ) {} // The pubTimes are passed here to use the values that triggered the push. @@ -187,8 +188,10 @@ export class EvmPricePusher implements IPricePusher { // are using this to remain compatible with the networks that doesn't // support this transaction type. let gasPrice = - Number(await this.customGasStation?.getCustomGasPrice()) || - Number(await this.client.getGasPrice()); + this.gasPrice !== undefined + ? this.gasPrice + : Number(await this.customGasStation?.getCustomGasPrice()) || + Number(await this.client.getGasPrice()); // Try to re-use the same nonce and increase the gas if the last tx is not landed yet. if (this.pusherAddress === undefined) { From 13e0eda8de748c04a029975968d7e87361ffd1e0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 15:53:56 +0000 Subject: [PATCH 2/4] chore(price_pusher): bump version from 9.0.1 to 9.1.0 Co-Authored-By: Ali Behjati --- apps/price_pusher/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/price_pusher/package.json b/apps/price_pusher/package.json index 277f901caa..ebae2094c0 100644 --- a/apps/price_pusher/package.json +++ b/apps/price_pusher/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/price-pusher", - "version": "9.0.1", + "version": "9.1.0", "description": "Pyth Price Pusher", "homepage": "https://pyth.network", "main": "lib/index.js", From 5738b2d6af4c578a0fbcdda2cc720fc0fb7e3af7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:37:27 +0000 Subject: [PATCH 3/4] refactor(price_pusher): use nullish coalescing for gas price Co-Authored-By: Ali Behjati --- apps/price_pusher/src/evm/evm.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/price_pusher/src/evm/evm.ts b/apps/price_pusher/src/evm/evm.ts index 737f96e56c..8f8b22e2fd 100644 --- a/apps/price_pusher/src/evm/evm.ts +++ b/apps/price_pusher/src/evm/evm.ts @@ -188,10 +188,11 @@ export class EvmPricePusher implements IPricePusher { // are using this to remain compatible with the networks that doesn't // support this transaction type. let gasPrice = - this.gasPrice !== undefined - ? this.gasPrice - : Number(await this.customGasStation?.getCustomGasPrice()) || - Number(await this.client.getGasPrice()); + this.gasPrice ?? + Number( + await (this.customGasStation?.getCustomGasPrice() ?? + this.client.getGasPrice()) + ); // Try to re-use the same nonce and increase the gas if the last tx is not landed yet. if (this.pusherAddress === undefined) { From 30146d3c4af1161d1a586b81755f5e55b4b5c17e Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Thu, 27 Feb 2025 14:36:30 +0100 Subject: [PATCH 4/4] chore(apps/price_pusher): update readme --- apps/price_pusher/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/price_pusher/README.md b/apps/price_pusher/README.md index f9eaa41d8c..76256c41ce 100644 --- a/apps/price_pusher/README.md +++ b/apps/price_pusher/README.md @@ -101,7 +101,10 @@ pnpm run start evm --endpoint wss://example-rpc.com \ --mnemonic-file "path/to/mnemonic.txt" \ [--pushing-frequency 10] \ [--polling-frequency 5] \ - [--override-gas-price-multiplier 1.1] + [--override-gas-price-multiplier 1.1] \ + [--override-gas-price-multiplier-cap 5] \ + [--gas-limit 1000000] \ + [--gas-price 160000000] # For Injective pnpm run start injective --grpc-endpoint https://grpc-endpoint.com \