@ethereumjs/block v5.1.0
Dencun Hardfork Support
While all EIPs contained in the upcoming Dencun hardfork run pretty much stable within the EthereumJS libraries for quite some time, this is the first release round which puts all this in the official space and removes "experimental" labeling preparing for an imminent Dencun launch on the last testnets (Holesky) and mainnet activation! 🎉
Dencun hardfork on the execution side is called Cancun and can be activated within the EthereumJS libraries (default hardfork still Shanghai
) with a following common
instance:
import * as kzg from 'c-kzg'
import { Common, Chain, Hardfork } from '@ethereumjs/common'
import { initKZG } from '@ethereumjs/util'
initKZG(kzg, __dirname + '/../../client/src/trustedSetups/official.txt')
const common = new Common({
chain: Chain.Mainnet,
hardfork: Hardfork.Cancun,
customCrypto: { kzg: kzg },
})
console.log(common.customCrypto.kzg) // Should print the initialized KZG interface
Note that the kzg
initialization slightly changed from previous experimental releases and a custom KZG instance is now passed to Common
by using the customCrypto
parameter, see PR #3262.
While EIP-4844
- activating shard blob transactions - is for sure the most prominent EIP from this hardfork, enabling better scaling for the Ethereum ecosystem by providing cheaper block space for L2s, there are in total 6 EIPs contained in the Dencun hardfork. The following is an overview of which EthereumJS libraries mainly implement the various EIPs:
- EIP-1153: Transient storage opcodes (
@ethereumjs/evm
) - EIP-4788: Beacon block root in the EVM (
@ethereumjs/block
,@ethereumjs/evm
,@ethereumjs/vm
) - EIP-4844: Shard Blob Transactions (
@ethereumjs/tx
,@ethereumjs/block
,@ethereumjs/evm
) - EIP-5656: MCOPY - Memory copying instruction (
@ethereumjs/evm
) - EIP-6780: SELFDESTRUCT only in same transaction (
@ethereumjs/vm
) - EIP-7516: BLOBBASEFEE opcode (
@ethereumjs/block
,@ethereumjs/evm
)
WASM Crypto Support
With this release round there is a new way to replace the native JS crypto primitives used within the EthereumJS ecosystem by custom/other implementations in a controlled fashion, see PR #3192.
This can e.g. be used to replace time-consuming primitives like the commonly used keccak256
hash function with a more performant WASM based implementation, see @ethereumjs/common
README for some detailed guidance on how to use.
Self-Contained (and Working 🙂) README Examples
All code examples in EthereumJS
monorepo library README files are now self-contained and can be executed "out of the box" by simply copying them over and running "as is", see tracking issue #3234 for an overview. Additionally all examples can now be found in the respective library examples folder (in fact the README examples are now auto-embedded from over there). As a nice side effect all examples are now run in CI on new PRs and so do not risk to get outdated or broken over time.