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

common: Improve gas fee and price logging in TransactionManager #954

Merged
merged 1 commit into from
Jul 12, 2024
Merged
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
10 changes: 5 additions & 5 deletions packages/indexer-common/src/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,15 @@ export class TransactionManager {
.sub(feeData.maxPriorityFeePerGas!)
.div(2)
if (baseFeePerGas.toNumber() >= this.adjustedBaseFeePerGasMax) {
if (attempt == 1) {
if (attempt === 1) {
logger.warning(
`Max base fee per gas has been reached, waiting until the base fee falls below to resume transaction execution.`,
{ maxBaseFeePerGas: this.specification.baseFeePerGasMax, baseFeePerGas },
)
} else {
logger.info(`Base gas fee per gas estimation still above max threshold`, {
maxBaseFeePerGas: this.specification.baseFeePerGasMax,
baseFeePerGas,
baseFeePerGas: baseFeePerGas.toNumber(),
priceEstimateAttempt: attempt,
})
}
Expand All @@ -293,18 +293,18 @@ export class TransactionManager {
// Legacy transaction type
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
if (feeData.gasPrice!.toNumber() >= this.adjustedBaseFeePerGasMax) {
if (attempt == 1) {
if (attempt === 1) {
logger.warning(
`Max gas price has been reached, waiting until gas price estimates fall below to resume transaction execution.`,
{
baseFeePerGasMax: this.specification.baseFeePerGasMax,
currentGasPriceEstimate: feeData.gasPrice,
currentGasPriceEstimate: feeData.gasPrice!.toNumber(),
},
)
} else {
logger.info(`Gas price estimation still above max threshold`, {
baseFeePerGasMax: this.specification.baseFeePerGasMax,
currentGasPriceEstimate: feeData.gasPrice,
currentGasPriceEstimate: feeData.gasPrice!.toNumber(),
priceEstimateAttempt: attempt,
})
}
Expand Down
Loading