@ethereumjs/common v3.0.1
holgerd77
released this
19 Oct 09:48
·
1222 commits
to master
since this release
Support for Geth genesis.json Genesis Format
For lots of custom chains (for e.g. devnets and testnets), you might come across a Geth genesis.json config which has both config specification for the chain as well as the genesis state specification.
Common
now has a new constructor Common.fromGethGenesis()
- see PRs #2300 and #2319 - which can be used in following manner to instantiate for example a VM run or a tx with a genesis.json
based Common:
import { Common } from '@ethereumjs/common'
// Load geth genesis json file into lets say `genesisJson` and optional `chain` and `genesisHash`
const common = Common.fromGethGenesis(genesisJson, { chain: 'customChain', genesisHash })
// If you don't have `genesisHash` while initiating common, you can later configure common (for e.g.
// calculating it afterwards by using the `@ethereumjs/blockchain` package)
common.setForkHashes(genesisHash)
Other Changes and Fixes
- Fixed
Common.getHardforkByBlockNumber()
for certain post-Merge TTD/block number combinations, PR #2313 - Added Merge HF block numbers for
mainnet
,goerli
andsepolia
, PR #2324 - Fixed
forkhash
calculation to ignore the Merge hardfork even if it might have block number assigned, PR #2324 - Fixed HF-change based property selections (like consensus type) for TTD/block number based non-deterministic HF order, PR #2331
- Updated status of
EIP-3675
toFinal
, PR #2351