diff --git a/src/server/utils/transaction.ts b/src/server/utils/transaction.ts index fd299924b..46337ab7d 100644 --- a/src/server/utils/transaction.ts +++ b/src/server/utils/transaction.ts @@ -87,6 +87,7 @@ export const cancelTransactionAndUpdate = async ({ data: "0x", value: "0x00", nonce: txData.nonce!, + ...gasOverrides, maxFeePerGas: BigNumber.from(gasOverrides.maxFeePerGas).mul(2), maxPriorityFeePerGas: BigNumber.from( gasOverrides.maxPriorityFeePerGas, diff --git a/src/worker/tasks/retryTx.ts b/src/worker/tasks/retryTx.ts index 98a7c50e2..b54985ed9 100644 --- a/src/worker/tasks/retryTx.ts +++ b/src/worker/tasks/retryTx.ts @@ -1,6 +1,5 @@ import { getDefaultGasOverrides } from "@thirdweb-dev/sdk"; import { ethers } from "ethers"; -import { BigNumber } from "ethers/lib/ethers"; import { prisma } from "../../db/client"; import { getConfiguration } from "../../db/configuration/getConfiguration"; import { getTxToRetry } from "../../db/transactions/getTxToRetry"; @@ -45,10 +44,6 @@ export const retryTx = async () => { // TODO: We should still retry anyway const gasOverrides = await getDefaultGasOverrides(sdk.getProvider()); - if (gasOverrides.maxFeePerGas?.lte(BigNumber.from(tx.maxFeePerGas))) { - // If the current blockchain gas fees are lower than the transaction, wait - return; - } if (tx.retryGasValues) { // If a retry has been triggered manually @@ -77,6 +72,9 @@ export const retryTx = async () => { nonce: tx.nonce!, value: tx.value!, ...gasOverrides, + gasPrice: gasOverrides.gasPrice?.mul(2), + maxFeePerGas: gasOverrides.maxFeePerGas?.mul(2), + maxPriorityFeePerGas: gasOverrides.maxPriorityFeePerGas?.mul(2), }); } catch (err: any) { logger.worker.warn(