Issue with Arbitrum Rinkeby relayer

We seem to have problems with our relayer on Arbitrum testnet since the upgrade to nitro.
Which endpoint is being used on the Openzeppelin side? We have a specific call that does not work and the Arbitrum team suggests to use their own RPC endpoint.

Specific error:

error={\"code\":3,\"data\":\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000\"}, method=\"estimateGas\", transaction={\"from\":\"0x45eF9a0a9BA58a90e59b45E318d0c8130B51bD5b\",\"to\":\"0x6890BAbDf66987020E0C73036BE94423919b40f8\",\"data\":\"0x69942aa8\",\"accessList\":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.5.2)","code":"UNPREDICTABLE_GAS_LIMIT","reason":"cannot estimate gas; transaction may fail or may require manual gas limit","error":{"errorType":"Error","errorMessage":"execution reverted: BattleflyAtlasStaker: Executed less than 24h ago","code":3,"data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000","stack":["Error: execution reverted: BattleflyAtlasStaker: Executed less than 24h ago"

Note that this call works on https://rinkeby.arbitrum.io/rpc

Relayer address is 0x45ef9a0a9ba58a90e59b45e318d0c8130b51bd5b

@Archethect_Archethec one thing I see in that error message is a revert message that appears to be from a contract:

BattleflyAtlasStaker: Executed less than 24h

Perhaps there is some kind of rate limiting for this call within the contract?

If that does not help identify the issue, can you please provide more information such as:

  • Full parameters for this call (excluding signature data)
  • How you are making it within Defender (UI vs. API)
  • If it is a call to the API, the body of the call would be helpful

Thanks,

Dan McKeon
OpenZeppelin

@dan_oz Yes there is some rate limiting going on, but it should actually not trigger right now.
The exact code is the following:

     * @dev Execute the daily cron job to deposit funds to AtlasMine & claim emissions from AtlasMine
     *      The Battlefly CRON BOT will use this function to execute deposit/claim.
     */
    function startHarvestAndDistribute() external onlyBattleflyBot {
        require(block.timestamp >= nextExecution, "BattleflyAtlasStaker: Executed less than 24h ago");
        // set to 24 hours - 5 minutes to take blockchain tx delays into account.
        nextExecution = block.timestamp + 86100;
        accruedEpochEmission = 0;
    }

nextExecution in our case is equal to 1659052509, which is lower than the block.timestamp.
We are doing the call with Defender UI through an autotask (identifier: 126a3476-13a8-4af7-864a-349c22c44c7d).

Could it be that one of the RPC endpoints Openzeppelin is using is not synced correctly and therefore has an incorrect block.timestamp? It's remarkable that this call returns a correct gasEstimate for it through https://rinkeby.arbitrum.io/rpc

log details:

{
  "trigger": "manual",
  "tenantId": "34ecea0f-0647-44f1-9b2b-0e82cd32b959",
  "message": "Invoke Error \t{\"errorType\":\"Error\",\"errorMessage\":\"cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={\\\"reason\\\":\\\"cannot estimate gas; transaction may fail or may require manual gas limit\\\",\\\"code\\\":\\\"UNPREDICTABLE_GAS_LIMIT\\\",\\\"error\\\":{\\\"code\\\":3,\\\"data\\\":\\\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000\\\"},\\\"method\\\":\\\"estimateGas\\\",\\\"transaction\\\":{\\\"from\\\":\\\"0x45eF9a0a9BA58a90e59b45E318d0c8130B51bD5b\\\",\\\"to\\\":\\\"0x6890BAbDf66987020E0C73036BE94423919b40f8\\\",\\\"data\\\":\\\"0x69942aa8\\\",\\\"accessList\\\":null}}, tx={\\\"data\\\":\\\"0x69942aa8\\\",\\\"to\\\":{},\\\"from\\\":\\\"0x45ef9a0a9ba58a90e59b45e318d0c8130b51bd5b\\\",\\\"gasLimit\\\":{},\\\"speed\\\":\\\"fast\\\"}, code=UNPREDICTABLE_GAS_LIMIT, version=defender-relay-client)\",\"code\":\"UNPREDICTABLE_GAS_LIMIT\",\"reason\":\"cannot estimate gas; transaction may fail or may require manual gas limit\",\"error\":{\"errorType\":\"Error\",\"errorMessage\":\"cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={\\\"code\\\":3,\\\"data\\\":\\\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000\\\"}, method=\\\"estimateGas\\\", transaction={\\\"from\\\":\\\"0x45eF9a0a9BA58a90e59b45E318d0c8130B51bD5b\\\",\\\"to\\\":\\\"0x6890BAbDf66987020E0C73036BE94423919b40f8\\\",\\\"data\\\":\\\"0x69942aa8\\\",\\\"accessList\\\":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.5.2)\",\"code\":\"UNPREDICTABLE_GAS_LIMIT\",\"reason\":\"cannot estimate gas; transaction may fail or may require manual gas limit\",\"error\":{\"errorType\":\"Error\",\"errorMessage\":\"execution reverted: BattleflyAtlasStaker: Executed less than 24h ago\",\"code\":3,\"data\":\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000\",\"stack\":[\"Error: execution reverted: BattleflyAtlasStaker: Executed less than 24h ago\",\"    at DefenderRelayProvider.send (/opt/nodejs/node_modules/defender-relay-client/lib/ethers/provider.js:58:31)\",\"    at processTicksAndRejections (internal/process/task_queues.js:97:5)\"]},\"method\":\"estimateGas\",\"transaction\":{\"from\":\"0x45eF9a0a9BA58a90e59b45E318d0c8130B51bD5b\",\"to\":\"0x6890BAbDf66987020E0C73036BE94423919b40f8\",\"data\":\"0x69942aa8\",\"accessList\":null},\"stack\":[\"Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={\\\"code\\\":3,\\\"data\\\":\\\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000\\\"}, method=\\\"estimateGas\\\", transaction={\\\"from\\\":\\\"0x45eF9a0a9BA58a90e59b45E318d0c8130B51bD5b\\\",\\\"to\\\":\\\"0x6890BAbDf66987020E0C73036BE94423919b40f8\\\",\\\"data\\\":\\\"0x69942aa8\\\",\\\"accessList\\\":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.5.2)\",\"    at Logger.makeError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:233:21)\",\"    at Logger.throwError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:242:20)\",\"    at checkError (/opt/nodejs/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:126:16)\",\"    at DefenderRelayProvider.<anonymous> (/opt/nodejs/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:659:47)\",\"    at step (/opt/nodejs/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)\",\"    at Object.throw (/opt/nodejs/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)\",\"    at rejected (/opt/nodejs/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)\",\"    at processTicksAndRejections (internal/process/task_queues.js:97:5)\"]},\"tx\":{\"data\":\"0x69942aa8\",\"to\":{},\"from\":\"0x45ef9a0a9ba58a90e59b45e318d0c8130b51bd5b\",\"gasLimit\":{},\"speed\":\"fast\"},\"stack\":[\"Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={\\\"reason\\\":\\\"cannot estimate gas; transaction may fail or may require manual gas limit\\\",\\\"code\\\":\\\"UNPREDICTABLE_GAS_LIMIT\\\",\\\"error\\\":{\\\"code\\\":3,\\\"data\\\":\\\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000\\\"},\\\"method\\\":\\\"estimateGas\\\",\\\"transaction\\\":{\\\"from\\\":\\\"0x45eF9a0a9BA58a90e59b45E318d0c8130B51bD5b\\\",\\\"to\\\":\\\"0x6890BAbDf66987020E0C73036BE94423919b40f8\\\",\\\"data\\\":\\\"0x69942aa8\\\",\\\"accessList\\\":null}}, tx={\\\"data\\\":\\\"0x69942aa8\\\",\\\"to\\\":{},\\\"from\\\":\\\"0x45ef9a0a9ba58a90e59b45e318d0c8130b51bd5b\\\",\\\"gasLimit\\\":{},\\\"speed\\\":\\\"fast\\\"}, code=UNPREDICTABLE_GAS_LIMIT, version=defender-relay-client)\",\"    at Logger.makeError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:233:21)\",\"    at Logger.throwError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:242:20)\",\"    at /opt/nodejs/node_modules/defender-relay-client/lib/ethers/signer.js:140:31\",\"    at processTicksAndRejections (internal/process/task_queues.js:97:5)\",\"    at async Promise.all (index 3)\"]}",
  "subjectName": "BattleflyAtlasStaker Harvest All (Testnet)",
  "requestId": "f784bab4-9bcc-46ea-968f-7fce2e595ec1",
  "error": "cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={\"reason\":\"cannot estimate gas; transaction may fail or may require manual gas limit\",\"code\":\"UNPREDICTABLE_GAS_LIMIT\",\"error\":{\"code\":3,\"data\":\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030426174746c65666c7941746c61735374616b65723a204578656375746564206c657373207468616e203234682061676f00000000000000000000000000000000\"},\"method\":\"estimateGas\",\"transaction\":{\"from\":\"0x45eF9a0a9BA58a90e59b45E318d0c8130B51bD5b\",\"to\":\"0x6890BAbDf66987020E0C73036BE94423919b40f8\",\"data\":\"0x69942aa8\",\"accessList\":null}}, tx={\"data\":\"0x69942aa8\",\"to\":{},\"from\":\"0x45ef9a0a9ba58a90e59b45e318d0c8130b51bd5b\",\"gasLimit\":{},\"speed\":\"fast\"}, code=UNPREDICTABLE_GAS_LIMIT, version=defender-relay-client)",
  "autotaskRunId": "62076b3e-6fc1-4dac-903f-16675be93116",
  "component": "autotask",
  "event": "executed",
  "level": "error",
  "subjectId": "126a3476-13a8-4af7-864a-349c22c44c7d",
  "logId": "2022-07-30T09:06:53.837Z#001|h4zZzDbj",
  "timestamp": "2022-07-30T09:06:53.837Z"
}

Addressed this on Contract not longer retrieving the last info on Arbitrum Rinkeby - #3 by dan_oz