-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Can't specify 'latest' string as my block in calls #5868
Comments
The reason for this behavior is that MetaMask is often pointed at load-balanced providers, where You're saying MetaMask doesn't allow you to request |
Yeah! So there are a couple scenarios where this is an issue for us, but the main problem is:
I confirmed with infura devs and this happens when you're requesting a block number that the load balancer sends to a node, and the node does not have this block yet. I've recreated this scenario in this gist If i could specify |
Also, I totally get what you're saying about internal consistency, but for the calls I make explicitly shouldn't I have control over that aspect? And MM can keep using the latest-known-block for it's own internal calls for sake of consistency? |
@derrickpelletier thanks for the investigation with infura you have answered a weird bug i've been hunting for the past two days! i'll see what we can do to tighten up the |
@frankiebee whew, glad it is helpful—I should have shared the gist sooner. If you're tightening up the If i'm not mistaken you can't fully get rid of this issue unless infura was to ensure their load balancer balances across nodes that in sync. Also, your point about tx signing is valid for sure. Is it possible that maybe |
@zmadmani makes a good point in #5588 (comment) I've also tried retry with an increasing delay with very minimal success even at ~6 seconds for the last attempt (which is far too much already when considering the ux). |
Same here @derrickpelletier, I've only been able to reliably get it to fix itself after a refresh (which usually causes a separate call to fail). Have you found a way around the caching to force a re-fetch? About the caching problem itself... I guess I can understand why you might want to cache certain errors from the blockchain (resulting from blockchain operations), but this specific type of error are not from the blockchain rather from the infrastructure. I think an error that is coming from failures in the infrastructure should not be cached since it's not actually a valid answer to a query. Any thoughts? |
Just wanted to chime in to say that I have also experienced this issue. It's quite a challenge as we basically have no recourse for the user when it occurs. The issue does not happen when using our own RPC node, so it does seem like an issue related to Infura. |
Tracing this issue we have discovered a bug in geth that also is the cause of several intermittent bugs we've been tracking ourselves: |
Tried to search for this but having no luck. Couldn't really find any leads in the codebase either (not super familiar with it though).
When calling a contract method, I'm attempting to specify
'latest'
as my block number:But MetaMask seems to always replace this with an actual blockNumber, when I'd prefer it was just sending
latest
. If i specify my own explicit blockNumber MetaMask does not replace it.Trying to find a way around this but not having any luck. What can I do here? And whats the reason for this behaviour?
Expected behavior
I expect MetaMask to use the blockNumber string I specify.
Browser details (please complete the following information):
The text was updated successfully, but these errors were encountered: