This Hardhat 2 release adds experimental support for the amsterdam hardfork. This will be the last hardfork Hardhat 2 supports, so we recommend planning your migration to Hardhat 3.
Changes
-
d9605fd: Added experimental support for the
amsterdamhardfork.Under
amsterdam, the defaultgasof the Hardhat network ismin(blockGasLimit, 2^32 - 1), following EIP-8037. With the default block gas limit that is 60,000,000, up from 16,777,216 underosaka.With a
gasMultiplier, the automatically estimated gas is no longer trimmed below the node's estimate. This applies to every network and hardfork. -
b501bed: Updated
debug_traceTransactionanddebug_traceCall:- Added support for geth's built-in tracers, such as
callTracerandprestateTracer, which return geth's output unchanged. - Fixed an empty
tracerto select the default tracer, as the Ethereum execution API spec requires. - Added the
enableMemoryandenableReturnDataoptions to the default tracer.enableMemorytakes precedence overdisableMemory, andenableReturnDataaddsreturnDatato each step. - Changed the default tracer output in a few places:
- A step that halts now has an
errormessage that comes from EDR, so do not match on its exact text. - An unknown opcode is now named
Unknown. - A
STOPat 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
disableStackis set, storage values can be stale until the nextSLOADorSSTORE. - With the default tracer and storage enabled,
debug_traceTransactionnow reads the traced transaction to find its recipient. That costs one remote request when the transaction is on a forked chain.
- A step that halts now has an
- Added support for geth's built-in tracers, such as
-
b501bed: Raised the minimum glibc version of the prebuilt Linux gnu binaries of EDR from 2.29 to 2.34.
-
b501bed: Reduced Hardhat's install size because EDR now installs only the native build for the current platform through
optionalDependencies. -
b501bed: Fixed the EIP-4788 and EIP-2935 system accounts to have nonce
1in 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. -
b501bed: Fixed interval mining accepting a
mining.intervalrange 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 whenevm_setIntervalMiningis called. The config error namesnetworks.hardhat.mining.intervaland the offending range. - BREAKING CHANGE:
[0, 0]and[0, N]ranges are no longer accepted. Use a range with a minimum of at least1, such as[1, N], instead. Setmining.intervalto0to disable interval mining.
- A range must now satisfy
-
b501bed: Added the
blockTimestampfield to logs. Logs returned byeth_getLogs,eth_getFilterLogs,eth_getFilterChangesandeth_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. -
b501bed: 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.jsondeclares noengines, so installing it is not blocked. Package managers warn that@nomicfoundation/edrrequires Node 22, and those that enforceengines, 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. -
af684ee: - Fixed
networks.hardhat.chainshardfork histories being ignored.- Changed a configured hardfork history to replace EDR's built-in activations for that chain, so it must list every hardfork the forked range needs.
- Removed the default
networks.hardhat.chainsentry for Sepolia. - Rejected an empty
hardforkHistoryfor anetworks.hardhat.chainsentry at config validation.
-
b501bed: Fixed Solidity stack traces not recognising
console.logcalls made through the Hardhat console address. -
b501bed: Fixed
eth_callandeth_estimateGasrequests without agasfield 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. -
c8df269: Upgraded EDR to v0.26.0.
-
b501bed: Improved the performance of the Hardhat Network provider by reducing the memory used to record the call traces of transactions and calls.
-
c8df269: Thanks @anaPerezGhiglia! Fixed
eth_estimateGasover-estimating at historical blocks on forked chains whose hardfork differs from the configured one. -
c8df269: Thanks @anaPerezGhiglia! Fixed blocks mined on a fork using default blob and base fee parameters instead of the forked chain's when the configured
chainIddiffers from the remote chain's. -
b501bed: Fixed
eth_estimateGasfailing from the Osaka hardfork when its search probed gas values above the EIP-7825 transaction gas cap. -
b501bed: Fixed forking requests to loopback URLs being sent through
HTTP_PROXYorHTTPS_PROXY. Requests tolocalhost,*.localhost,127.0.0.0/8,0.0.0.0and::1now bypass the proxy. -
b501bed: 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.
-
b501bed: Changed the error of a forking request that fails on every retry. It now reads
Request failed after 9 retriesand no longer names the host or the cause, such as a DNS error. -
b501bed: Changed the location of the forking RPC cache to an
rpc_cache/v2subdirectory. Data cached by previous Hardhat versions is not reused. Everything else in therpc_cachedirectory is ignored and can be deleted. -
b501bed: Fixed a deadlock that hung the process when a Hardhat Network provider with interval mining and logging enabled was destroyed.
-
b501bed: Fixed the transaction
Valuein thehardhat nodelogs dropping leading zeros of the fractional part, which logged0.01 ETHas0.1 ETH. Whole amounts no longer end with a trailing dot. -
b501bed: 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.
-
b501bed: 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 asProxy>Implementation#setValue.
💡 The Nomic Foundation is hiring! Check our open positions.