-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Custom RPC incorrectly inserts chainId(4-rinkeby) eth_signTypedData_v3, signing tx affected. #5956
Comments
I'm not familiar with metamask code base, but I suspect Basically when you do ethQuery.sendAsync({ method: 'net_version' }, (err, network) => {
log.info('web3.getNetwork returned ' + network)
this.setNetworkState(network, type)
}
}) you are not getting ethQuery.sendAsync({ method: 'net_version' }, (err, result) => {
const network = result.result
log.info('web3.getNetwork returned ' + network)
this.setNetworkState(network, type)
}
}) I personally learned on that PR, playing around with different type of params. |
Good catch, thanks! I’m surprised this bug sat in prod for so long! I guess it shows signTypedData is finally getting some exploration? I’m definitely excited to see it combined with solidity 0.5.0 structured params. I think your diagnosis looks right, but I’ll take a closer look and verify. |
#5934 makes it sound like it's an issue with applying custom RPC networks, not limited to signTypedData |
missing repro step:
bug notes: solution ensure the look up of chainId before |
more notes: Seems part of this issue is that what ever the "provider" inpage is returning for chain Id does not seem to update properly on network switches the simple hack of setting the chainId during |
@frankiebee that's what I tried to say at the end of the bug report that even sending ANY tx on custom RPCs doesn't work |
@frankiebee @rstormsf I followed the repro steps (see gif below), but did not see the error. Is there an inconsistency between the steps I followed and what you are doing to hit this error? |
@danjm Make sure you have more than 1 Custom RPC in your list |
@danjm I’m able to reproduce it as well |
just to clarify with 2 custom rpcs, you cannot send a transaction from that rpc |
@frankiebee it's ok, I can re-add them. Please let me know when I can test the fix on which metamask version release. |
Describe the bug
To Reproduce
Steps to reproduce the behavior:
https://api.myetherwallet.com/eth
https://api.myetherwallet.com/rop
Expected behavior
Custom RPC must not use hardcoded values
Browser details (please complete the following information):
Additional context
I have created PR to remove hardcoded chainId
danfinlay/js-eth-personal-sign-examples#7
I also wasn't able to send any transactions from custom RPC URLs, and when I click on Tx Hash, it redirects me to rinkeby.etherscan.io
I believe it's ignoring custom rpcs and reading from last network id from dropdown which is rinkeby
The text was updated successfully, but these errors were encountered: