Skip to content
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

Invalid value undefined supplied to : RpcBlockWithTransactions | null/totalDifficulty: QUANTITY #5986

Closed
0xmichalis opened this issue Nov 26, 2024 · 9 comments
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@0xmichalis
Copy link

0xmichalis commented Nov 26, 2024

Version of Hardhat

2.19.5

What happened?

Forking a Base Sepolia node has started failing with the following error:

Errors: Invalid value undefined supplied to : RpcBlockWithTransactions | null/totalDifficulty: QUANTITY

Minimal reproduction steps

git clone https://github.com/0xmichalis/hardhat-5986-repro
cd hardhat-5986-repro
npm i
npx hardhat test

Search terms

No response

@0xmichalis
Copy link
Author

Seems to work fine with the latest Hardhat version (2.22.16)

@0xmichalis
Copy link
Author

This has started happening since today. It'd be great to understand whether there is a workaround we can apply without changing versions as it's hard to do that at the moment (upgrading breaks our tests for some reason).

@aspiers
Copy link
Contributor

aspiers commented Nov 26, 2024

Wild guess this is the same as #5816 which was fixed in v2.22.14.

@aspiers
Copy link
Contributor

aspiers commented Nov 26, 2024

See also #2106 and #2313 although those are much older and no longer valid.

@aspiers
Copy link
Contributor

aspiers commented Nov 27, 2024

Looks like OpenZeppelin Defender just got bitten with the same issue 😆

image

@aspiers
Copy link
Contributor

aspiers commented Nov 27, 2024

Although to be more precise, they can't be relying on hardhat from within their frontend. I'm guessing that the commonality is maybe NomicFoundation/edr#696, since the hardhat fix was just to bump EDR to 0.6.4 to incorporate a fix for that.

@kanej
Copy link
Member

kanej commented Dec 2, 2024

The upcoming 2.22.17 release makes the totalDifficulty field optional.
I suspect, however, there is not a work around for the removal of totalDifficulty from the API without changing version.
The versions of Hardhat after 2.19 uses EDR for the underlying Hardhat node (a rewrite of Hardhat node in Rust). If you are running into bugs after upgrading could you post them as issues here to help us diagnose any problems EDR has introduced?

@kanej kanej added status:needs-more-info There's not enough information to start working on this issue and removed status:triaging labels Dec 2, 2024
@nebasuke
Copy link
Member

nebasuke commented Dec 2, 2024

EDR depends on the RpcBlockWithTransactions from hardhat-core definitions, so updating Hardhat to the upcoming 2.22.17 would be the way to go. Do let us know if there unexpected downstream consequences on the EDR level though!

See also #6007.

@schaable
Copy link
Member

schaable commented Dec 3, 2024

Hardhat 2.22.17 has been released and includes a fix for this issue. You can see the release notes here.

@schaable schaable closed this as completed Dec 3, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Hardhat Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Archived in project
Development

No branches or pull requests

5 participants