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

Support eth_chainId #1293

Closed
carver opened this issue Mar 20, 2019 · 11 comments
Closed

Support eth_chainId #1293

carver opened this issue Mar 20, 2019 · 11 comments

Comments

@carver
Copy link
Collaborator

@carver carver commented Mar 20, 2019

geth and parity both support the endpoint now (admittedly, this is hearsay), so we should to.

Also, we could update the local signing middleware and transaction builder to include the connected chain id when signing.

Huge bonus points for opening a PR to add it to https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md

@kclowes
Copy link
Collaborator

@kclowes kclowes commented Apr 10, 2019

  • eth_chainId implemented - #1295
  • Update local signing middleware and transaction builder to include the connected chainId when signing
  • 🏅Bonus: Add PR to EIP-1474

@cygnusv
Copy link
Contributor

@cygnusv cygnusv commented Aug 13, 2019

There's an inconsistency in the docs wrt w3.eth.chainId. They say it returns an integer value, but in fact it just returns the original hex string defined by EIP-695

@carver
Copy link
Collaborator Author

@carver carver commented Aug 13, 2019

it just returns the original hex string

Ah, sounds like a bug.

@cygnusv
Copy link
Contributor

@cygnusv cygnusv commented Aug 13, 2019

My bad! It seems you guys already fixed this in the last release.
#1387

@carver
Copy link
Collaborator Author

@carver carver commented Aug 13, 2019

Great! I'll close this issue, then.

  • Update local signing middleware and transaction builder to include the connected chainId when signing

@kclowes IIRC, this already happened, right? ^

@carver carver closed this Aug 13, 2019
@kclowes
Copy link
Collaborator

@kclowes kclowes commented Aug 14, 2019

@carver Unless I'm missing something (very possible), I don't think we've added chainId to the middleware and transaction builder yet. I'll open a new issue with a better title though so it's less confusing.

@carver
Copy link
Collaborator Author

@carver carver commented Aug 14, 2019

Ok sounds good, thanks!

@rbval
Copy link

@rbval rbval commented May 29, 2020

Trying to bump my web3.py version from 4.8.0 to 5.1.0 in order to get support for poll_latency in waitForTransactionReceipt.

Seems like this breaks running the stack locally with docker due to chainId not being support yet:

      File "/usr/local/lib/python3.6/dist-packages/web3/_utils/transactions.py", line 32, in <lambda>
        'chainId': lambda web3, tx: web3.eth.chainId,
      File "/usr/local/lib/python3.6/dist-packages/web3/eth.py", line 106, in chainId
        return self.web3.manager.request_blocking("eth_chainId", [])
      File "/usr/local/lib/python3.6/dist-packages/web3/manager.py", line 97, in request_blocking
        raise ValueError(response["error"])
    ValueError: {'message': 'Method eth_chainId not supported.', 'code': -32000, 'data': {'stack': 'Error: Method eth_chainId not supported.\n    at u.handleRequest (/app/ganache-core.docker.cli.js:52:274197)\n    at t (/app/ganache-core.docker.cli.js:52:137853)\n    at a.handleRequest (/app/ganache-core.docker.cli.js:52:273184)\n    at t (/app/ganache-core.docker.cli.js:52:137853)\n    at s.f.handleRequest (/app/ganache-core.docker.cli.js:52:266314)\n    at s.handleRequest (/app/ganache-core.docker.cli.js:52:264140)\n    at t (/app/ganache-core.docker.cli.js:52:137853)\n    at c.handleRequest (/app/ganache-core.docker.cli.js:52:272198)\n    at t (/app/ganache-core.docker.cli.js:52:137853)\n    at a.handleRequest (/app/ganache-core.docker.cli.js:52:271645)\n    at t (/app/ganache-core.docker.cli.js:52:137853)\n    at d._handleAsync (/app/ganache-core.docker.cli.js:52:137889)\n    at Timeout._onTimeout (/app/ganache-core.docker.cli.js:52:137314)\n    at ontimeout (timers.js:436:11)\n    at tryOnTimeout (timers.js:300:5)\n    at listOnTimeout (timers.js:263:5)\n    at Timer.processTimers (timers.js:223:10)', 'name': 'Error'}}

Anything to be done short term?

@carver
Copy link
Collaborator Author

@carver carver commented May 29, 2020

due to chainId not being support yet:

Interesting, ganache doesn't support chainId?

Anything to be done short term?

You could manually set the chain id of your transaction, so that web3 doesn't try to fill it in for you automatically.

Maybe see if an upgrade of ganache will support chain id? Or see if the eth-tester backend will get the job done for you, since it seems you're just testing locally.

@rbval
Copy link

@rbval rbval commented May 29, 2020

Thanks for the prompt answer, seems like ganache bump didn't do it. Will try including chainId in the transaction next.

@carver
Copy link
Collaborator Author

@carver carver commented May 29, 2020

FWIW, ganache claims to have this since a year ago: trufflesuite/ganache#419

IDK how to track down which released version that corresponds to.

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

Successfully merging a pull request may close this issue.

None yet
4 participants