Repository navigation
build: upgrade Hardhat 2 to @nomicfoundation/edr v0.25.1 #7985
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
Merged
Merged
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
066354c
refactor: remove custom debug_* logic
Wodann 81028ca
WIP: refactor: unify tracing architecture
Wodann 5005771
fix: outdated typing on skipped TS test
Wodann e737914
refactor: use new traces API of EDR
Wodann a9e3722
fix: always enable traces
Wodann 429d582
build: update to latest EDR
Wodann 3476f1c
feat: record precompile calls in Hardhat 2's call traces
Wodann 19db76e
fix: hold the provider wrapper weakly in the subscription callback
Wodann fca6019
refactor: build the network config as EDR's Hardhat patch does
Wodann ede6229
refactor: convert hardforks through EDR's string names
Wodann f1d2d9a
chore: remove unused imports from convertToEdr
Wodann e454f5d
Revert "feat: record precompile calls in Hardhat 2's call traces"
Wodann c9bde95
fix: cap the default transaction gas limit under Osaka
Wodann 58316dd
fix: let EDR derive the default transaction gas limit
Wodann ef544c3
docs: say that EDR derives the default transaction gas limit
Wodann a34ae72
refactor: drop the identity hardfork conversion
Wodann 47c921c
docs: port the EDR upgrade changesets from Hardhat 3
Wodann ac31481
docs: drop the EDR version bump changeset
Wodann 9203c7d
build: require Node.js 22 or later
Wodann e5cd8c5
docs: add changesets for EDR behaviour changes since 0.12.0-next.23
Wodann 97e66a0
docs: describe the full debug trace format change
Wodann 1aa7122
build: move the dev container to Debian Bookworm
Wodann 3788431
fix: capture memory in debug traces by default
Wodann c15ce75
fix: return Hardhat 2's debug trace format
Wodann 0eeb7e9
docs: describe the restored debug trace format
Wodann 7de75da
deps: bump EDR to 0.25.0
Wodann 189e45e
test: cover more debug trace conversions
Wodann b7d610c
test: remove debug trace tests that only check EDR behaviour
Wodann 7b7972d
fix: reject invalid mining.interval ranges at config load
Wodann b8b25e1
refactor: drop the unused hardfork conversion
Wodann 07a25a6
fix: log a failed root address lookup in debug traces
Wodann 9fe775b
refactor: compare the created address through the shared helper
Wodann ce3ebcb
test: pin the storage context of each frame with disableStack
Wodann bc16cda
test: port the VM event bridge test from EDR
Wodann f0c43e4
docs: revise the changesets of the EDR upgrade
Wodann 1a6f11a
fix: treat an empty tracer name as the default tracer
Wodann bc32b81
test: move the debug trace conversion suite to EDR
Wodann 7a8c610
deps: bump EDR to 0.25.1
Wodann 491f433
Apply suggestion from @kanej
kanej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed Solidity stack traces not recognising `console.log` calls made through the Hardhat console address. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| "hardhat": minor | ||
| --- | ||
|
|
||
| Updated `debug_traceTransaction` and `debug_traceCall`: | ||
|
|
||
| - Added support for geth's built-in tracers, such as `callTracer` and `prestateTracer`, which return geth's output unchanged. | ||
| - Fixed an empty `tracer` to select the default tracer, as the Ethereum execution API spec requires. | ||
| - Added the `enableMemory` and `enableReturnData` options to the default tracer. `enableMemory` takes precedence over `disableMemory`, and `enableReturnData` adds `returnData` to each step. | ||
| - Changed the default tracer output in a few places: | ||
| - A step that halts now has an `error` message that comes from EDR, so do not match on its exact text. | ||
| - An unknown opcode is now named `Unknown`. | ||
| - A `STOP` at the first step is no longer dropped, so traces can have one more step. | ||
| - Storage no longer shows slots of another contract after a warm `SLOAD`. | ||
| - When `disableStack` is set, storage values can be stale until the next `SLOAD` or `SSTORE`. | ||
| - With the default tracer and storage enabled, `debug_traceTransaction` now reads the traced transaction to find its recipient. That costs one remote request when the transaction is on a forked chain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed `eth_call` and `eth_estimateGas` requests without a `gas` field failing under the Osaka transaction gas cap. Hardhat no longer passes a default transaction gas limit to EDR. EDR derives it from the hardfork and gas limit of the block that runs the request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Improved the performance of the Hardhat Network provider by reducing the memory used to record the call traces of transactions and calls. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": minor | ||
| --- | ||
|
|
||
| Raised the minimum glibc version of the prebuilt Linux gnu binaries of EDR from 2.30 to 2.34. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": minor | ||
| --- | ||
|
|
||
| Reduced Hardhat's install size because EDR now installs only the native build for the current platform through `optionalDependencies`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed `eth_estimateGas` failing from the Osaka hardfork when its search probed gas values above the EIP-7825 transaction gas cap. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed forking requests to loopback URLs being sent through `HTTP_PROXY` or `HTTPS_PROXY`. Requests to `localhost`, `*.localhost`, `127.0.0.0/8`, `0.0.0.0` and `::1` now bypass the proxy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed forking from a block that precedes the oldest supported hardfork being silently accepted. It now fails with an error that names the oldest supported hardfork. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Changed the error of a forking request that fails on every retry. It now reads `Request failed after 9 retries` and no longer names the host or the cause, such as a DNS error. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Changed the location of the forking RPC cache to an `rpc_cache/v2` subdirectory. Data cached by previous Hardhat versions is not reused. Everything else in the `rpc_cache` directory is ignored and can be deleted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": minor | ||
| --- | ||
|
|
||
| Fixed the EIP-4788 and EIP-2935 system accounts to have nonce `1` in the genesis state, matching their on-chain deployments. The genesis block hash of local Cancun or later networks therefore differs from previous Hardhat versions. The hashes of all later blocks change as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed a deadlock that hung the process when a Hardhat Network provider with interval mining and logging enabled was destroyed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "hardhat": minor | ||
| --- | ||
|
|
||
| Fixed interval mining accepting a `mining.interval` range that it could not honour: | ||
|
|
||
| - A range must now satisfy `1 <= min <= max`. An invalid range is rejected when the config is loaded, when the provider is created and when `evm_setIntervalMining` is called. The config error names `networks.hardhat.mining.interval` and the offending range. | ||
| - BREAKING CHANGE: `[0, 0]` and `[0, N]` ranges are no longer accepted. Use a range with a minimum of at least `1`, such as `[1, N]`, instead. Set `mining.interval` to `0` to disable interval mining. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": minor | ||
| --- | ||
|
|
||
| Added the `blockTimestamp` field to logs. Logs returned by `eth_getLogs`, `eth_getFilterLogs`, `eth_getFilterChanges` and `eth_subscribe("logs")` carry it, as do the logs in transaction receipts. When forking, the field is passed through from the remote node and is absent if the node does not serve it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed the transaction `Value` in the `hardhat node` logs dropping leading zeros of the fractional part, which logged `0.01 ETH` as `0.1 ETH`. Whole amounts no longer end with a trailing dot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed Solidity stack traces after a precompile call. A failing precompile call is now reported as a precompile error, and later calls in the same function point at the right line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hardhat": patch | ||
| --- | ||
|
|
||
| Fixed calls through proxy contracts being logged as `<unrecognized-selector>`. A selector that is missing from the called contract is now resolved against the implementation behind the proxy. The call is labeled with the full delegation chain, such as `Proxy>Implementation#setValue`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "hardhat": minor | ||
| --- | ||
|
|
||
| Updated the minimal supported version of Node to v22, because EDR declares `engines.node >= 22`. Node 20 reached end of life on 2026-04-30. | ||
|
|
||
| On Node 20, Hardhat prints its unsupported-version warning and keeps running. Hardhat's own `package.json` declares no `engines`, so installing it is not blocked. Package managers warn that `@nomicfoundation/edr` requires Node 22, and those that enforce `engines`, such as Yarn 1, refuse the install. EDR's loader has no Node version check, so EDR itself still loads on Node 20, but that combination is untested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 20 | ||
| 22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const SUPPORTED_NODE_VERSIONS = ["^20.0.0", "^22.0.0", "^24.0.0"]; | ||
| export const SUPPORTED_NODE_VERSIONS = ["^22.0.0", "^24.0.0"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.