Forking config seems not working
Version of Hardhat
2.20.1
What happened?
I am using this config to start a local hardhat node:
module.exports = {
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 1,
loggingEnabled: true,
forking: {
url: "https://eth-mainnet.g.alchemy.com/v2/<api_key>",
}
},
},
};
This file is working because the chainId of my local node is changed, but i keep getting this error when I ran my test:
eth_maxPriorityFeePerGas - Method not supported
Using npx hardhat node --forking https://eth-mainnet.g.alchemy.com/v2/<api_key> has the same behavior.
If I request the "eth_maxPriorityFeePerGas" RPC using the alchemy url, I can get the correct result. Any idea what went wrong?
The node version is v20.11.1, the OS is Windows 10.
Minimal reproduction steps
Put this config at the root directory:
module.exports = {
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 1,
loggingEnabled: true,
forking: {
url: "https://eth-mainnet.g.alchemy.com/v2/<api_key>",
}
},
},
};
Run npx hardhat node to start a node then run this:
curl --location 'http://127.0.0.01:8545' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_maxPriorityFeePerGas",
"params": [],
"id": 83
}'
The response is:
{
"jsonrpc": "2.0",
"id": 83,
"error": {
"code": -32601,
"message": "Method eth_maxPriorityFeePerGas not found",
"data": {
"message": "Method eth_maxPriorityFeePerGas not found"
}
}
}
Search terms
Hardnet Forking eth_maxPriorityFeePerGas
Do I need to provide any extar info to help you spot the problem?
i have the same problem
https://github.com/NomicFoundation/hardhat/issues/5187#issuecomment-2108796843
The issue here is that the Hardhat node does not support eth_maxPriorityFeePerGas.
We are tracking this issue here: https://github.com/NomicFoundation/hardhat/issues/4365
We have put together an implementation as part of EDR (our reimplemented local development node): https://github.com/NomicFoundation/edr/issues/369
The new version of EDR will ship as part of [email protected] next week: https://github.com/NomicFoundation/hardhat/pull/5213
I am closing this issue in preference to #4365