Skip to content

Commit f1c8493

Browse files
feat: added gas multiplier arg for injective (#2104)
* feat: added gas multiplier arg for injective * chore: update default gas price * chore: bump version --------- Co-authored-by: Ali Behjati <bahjatia@gmail.com>
1 parent c4774b0 commit f1c8493

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

apps/price_pusher/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ pnpm run start injective --grpc-endpoint https://grpc-endpoint.com \
105105
--price-config-file "path/to/price-config.beta.sample.yaml" \
106106
--mnemonic-file "path/to/mnemonic.txt" \
107107
--network testnet \
108-
[--gas-price 500000000] \
108+
[--gas-price 160000000] \
109+
[--gas-multiplier 1.1] \
109110
[--pushing-frequency 10] \
110111
[--polling-frequency 5]
111112

apps/price_pusher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-pusher",
3-
"version": "8.0.4",
3+
"version": "8.1.0",
44
"description": "Pyth Price Pusher",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

apps/price_pusher/src/injective/command.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export default {
3030
description: "Gas price to be used for each transasction",
3131
type: "number",
3232
} as Options,
33+
"gas-multiplier": {
34+
description: "Gas multiplier to be used for each transasction",
35+
type: "number",
36+
} as Options,
3337
...options.priceConfigFile,
3438
...options.priceServiceEndpoint,
3539
...options.mnemonicFile,
@@ -44,6 +48,7 @@ export default {
4448
// FIXME: type checks for this
4549
const {
4650
gasPrice,
51+
gasMultiplier,
4752
grpcEndpoint,
4853
priceConfigFile,
4954
priceServiceEndpoint,
@@ -101,6 +106,7 @@ export default {
101106
{
102107
chainId: getNetworkInfo(network).chainId,
103108
gasPrice,
109+
gasMultiplier,
104110
}
105111
);
106112

apps/price_pusher/src/injective/injective.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import {
2222
import { Logger } from "pino";
2323
import { Account } from "@injectivelabs/sdk-ts/dist/cjs/client/chain/types/auth";
2424

25-
const DEFAULT_GAS_PRICE = 500000000;
25+
const DEFAULT_GAS_PRICE = 160000000;
26+
const DEFAULT_GAS_MULTIPLIER = 1.05;
27+
const INJECTIVE_TESTNET_CHAIN_ID = "injective-888";
2628

2729
type PriceQueryResponse = {
2830
price_feed: {
@@ -108,8 +110,8 @@ export class InjectivePricePusher implements IPricePusher {
108110
this.wallet = PrivateKey.fromMnemonic(mnemonic);
109111

110112
this.chainConfig = {
111-
chainId: chainConfig?.chainId ?? "injective-888",
112-
gasMultiplier: chainConfig?.gasMultiplier ?? 1.2,
113+
chainId: chainConfig?.chainId ?? INJECTIVE_TESTNET_CHAIN_ID,
114+
gasMultiplier: chainConfig?.gasMultiplier ?? DEFAULT_GAS_MULTIPLIER,
113115
gasPrice: chainConfig?.gasPrice ?? DEFAULT_GAS_PRICE,
114116
};
115117
}

target_chains/cosmwasm/tools/src/chains-manager/injective.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
} from "@injectivelabs/networks";
3535
import * as net from "net";
3636

37-
const DEFAULT_GAS_PRICE = 500000000;
37+
const DEFAULT_GAS_PRICE = 160000000;
3838

3939
export class InjectiveExecutor implements ChainExecutor {
4040
private readonly gasMultiplier = 2;

target_chains/cosmwasm/tools/src/ci/deployer/injective.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ export class InjectiveDeployer implements Deployer {
8787
const txResponse = await this.signAndBroadcastMsg(store_code, {
8888
amount: [
8989
{
90-
// gas = 5000000 & gasPrice = 500000000
91-
amount: String(500000000 * 5000000),
90+
// gas = 5000000 & gasPrice = 160000000
91+
amount: String(160000000 * 5000000),
9292
denom: "inj",
9393
},
9494
],
95-
// DEFAULT STD FEE that we use has gas = 400000 and gasPrice = 500000000
95+
// DEFAULT STD FEE that we use has gas = 400000 and gasPrice = 160000000
9696
// But this transaction was taking gas around 3000000. Which is a lot more
9797
// Keeping the gasPrice same as in default std fee as seen above in amount.
9898
// Changing the gasLimit to 5000000

0 commit comments

Comments
 (0)