-
Hello everyone! I have this issue, in the docs it mention that the function Does anyone knows why this happens? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Are you using |
Beta Was this translation helpful? Give feedback.
Are you using
ethers.getDefaultProvider()
? (or let me know info about your provider). ThegetDefaultProvider
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)