-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
All blocks starting from 13199981 return null on difficult field #2036
Comments
The difficulty likely reached the limit of ieee754 numbers, in which case ethers uses null rather than crashing. :) There isn’t really a backwards compatible way to resolve this in v5. It will be addressed in v6. Is this a field you need? In a minor bump, I could add a new field which will store the difficulty as a BigNumber, like |
Yep, I think it is better than crashing :) Well, my app is a block explorer, so for the sake of completeness I need it. But I agree that it is not something must-have. I would code a workaround anyway, block._difficulty is fine, if you have a not-so-intrusive workaround from caller side it would be helpful too. |
As an immediate solution until the next minor-bump, you could use one of the JSON-RPC backed providers (like Alchemy or INFURA) and use the raw A minor bump is likely a week or two away. |
Also see #2001. |
The In v6, the Thanks! :) |
Ethers 5.4.6:
On mainnet, starting from block 13199981, the difficult field always comes with null.
I do confirm that this info comes in the raw response:
I display this info on Otterscan block page.
The text was updated successfully, but these errors were encountered: