Metamask-extension: Detect when TestRPC changes & restart provider

Created on 15 Oct 2017  路  8Comments  路  Source: MetaMask/metamask-extension

Here at EthWaterloo, I just saw a pair of hackers get stuck to the point of desperation because:

  • They were getting wrong nonce errors
  • They couldn't track the tokens they had published.

Both of those problems were actually related to restarting their TestRPC server, and MetaMask now being in a "wrong" state.

We could solve this by doing some kind of provider detection, for when the provider server (even if just localhost:8545) suddenly changes to a different blockchain. This could be as simple as periodically (every 5 minutes) checking if the genesis block has the same hash. Or recognizing if an old block no longer exists. I don't know, this issue is for solving the problem, let the solution PR have the solution.

L23-devMode T01-enhancement

Most helpful comment

I think this would be a great idea. It doesn't need to be an automatic/periodic check or anything; there could be a button somewhere that says "Reset network" or "Forget history" or something. Right now the only solution I've found is to uninstall/reinstall the extension.

I don't know how feasible any of this would be, but it would be appreciated!

All 8 comments

I have this problem when using truffle develop testrpc. and it doesn't resolve when I switch network on metamask. I think this is probably a truffle issue though. it works fine with any other network, including with just running testrpc from node_modules manually at port 8545

I think this would be a great idea. It doesn't need to be an automatic/periodic check or anything; there could be a button somewhere that says "Reset network" or "Forget history" or something. Right now the only solution I've found is to uninstall/reinstall the extension.

I don't know how feasible any of this would be, but it would be appreciated!

Solutions discussed in #1999, which is a bug that would be fixed by this.

A starting point PR for this fix is:
https://github.com/MetaMask/metamask-extension/pull/2623

can we bounty this to get it over the finish line?

blocked by #4279

now that we have a special configuration for localhost, we can add that behavior just there

Related: #4254, #5067, #6559, #8081

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danfinlay picture danfinlay  路  3Comments

BMillman19 picture BMillman19  路  3Comments

MarkOSullivan94 picture MarkOSullivan94  路  3Comments

kumavis picture kumavis  路  3Comments

glitch003 picture glitch003  路  3Comments