Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returned error: invalid address: 0x0000000000000000000000000000000000000000 #95

Closed
gupadhyaya opened this issue Jun 8, 2021 · 5 comments
Assignees

Comments

@gupadhyaya
Copy link
Contributor

Running harmony localnet or node using ganache-cli is broken. Could be due to this change.

This error is similar to truffle deploy error as reported in this post. For the truffle error, temporary work around was passing -- skip-dry-run option or specifying skipDryRun: true in the truffle network config.

Steps to reproduce:

  • run harmony node (localnet or actual node)
  • spin up ganache-cli for that node
    ganache-cli -f http://localhost:9500 --networkId 1666700000
  • try to deploy a contract by wrapping ganache url into web3: let web3 = new Web3(<ganache url>), you will get the error as follows:
Error: Returned error: Returned error: invalid address: 0x0000000000000000000000000000000000000000
    at Object.ErrorResponse (/Users/gupadhyaya/demo/node_modules/web3-core-helpers/lib/errors.js:28:19)
    at /Users/gupadhyaya/demo/node_modules/web3-core-requestmanager/lib/index.js:303:36
    at XMLHttpRequest.request.onreadystatechange (/Users/gupadhyaya/demo/node_modules/web3-providers-http/lib/index.js:98:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/gupadhyaya/demo/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (/Users/gupadhyaya/demo/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpResponseEnd (/Users/gupadhyaya/demo/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
    at IncomingMessage.<anonymous> (/Users/gupadhyaya/demo/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
    at IncomingMessage.emit (node:events:381:22)
    at endReadableNT (node:internal/streams/readable:1307:12)
    at processTicksAndRejections (node:internal/process/task_queues:81:21) {
  data: {
    stack: 'Error: Returned error: invalid address: 0x0000000000000000000000000000000000000000\n' +
      '    at Object.ErrorResponse (/Users/gupadhyaya/.nvm/versions/node/v10.17.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:53:1421880)\n' +
      '    at /Users/gupadhyaya/.nvm/versions/node/v10.17.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:53:1420752\n' +
      '    at t.n.onreadystatechange (/Users/gupadhyaya/.nvm/versions/node/v10.17.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:89:10247)\n' +
      '    at t.e.dispatchEvent (/Users/gupadhyaya/.nvm/versions/node/v10.17.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:17:47987)\n' +
      '    at t._setReadyState (/Users/gupadhyaya/.nvm/versions/node/v10.17.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:89:15283)\n' +
      '    at t._onHttpResponseEnd (/Users/gupadhyaya/.nvm/versions/node/v10.17.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:89:18380)\n' +
      '    at IncomingMessage.<anonymous> (/Users/gupadhyaya/.nvm/versions/node/v10.17.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:89:17635)\n' +
      '    at IncomingMessage.emit (events.js:203:15)\n' +
      '    at endReadableNT (_stream_readable.js:1145:12)\n' +
      '    at process._tickCallback (internal/process/next_tick.js:63:19)',
    name: 'Error'
  }
}
@peekpi
Copy link
Contributor

peekpi commented Jul 18, 2021

It look like that Ganache is unable to sync blocks from Harmony node. Query the latest block number from Ganache does not change. If Ganache connects to Geth, it will always return the latest block number. I’ll debug it with ganache src code.

@hypnagonia
Copy link

hypnagonia commented Jul 29, 2021

currently known
eth_estimateGas is the method that fails
ganache calculates gas using ethereum js vm implementation instead of quering RPC directly
https://github.com/trufflesuite/ganache-core/blob/develop/src/chains/ethereum/ethereum/src/helpers/gas-estimator.ts#L255

@gupadhyaya
Copy link
Contributor Author

fixed in this PR: harmony-one/harmony#3837

@DSBUGAY2
Copy link

one1yr7j2xulp5z2z54sshvzzx0yque4wwsd6xw6zq

toniton added a commit to toniton/docs-home that referenced this issue Sep 12, 2021
Known issue on ganache has been resolved in the PR: harmony-one/sdk#95
@toniton
Copy link

toniton commented Sep 12, 2021

Hi @gupadhyaya!

Since this issue has been resolved, is it okay to remove the info from the documentation here: https://docs.harmony.one/home/developers/tools/using-ganache?

I have created a PR here: harmony-one/docs-home#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants