Metamask-extension: Metamask doesn't work with ganache with typed message

Created on 23 Apr 2020  路  8Comments  路  Source: MetaMask/metamask-extension

NetworkId is compared to chainId in typed-message-manager.

See https://github.com/MetaMask/metamask-extension/blob/d68f156ac7b57efe60bfe39dc408c97197eadc0e/app/scripts/lib/typed-message-manager.js#L164
and https://github.com/MetaMask/metamask-extension/blob/d68f156ac7b57efe60bfe39dc408c97197eadc0e/app/scripts/controllers/network/network.js#L123

network is set to be the result of the rpc method "net_version" i.e. networkId, and it is compared to chainId, which on ganache-cli aren't the same.

Edit: The bottom line is that if chainId is provided in the message, Metamask will always throw on Ganache.

L00-provider T00-bug

All 8 comments

Is there any update on it @kumavis ?
It's currently impossible to work with Ganache with MM and typed message, without intentionally inserting a bug that would pass network id as chain id.

@kumavis is anyone here?

Note that this bug means that getTypedData() method can't be used on network where chainid!=networkid - most notably is local testing on geth/ganache - but also Ethereum Classic

I regret that we haven't been able to address this issue. We are looking into this, and will hopefully be able to ship a fix soon. Until we fix this, you should be able to omit the chainId from your signing parameters for local development work / testing.

Any ETA for the fix?

Its very problematic to create different contracts for local and remote testing

@drortirosh #9552 should land tomorrow, and hopefully be included in a feature release this week.

Is this fix already released? the latest published chrome extension is 8.0.10, dated 22-Sep-2020

It'll be fixed in version >=8.1, which has already shipped on Firefox, and will probably ship on Chrome early next week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dpazdan picture dpazdan  路  3Comments

aakilfernandes picture aakilfernandes  路  3Comments

1blockologist picture 1blockologist  路  3Comments

whyrusleeping picture whyrusleeping  路  3Comments

BMillman19 picture BMillman19  路  3Comments