gochain/web3

Ability to set chainId in a transaction

Closed this issue · 10 comments

Love web3, thanks for making it. It might literally be the only good Linux CLI.

I would love to be able to use Goerli but when I try to talk to Goerli I get
only replay-protected (EIP-155) transactions allowed over RPC

A quick Google later it seems like the fix is to set the chainId of the transaction. See here
https://ethereum.stackexchange.com/questions/94412/valueerror-code-32000-message-only-replay-protected-eip-155-transac

Oh interesting. I suppose we could add a flag for chain id, or ask the network for it, then add it to transactions automatically.

@jmank88 thoughts?

EIP-155 has actually been standard since before GoChain even existed, and this has been the only way to sign valid transactions for a very long time.
@techgnosis can you explain the steps to reproduce the problem you are seeing?
Edit: I think I was mistaken about EIP155 being required - the legacy format appears to still be allowed for compatibility reasons. We'll need to make some adjustments regarding how the transactions are being signed.

I misunderstood this bug. I'm still learning, sorry. I am able to send transactions to Goerli via Infura. The issue only existed when I tried to connect to one of the public Goerli endpoints, in particular https://rpc.goerli.mudit.blog/

I am getting the same issue, I am basically doing:

web3 account create
web3 transfer 0.1 to 0x8A31753240f261c1c435c4FfC4e466E81dc590BD  

Came back with this error:

ERROR: Cannot create transaction: failed to send transaction: only replay-protected (EIP-155) transactions allowed over RPC

I am connected to a private dev net for London fork, and I need to specify the chainId in the transaction cause it differs. 0x7b. it would be really useful to add that flag. I am using web3 to test London Fork and send transactions!

Once this new release is finished, can you guys try it and ensure it works as expected?

https://github.com/gochain/web3/actions/runs/946956782

@treeder awesome, what are the steps to install (i do have docker)? I used the single click install previously.

Just rerun the installer: curl -LSs https://raw.githubusercontent.com/gochain/web3/master/install.sh | sh and try again. I think that's all right @jmank88 ?

Yeah, reinstalling the same way as the last time should update it.

@treeder for some reason it worked :) Thank you for doing this I can continue testing for EIP-1559 <3 It seemed it fetched the ChainID from the RPC URL (like MetaMask does) this is good!

👍