I have defender autotask running every 10 mins and have only 1 transaction to execute.
The defender sometimes shows a success message in the console but the transaction would have failed on the blockchain and when I try to invoke a transaction manually right after the failure and it succeeds. Can I know the reason why this happens?
Also, I see we are getting out of gas error in explorer, are you invoking the transaction with higher gas limits with defender autotask?
We tried to debug the issue from our end and it works absolutely fine without any errors.
Sharing a few of the failed transaction links here
Thanks for the reply.
I've mailed the details to the specified mail id.
Also, the relayer was configured within the Defender console as a corn job autotask.
It looks like this autotask is using ethers.js to create a contract and make the function call. Without an explicit gasLimit defined, an estimate is used, but this can have issues, for instance if the function is non-gas deterministic, such as:
function someFunction() public {
for(uint256 i = 0; i < someInternalState.length; i++){
...
}
}
I'd recommend setting the gasLimit explicitly as an option to the contract method (you could provide 20% more than the estimated gas for instance to be safe).