Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/server/utils/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions src/worker/tasks/retryTx.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down