Skip to content

Commit

Permalink
fix(indexer-agent): align cli args with network spec behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswessels authored Dec 19, 2024
1 parent 2e336b2 commit e1f5155
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/indexer-agent/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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',
})
Expand All @@ -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', {
Expand Down Expand Up @@ -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,
}

Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit e1f5155

Please sign in to comment.