Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexer-agent: align cli args behaviour with network specification behaviour #1067

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 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
advisedGasIncreaseTimeout / 1000
} seconds. This may lead to high gas usage`,
{ gasIncreaseTimeout: gasIncreaseTimeout / 1000.0 },
{ 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
Loading