From 08be0a63cace63202c5adc0bc2223e989cc57074 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 9 Jan 2023 19:44:36 -0500 Subject: [PATCH 1/2] Reenable the debug tx for logging --- src/utils/network-monitor.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils/network-monitor.ts b/src/utils/network-monitor.ts index 6e97e47b..adc83a77 100644 --- a/src/utils/network-monitor.ts +++ b/src/utils/network-monitor.ts @@ -1925,6 +1925,21 @@ export class NetworkMonitor { txHash = keccak256(signedTx) } + // TODO: Reenable after figuring out what is causing the BigNumber error in value + // const debugTx = { + // to: populatedTx.to, + // from: populatedTx.from, + // nonce: populatedTx.nonce, + // data: populatedTx.data, + // value: BigNumber.from(populatedTx.value ?? 0).toNumber(), + // gasLimit: BigNumber.from(populatedTx.gasLimit).toNumber(), + // gasPrice: gasPricing.isEip1559 ? 0 : formatUnits(BigNumber.from(populatedTx.gasPrice), 'gwei'), + // maxFeePerGas: gasPricing.isEip1559 ? formatUnits(BigNumber.from(populatedTx.maxFeePerGas), 'gwei') : 0, + // maxPriorityFeePerGas: gasPricing.isEip1559 + // ? formatUnits(BigNumber.from(populatedTx.maxPriorityFeePerGas), 'gwei') + // : 0, + // } + // this.structuredLog(network, 'Attempting to send transaction -> ' + JSON.stringify(debugTx), tags) this.structuredLog(network, 'Attempting to send transaction -> ' + JSON.stringify(populatedTx), tags) tx = await this.providers[network].sendTransaction(signedTx) if (tx === null) { From 84d7787531c2f261f0a7c3d502cb87bc85d1ae74 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 9 Jan 2023 22:21:52 -0500 Subject: [PATCH 2/2] Add the human readable logs back with the tx details --- src/utils/network-monitor.ts | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/utils/network-monitor.ts b/src/utils/network-monitor.ts index adc83a77..9de3e27f 100644 --- a/src/utils/network-monitor.ts +++ b/src/utils/network-monitor.ts @@ -1925,22 +1925,21 @@ export class NetworkMonitor { txHash = keccak256(signedTx) } - // TODO: Reenable after figuring out what is causing the BigNumber error in value - // const debugTx = { - // to: populatedTx.to, - // from: populatedTx.from, - // nonce: populatedTx.nonce, - // data: populatedTx.data, - // value: BigNumber.from(populatedTx.value ?? 0).toNumber(), - // gasLimit: BigNumber.from(populatedTx.gasLimit).toNumber(), - // gasPrice: gasPricing.isEip1559 ? 0 : formatUnits(BigNumber.from(populatedTx.gasPrice), 'gwei'), - // maxFeePerGas: gasPricing.isEip1559 ? formatUnits(BigNumber.from(populatedTx.maxFeePerGas), 'gwei') : 0, - // maxPriorityFeePerGas: gasPricing.isEip1559 - // ? formatUnits(BigNumber.from(populatedTx.maxPriorityFeePerGas), 'gwei') - // : 0, - // } - // this.structuredLog(network, 'Attempting to send transaction -> ' + JSON.stringify(debugTx), tags) - this.structuredLog(network, 'Attempting to send transaction -> ' + JSON.stringify(populatedTx), tags) + // Transform tx details to be human readable and log them + const txDetails = { + to: populatedTx.to, + from: populatedTx.from, + nonce: populatedTx.nonce, + data: populatedTx.data, + value: BigNumber.from(populatedTx.value ?? 0).toNumber(), + gasLimit: BigNumber.from(populatedTx.gasLimit ?? 0).toNumber(), + gasPrice: gasPricing.isEip1559 ? 0 : formatUnits(BigNumber.from(populatedTx.gasPrice ?? 0), 'gwei'), + maxFeePerGas: gasPricing.isEip1559 ? formatUnits(BigNumber.from(populatedTx.maxFeePerGas ?? 0), 'gwei') : 0, + maxPriorityFeePerGas: gasPricing.isEip1559 + ? formatUnits(BigNumber.from(populatedTx.maxPriorityFeePerGas ?? 0), 'gwei') + : 0, + } + this.structuredLog(network, 'Attempting to send transaction -> ' + JSON.stringify(txDetails), tags) tx = await this.providers[network].sendTransaction(signedTx) if (tx === null) { counter++