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

Gracefully handle testrpc -f mode #783

Closed
danfinlay opened this issue Oct 28, 2016 · 6 comments
Closed

Gracefully handle testrpc -f mode #783

danfinlay opened this issue Oct 28, 2016 · 6 comments

Comments

@danfinlay
Copy link
Contributor

danfinlay commented Oct 28, 2016

Reported by @Schaeff:

When he uses the new testrpc -f $RPC_URL flag to fork an existing blockchain with testrpc, he gets some strange behavior on metamask:

  • Account balance drops to 0, does not update until first block is mined.
  • Tx history persists, and new txs here will be saved even after he un-forks.

These are kindof rare cases, but if developers make -f a common flag, we might want to accommodate it.

@danfinlay
Copy link
Contributor Author

Thanks to @Schaeff for coming up with this workaround:

He says:
testrpc -f $RPC_URL -i 898989898989 solves the problem of MM merging forked and original transaction histories
(-i sets a custom networkId)
Still requires mining a block though

@2-am-zzz 2-am-zzz added this to the Core Maintenance milestone Oct 31, 2016
@kumavis
Copy link
Member

kumavis commented Oct 31, 2016

testrpc networkId issue https://github.com/ethereumjs/testrpc/issues/189

@kumavis
Copy link
Member

kumavis commented Oct 31, 2016

dan sez:

  • the account balance issue is fixed after the first block i mined.
  • the tx history is based on the network id, i think testrpc should use a unique test network id when forking

@kumavis
Copy link
Member

kumavis commented Oct 31, 2016

TODO: confirm that when using a forked chain, initial balance RPC requests return a 0 balance

@kumavis
Copy link
Member

kumavis commented Oct 31, 2016

fork network id https://github.com/ethereumjs/testrpc/issues/195

@danfinlay
Copy link
Contributor Author

Closing since we have a good workaround, and have proposed better fixes in other projects.

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

No branches or pull requests

3 participants