Member-only story

InternalError: Unknown transaction type 2 — Ethereum Development with Hardhat

Just a quick memo of Ethereum development with Hardhat

yuichiro aoki
2 min readAug 7, 2021
Photo by Jon Tyson on Unsplash

I will explain just an errors that I faced today and its solution.

Errors

When I changed the block number of mainnet forking after the London hard fork, tests and scripts running on hardhat forking network failed with the following error messages.

Test Error

Script Error

Solution

Method 1

Just updating local packages will fix this issue.

Yarn

yarn upgrade

Npm

npm update

Method 2

If you use Hardhat v2.5.0~, then you can set the hardhat config as follows:

Why?

Because you are running tests on a London hardfork block(block number 12,965,000~), and Hardhat before v2.6.0 does not set hardfork as London as default. By updating Hardhat Hardhat v2.6.0~, it works because it supports the London hardfork by default. You can also explicitly set the hardfork like method 2 if you use Hardhat v2.5.0~.

source

Hope this helps. Thank you for reading😁

References

--

--

yuichiro aoki
yuichiro aoki

Written by yuichiro aoki

Ethereum Enthusiast & Software Developer

Responses (1)