2

In chainlink keepers document here. There is a conf called checkGasLimit with 6,500,000 as the default value.

Since the computation in checkUpKeep is expected to be outsourced off-chain, why there is a configuration called checkGasLimit where computation is off-chain?

Or checkGasLimit is for the situation where function checkUpKeep is supposed to modify some state.

Frank Kong
  • 1,010
  • 1
  • 20
  • 32

1 Answers1

1

You got it!

checkUpkeep can be used to change the state of the blockchain. The Chainlink nodes will call the checkUpkeep function when it returns true - and if it costs gas, it will use gas.

The use of the checkGasLimit then, is to make sure they don't use too much gas. Per the docs:

The maximum amount of gas that can be used by your checkUpkeep for off-chain computation.

Patrick Collins
  • 5,621
  • 3
  • 26
  • 64
  • If checkUpkeep is for off-chain compute, how does it change the state of the blockchain? Or does off chain compute also have the ability to make on-chain changes to state? – ZeusLawyer Jun 03 '22 at 01:58
  • Hi @ZeusLawyer, I believe you can use checkUpKeep to change the state of the blockchain. Chainlink node does not care if the checkUpKeep changes the state or not, the node just call performUpKeep if the checkUpkeep returns true. – Frank Kong Jun 06 '22 at 01:17
  • additional information on how the offchain simulation works and the role of the check gas limit configuration parameter can be found in @RoundAboutPi's detailed answer to another question [here](https://ethereum.stackexchange.com/questions/133319/are-chainlink-keepers-a-security-liability) – ZeusLawyer Aug 16 '22 at 04:22