I have an autotask attached to a relayer to execute a function once a week, then send a notification to Slack with the transaction hash.
...
const tx = await checkpointerContract.connect(signer).checkpointGaugesAboveRelativeWeight(CHECKPOINTING_THRESHOLD, {value: ethers.utils.parseEther(MAX_ETH_TO_BRIDGE)});
console.log(tx);
const { notificationClient } = context;
try {
notificationClient.send({
channelAlias: '#defender-alerts',
subject: 'Mainnet gauges checkpointed',
message: 'Transaction hash: ' + tx.hash + '; threshold: ' + CHECKPOINTING_THRESHOLD
});
} catch (error) {
console.error('Failed to send notification', error);
}
This morning, the autotask ran correctly but the console logs and the notification print out an invalid transaction hash
Logs
AUTOTASK START
2023-07-27T00:05:30.248Z INFO {
chainId: 1,
hash: '0x4dcbe5232c1baed1f20c76e718b2b51b0aef9d08c23207f41b9048e4c21662d0',
transactionId: '3a80f3bb-6dca-4ff1-b607-5b286521353d',
value: BigNumber { _hex: '0x016345785d8a0000', _isBigNumber: true },
gasLimit: BigNumber { _hex: '0xa59db8', _isBigNumber: true },
to: '0x343688C5cB92115a52cA485af7f62B4B7A2e9CcC',
from: '0xe9735f7d85a57bfb860c1e2c1c7b4f587ba0f6e7',
data: '0xd14cfe3b000000000000000000000000000000000000000000000000000110d9316ec000',
nonce: 49,
status: 'sent',
speed: 'fast',
validUntil: '2023-07-27T08:05:29.512Z',
createdAt: '2023-07-27T00:05:30.070Z',
sentAt: '2023-07-27T00:05:30.070Z',
pricedAt: '2023-07-27T00:05:30.070Z',
isPrivate: true,
maxFeePerGas: BigNumber { _hex: '0x0b7f54b003', _isBigNumber: true },
maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
wait: [Function (anonymous)]
}
2023-07-27T00:05:30.248Z INFO Sending slack notification with id: '....'. Message: Transaction hash: 0x4dcbe5232c1baed1f20c76e718b2b51b0aef9d08c23207f41b9048e4c21662d0; threshold: 300000000000000
END RequestId: b1dfbee5-d5a2-4e10-970a-421fa2310fe9
AUTOTASK COMPLETE
2023-07-27T00:05:41.541Z INFO Notification with id: '....' was sent successfully.
The actual hash of the submitted transaction is this one
There are no retries programmed into the autotask that could have caused the second hash, it only ran once, and the keys to the relayer only exist in Defender. Where did that invalid tx.hash come from?