From e1f515557760deb89cdefa6d966312fb390546be Mon Sep 17 00:00:00 2001 From: Chris Wessels Date: Thu, 19 Dec 2024 17:38:48 +0000 Subject: [PATCH 1/2] fix(indexer-agent): align cli args with network spec behaviour --- packages/indexer-agent/src/commands/start.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/indexer-agent/src/commands/start.ts b/packages/indexer-agent/src/commands/start.ts index 08dc0a5ff..92a12f1b5 100644 --- a/packages/indexer-agent/src/commands/start.ts +++ b/packages/indexer-agent/src/commands/start.ts @@ -69,6 +69,7 @@ export const start = { 'Time (in seconds) after which transactions will be resubmitted with a higher gas price', type: 'number', default: 240, + coerce: x => x * 10 ** 3, group: 'Ethereum', }) .option('gas-increase-factor', { @@ -82,6 +83,7 @@ export const start = { description: 'The maximum gas price (gwei) to use for transactions', type: 'number', default: 100, + coerce: x => x * 10 ** 9, deprecated: true, group: 'Ethereum', }) @@ -90,6 +92,7 @@ export const start = { 'The maximum base fee per gas (gwei) to use for transactions, for legacy transactions this will be treated as the max gas price', type: 'number', required: false, + coerce: x => x * 10 ** 9, group: 'Ethereum', }) .option('transaction-attempts', { @@ -358,7 +361,7 @@ export async function createNetworkSpecification( gasIncreaseTimeout: argv.gasIncreaseTimeout, gasIncreaseFactor: argv.gasIncreaseFactor, gasPriceMax: argv.gasPriceMax, - baseFeePerGasMax: argv.baseFeeGasMax, + baseFeePerGasMax: argv.baseFeePerGasMax, maxTransactionAttempts: argv.maxTransactionAttempts, } @@ -682,13 +685,13 @@ export function reviewArgumentsForWarnings(argv: AgentOptions, logger: Logger) { if (gasIncreaseTimeout < advisedGasIncreaseTimeout) { logger.warn( `Gas increase timeout is set to less than ${ - gasIncreaseTimeout / 1000 - } seconds. This may lead to high gas usage`, - { gasIncreaseTimeout: gasIncreaseTimeout / 1000.0 }, + advisedGasIncreaseTimeout + } milliseconds. This may lead to high gas usage`, + { gasIncreaseTimeout: gasIncreaseTimeout }, ) } - if (gasIncreaseFactor > advisedGasIncreaseTimeout) { + if (gasIncreaseFactor > advisedGasIncreaseFactor) { logger.warn( `Gas increase factor is set to > ${advisedGasIncreaseFactor}. ` + 'This may lead to high gas usage', From 2619c4f631bad00c653a33617d4ad5f014ad4b1c Mon Sep 17 00:00:00 2001 From: Chris Wessels Date: Thu, 19 Dec 2024 17:42:16 +0000 Subject: [PATCH 2/2] fix(indexer-agent): gasIncreaseTimeout startup log --- packages/indexer-agent/src/commands/start.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/indexer-agent/src/commands/start.ts b/packages/indexer-agent/src/commands/start.ts index 92a12f1b5..dc7b5f44c 100644 --- a/packages/indexer-agent/src/commands/start.ts +++ b/packages/indexer-agent/src/commands/start.ts @@ -685,8 +685,8 @@ export function reviewArgumentsForWarnings(argv: AgentOptions, logger: Logger) { if (gasIncreaseTimeout < advisedGasIncreaseTimeout) { logger.warn( `Gas increase timeout is set to less than ${ - advisedGasIncreaseTimeout - } milliseconds. This may lead to high gas usage`, + advisedGasIncreaseTimeout / 1000 + } seconds. This may lead to high gas usage`, { gasIncreaseTimeout: gasIncreaseTimeout }, ) }