Skip to content

Commit

Permalink
config updates + retry update (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhanW3 authored Feb 29, 2024
1 parent cff0201 commit fef7cd9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/db/configuration/getConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ export const getConfiguration = async (): Promise<Config> => {
maxTxsToProcess: 30,
minedTxListenerCronSchedule: "*/5 * * * * *",
maxTxsToUpdate: 50,
retryTxListenerCronSchedule: "*/30 * * * * *",
minEllapsedBlocksBeforeRetry: 15,
retryTxListenerCronSchedule: "*/10 * * * * *",
minEllapsedBlocksBeforeRetry: 4,
maxFeePerGasForRetries: ethers.utils
.parseUnits("1000", "gwei")
.toString(),
Expand Down
1 change: 1 addition & 0 deletions src/db/transactions/getTxToRetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ WHERE
AND "transactionHash" IS NOT NULL
AND "retryCount" < ${config.maxRetriesPerTx}
ORDER BY
"sentAt",
"nonce"
ASC
LIMIT
Expand Down
30 changes: 15 additions & 15 deletions src/worker/tasks/retryTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ export const retryTx = async () => {
}

const gasOverrides = await getGasSettingsForRetry(tx, provider);
if (
gasOverrides.maxFeePerGas?.gt(config.maxFeePerGasForRetries) ||
gasOverrides.maxPriorityFeePerGas?.gt(
config.maxPriorityFeePerGasForRetries,
)
) {
// Return if gas settings exceed configured limits. Try again later.
logger({
service: "worker",
level: "warn",
queueId: tx.id,
message: `${tx.chainId} chain gas price is higher than maximum threshold.`,
});
return;
}
// if (
// gasOverrides.maxFeePerGas?.gt(config.maxFeePerGasForRetries) ||
// gasOverrides.maxPriorityFeePerGas?.gt(
// config.maxPriorityFeePerGasForRetries,
// )
// ) {
// // Return if gas settings exceed configured limits. Try again later.
// logger({
// service: "worker",
// level: "warn",
// queueId: tx.id,
// message: `${tx.chainId} chain gas price is higher than maximum threshold.`,
// });
// return;
// }

logger({
service: "worker",
Expand Down

0 comments on commit fef7cd9

Please sign in to comment.