Skip to content

The obtained blockNumber from getBlockNumber is not mined #2044

Answered by zemse
dnoishi asked this question in Q&A
Discussion options

You must be logged in to vote

Are you using ethers.getDefaultProvider()? (or let me know info about your provider). The getDefaultProvider gives you a fallback provider, which has multiple nodes behind it which may not be in sync with the latest block. So maybe you were served getBlockNumber from a node that is up to date while the call was served from another node that was few blocks behind. A trival solution would be to use a single node instead of Fallback provider for this purpose (using StaticJsonRpcProvider)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dnoishi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants