-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Network: disable cache on localhost #3088
Comments
We experienced the same bug while testing on ganache-cli. Metamask always returns the old (incorrect) value for a contract variable. My current workaround is to connect Metamask to an other network then reconnect to localhost. |
More caching observations by @MicahZoltu: micah.zoltu [1:47 AM] Hmm, it actually appears to be some super aggressive caching by MetaMask. Previously I hadn't worked on MetaMask integration personally on other projects, though I have heard other developers complain about "weird MetaMask behavior that eventually went away". Now that I am experiencing them I took some time to debug to try to figure out the source of the problem and caching looks like the root cause. I can certainly appreciate the desire to have the results of many things cached (e.g., |
being handled in #4279 |
fixed in #4279 |
This issue is fixed apparently, but curious to know what the original caching strategy was -- and how exactly it has been addressed in #4279. |
@saturnial #4279 changes our handling of rpc methods from before with now with The block-cache was built to do a straightforward cache on requests with a lifetime of one block. The inflight cache was built to solve the problem where request 1 and 2 are equivalent but request 2 is made before request 1 finishes. Request 2 will be held until request 1 completes, then will return with Request 1's result. Here is where we determine the methods that we cache (anything marked |
There are some issues with testrpc/ganache-cli and metamask cache, when using instant blocks. One easy way to resolve this is to not include the BlockCache when targeting localhost.
Selected P1 because this affects lots of developers using metamask. They see old state from before the last tx.
The text was updated successfully, but these errors were encountered: