PeformUpkeep does not execute when checkUpkeep returns true using Chainlink automation

260 views Asked by At

We are using a custom logic automation. when checking checkUpkeep the boolean returns true (pic attached) but our perform upkeep doesn't run. It is calling another function to run that cost rougly 50k to 100k in gas (when run manually) What are we missing? (p.s. when we do a simple toggle function call the performUpkeep works - but not our function). I've even put the gas up to 2,500,000 for testing using a timebased option as well (calling a specific function to execute same logic). Here is the repo https://github.com/billyjitsu/expir3/tree/main/packages/backend/contracts

WE are expecting when the checkUpkeep returns true to execute the upkeep

1

There are 1 answers

2
Frank Kong On

In order to solve the problem like "Why Chainlink checkUpkeep does not execute", I suggest doing the following things to debug your upkeep.

  1. Since checkUpkeep and performUpkeep are both triggered by Chainlink automation, you need to check your automation subscription first. In the automation app, double check the contract address is correct.
  2. Because the chainlink node has to change the state of blockchain(call performUpkeep in your consumer contract), it has to pay the gas fee. It is important to make sure there is a minimum balance of LINK in your subscription.
  3. Test if checkUpkeep works as expected. If the pre-defined condition for automation is satisfied in your smart contract, checkUpkeep should return true. Chainlink automation only calls performUpkeep when checkUpkeep returns true, so the upkeep does not work if checkUpkeep cannot return true. Call checkUpkeep by yourself to test if it works properly. If you cannot get true as returned value, automation cannot get true either.
  4. Test if performUpkeep works as expected. The mechanism of Chainlink automation is to call performUpkeep when checkUpkeep returns true, so you must make sure the performUpkeep can be called by automation. Try to call the performUpkeep manually to see if it works properly.

Hope it helps!