Layr-Labs / hello-world-avs

Hello World AVS
MIT License
58 stars 53 forks source link

Start Operation for Type script not working on MacOS #25

Closed realchoubey closed 3 months ago

realchoubey commented 3 months ago

Issue:

To resolved I tried giving gasLimit with registerAsOperator function. Getting following issue below:

tsc && node dist/index.js
Error in main function: <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":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":49,\"error\":{\"code\":-32000,\"message\":\"intrinsic gas too high -- CallGasCostMoreThanGasLimit\"}}","error":{"code":-32000},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x59683d36\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0x691ade04ccb9e83d354372dbec2b9a93908a9bc6\",\"to\":\"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9\",\"data\":\"0x0f589e59000000000000000000000000691ade04ccb9e83d354372dbec2b9a93908a9bc60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":49,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://127.0.0.1:8545"}, tx={"data":"0x0f589e59000000000000000000000000691ade04ccb9e83d354372dbec2b9a93908a9bc60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000","to":{},"from":"0x691aDE04CcB9E83d354372DBEc2b9A93908a9BC6","type":2,"maxFeePerGas":{"type":"BigNumber","hex":"0x59683d36"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.7.0)
    at Logger.makeError (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/logger/lib/index.js:238:21)
    at Logger.throwError (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/logger/lib/index.js:247:20)
    at /Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/abstract-signer/lib/index.js:365:47
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 7) {
  reason: 'cannot estimate gas; transaction may fail or may require manual gas limit',
  code: 'UNPREDICTABLE_GAS_LIMIT',
  error: Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":49,\"error\":{\"code\":-32000,\"message\":\"intrinsic gas too high -- CallGasCostMoreThanGasLimit\"}}", error={"code":-32000}, requestBody="{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x59683d36\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0x691ade04ccb9e83d354372dbec2b9a93908a9bc6\",\"to\":\"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9\",\"data\":\"0x0f589e59000000000000000000000000691ade04ccb9e83d354372dbec2b9a93908a9bc60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":49,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://127.0.0.1:8545", code=SERVER_ERROR, version=web/5.7.1)
      at Logger.makeError (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/logger/lib/index.js:238:21)
      at Logger.throwError (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/logger/lib/index.js:247:20)
      at /Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:313:32
      at step (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:33:23)
      at Object.next (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:14:53)
      at fulfilled (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:5:58)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    reason: 'processing response error',
    code: 'SERVER_ERROR',
    body: '{"jsonrpc":"2.0","id":49,"error":{"code":-32000,"message":"intrinsic gas too high -- CallGasCostMoreThanGasLimit"}}',
    error: Error: intrinsic gas too high -- CallGasCostMoreThanGasLimit
        at getResult (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:191:21)
        at processJsonFunc (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:356:22)
        at /Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:288:46
        at step (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:33:23)
        at Object.next (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:14:53)
        at fulfilled (/Users/choubey/Documents/POCCode/hello-world-avs/node_modules/@ethersproject/web/lib/index.js:5:58)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
      code: -32000,
      data: undefined
    },
    requestBody: '{"method":"eth_estimateGas","params":[{"type":"0x2","maxFeePerGas":"0x59683d36","maxPriorityFeePerGas":"0x59682f00","from":"0x691ade04ccb9e83d354372dbec2b9a93908a9bc6","to":"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9","data":"0x0f589e59000000000000000000000000691ade04ccb9e83d354372dbec2b9a93908a9bc60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"}],"id":49,"jsonrpc":"2.0"}',
    requestMethod: 'POST',
    url: 'http://127.0.0.1:8545'
  },
  tx: {
    data: '0x0f589e59000000000000000000000000691ade04ccb9e83d354372dbec2b9a93908a9bc60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
    to: Promise { '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' },
    from: '0x691aDE04CcB9E83d354372DBEc2b9A93908a9BC6',
    type: 2,
    maxFeePerGas: BigNumber { _hex: '0x59683d36', _isBigNumber: true },
    maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
    nonce: Promise { 0 },
    gasLimit: Promise { <rejected> [Circular *1] },
    chainId: Promise { 31337 }
  }
}
wawrzek commented 3 months ago

Hmmm, it works for me. At least I think it does ;-) Could you please post all the commands you run, so I can compare?

wawrzek commented 3 months ago

Now, it doesn't work. I'm pretty sure it worked yesterday.

The command which fails is:

make start-operator
wawrzek commented 3 months ago

I checked and my fork (which is well behind) still works for me: https://github.com/ivy-net/hello-world-avs

wawrzek commented 3 months ago

And it does not work on Linux for me as well.

Reecepbcups commented 3 months ago

Confirming: does not work on Linux for me either

Did a git bisect & seems 0f0c17d67de4c66dd26ed3927bea89a99349f848 is the bad commit (excluding the ones where the old rpc-holesky.rockx.com was used)

vaniiiii commented 3 months ago

This PR fixed it for me.

Gajesh2007 commented 3 months ago

just merged. try again now.

add 0x to ur private key in .env

Gajesh2007 commented 3 months ago

https://github.com/Layr-Labs/hello-world-avs/commit/c49ece411b7f3c2ad45b0c2fe4d0710041e0d8cb