使用Chainlink Functions调用OpenAI API遇UNPREDICTABLE_GAS_LIMIT错误求助
基于去年Constellation的仓库及YouTube教程测试Chainlink Functions调用OpenAI API时,运行scripts文件夹中的04_request.js脚本遇到如下错误:
reason: 'cannot estimate gas; transaction may fail or may require manual gas limit',
code: 'UNPREDICTABLE_GAS_LIMIT'
完整错误堆栈信息:
Error making the Functions Request : <ref *1> 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":{"reason":"processing response error","code":"SERVER_ERROR","body":"{"jsonrpc":"2.0","id":1,"error":{"code":3,"message":"execution reverted","data":"0x1d70f87a00000000000000000000000000000000000000000000000000000000000493e0"}}","error":{"code":3,"data":"0x1d70f87a00000000000000000000000000000000000000000000000000000000000493e0"},"requestBody":"0x////very long data/////","requestMethod":"POST","url":"https://api-sepolia.etherscan.io/api"},"method":"estimateGas","transaction":{"from":"0xd83Cb0fe58Afc5A54fa7771ea988CdF3E1d89730","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x1d28c1e9e8"},"to":"0x266d3f1df7fc27047e1a38eBAFa6B71bf5c6b391","data":"0x///very long data////","to":{},"from":"0xd83Cb0fe58Afc5A54fa7771ea988CdF3E1d89730","type":2,"maxFeePerGas":{"type":"BigNumber","hex":"0x1d28c1e9e8"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.7.0)
已尝试以下操作但问题未解决:
- 更换为Alchemy RPC URL
- 修改
connection.js中的provider为Etherscan Provider:
const provider = new providers.EtherscanProvider("sepolia",process.env.ETHERSCAN_API_KEY);
补充信息:
encryptedSecretsRef由scripts文件夹中的03_secrets.js生成- 钱包地址为
0xd83Cb0fe58Afc5A54fa7771ea988CdF3E1d89730
内容的提问来源于stack exchange,提问作者user25283432

