question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All blocks starting from 13199981 return null on difficult field

See original GitHub issue

Ethers 5.4.6:

On mainnet, starting from block 13199981, the difficult field always comes with null.

{
  hash: '0x7558a1559758e3dfa1074188285adff74d1f1833a6363f891d6eccebdfd825ed',
  parentHash: '0xecab8888f9fc828d9ae07775de4db8b5104fc120349159835bd5d252dcda1834',
  number: 13199981,
  timestamp: 1631302838,
  nonce: '0x2a59d15c02876925',
  difficulty: null,
  gasLimit: BigNumber { _hex: '0x01c9c380', _isBigNumber: true },

I do confirm that this info comes in the raw response:

{
  "jsonrpc": "2.0",
  "id": 83,
  "result": {
    "baseFeePerGas": "0xed21e880a",
    "difficulty": "0x2003f36c614e37",
    "extraData": "0x486976656f6e2063612d6865617679204c586c67",
    "gasLimit": "0x1c9c380",
    "gasUsed": "0x1c99d15",
    "hash": "0x7558a1559758e3dfa1074188285adff74d1f1833a6363f891d6eccebdfd825ed",
    "logsBloom": "0x7cfedbef2b4b7b33de4b8ed5c1f9ffeddcff36f1eefbd3770c9dfc76bbb1d37f8fd3fba37a2937fc35cffb9d3719ff4dbf9ff8e11f01dc3d0fd75fff557ffe954d7f5bdea9749f09f8ce07ab6fca33e3affb779faf76bff716851e2fbddfbfbfd303eaec1efdf7aed69bdcaf2a7cfd9a4f46bcd072dc3f6aabc2ddf93ad9dedec7d31db7ef2cbb7edee5b25ceffaedff569aaadd7fc65c1bab75abfa67726eb7b3f9efeb3bf6fefcaffed39f37189e7afff782cdff467fdea7955fee9aa7cbfbb5bce6aef73989db7bbefd31592ff9ff5a63fa6afebf2e7deaddb5fb63dbfbad86b87a7f9f26aae439fcb178b7d607efc7c71bfc7b75e9d7f5ce9bf67dbef447",
    "miner": "0x1ad91ee08f21be3de0ba2ba6918e714da6b45836",
    "mixHash": "0x8b936572649397d24923f64b94b1865ae57901cdfaf2ce8fe75d59913326632a",
    "nonce": "0x2a59d15c02876925",
    "number": "0xc96a6d",
    "parentHash": "0xecab8888f9fc828d9ae07775de4db8b5104fc120349159835bd5d252dcda1834",

I display this info on Otterscan block page.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ricmoocommented, Sep 11, 2021

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 .send(method, paeans).

A minor bump is likely a week or two away.

0reactions
ricmoocommented, Oct 20, 2021

The _difficulty property has been added to 5.5.0 for those that needs this.

In v6, the difficulty property is a BigNumber, so the _difficulty property will go away, but for v5 compatibility, difficulty is preserved as a null | number.

Thanks! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Year field return null value ? - Microsoft Power BI Community
Hi All. I have a DATE field , it return correct date. I have create a master calendar table . I have link...
Read more >
Should functions return null or an empty object? - Stack Overflow
Returning null is usually the best idea if you intend to indicate that no data is available. An empty object implies data has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found