Monorepo for the Ethereum VM TypeScript Implementation
This is mainly a maintenance release coming with a few internal changes and minor bug fixes, single user-focused addition is the support for the eth_feeHistory
RPC call.
Support for the eth_feeHistory
RPC endpoint has been added in PR #3295. The endpoint allows to query the base fee and the priority fee per gas for a requested/supported block range.
kzg-wasm
instead of the c-kzg
Node.js bindings for 4844 functionality, PR #3294
devnet6.txt
trusted setup file and all test usages in downstream libraries, PR #3288
This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying rustbn-wasm
library (see issue #10) generally affecting the compatiblity of our libraries.
The EVM
direct constructor initialization with new EVM()
now has been deprecated and replaced by an async static create()
constructor, as it is already done in various other libraries in the EthereumJS monorepo, see PRs #3304 and #3315. If you pass in a custom EVM
along your VM
initialization you need to update your EVM initialization.
An EVM is now initialized like the following:
import { hexToBytes } from '@ethereumjs/util'
import { EVM } from '@ethereumjs/evm'
const evm = await EVM.create()
const res = await evm.runCode({ code: hexToBytes('0x6001') })
For the VM
there has been an async create()
constructor before already and the main constructor was labelled as deprecated
. While this main constructor was still working before, along with these releases the main VM constructor is now "fully out of order" and VM initialization solely work with the async create()
constructor.
Beyond solving this specific problem this generally allows for a cleaner and async-complete initialization of underlying libraries and is more future proof towards eventual upcoming async initialization additions.
Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉
Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm
name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.
This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg
initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).
Note that kzg-wasm
needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):
import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
const kzg = await loadKZG()
// Instantiate `common`
const common = new Common({
chain: Chain.Mainnet,
hardfork: Hardfork.Cancun,
customCrypto: { kzg },
})
Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.
Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).
Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie
library with a Node.js
web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.
This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying rustbn-wasm
library (see issue #10) generally affecting the compatiblity of our libraries.
The EVM
direct constructor initialization with new EVM()
now has been deprecated and replaced by an async static create()
constructor, as it is already done in various other libraries in the EthereumJS monorepo, see PRs #3304 and #3315.
An EVM is now initialized like the following (from our examples
):
import { hexToBytes } from '@ethereumjs/util'
import { EVM } from '@ethereumjs/evm'
const evm = await EVM.create()
const res = await evm.runCode({ code: hexToBytes('0x6001') })
Beyond solving this specific problem this generally allows for a cleaner and async-complete initialization of underlying libraries and is more future proof towards eventual upcoming async initialization additions.
Note that the direct usage of the main constructor is not possible anymore with these releases and you need to update your constructor usages!
Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉
Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm
name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.
This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg
initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).
Note that kzg-wasm
needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):
import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
const kzg = await loadKZG()
// Instantiate `common`
const common = new Common({
chain: Chain.Mainnet,
hardfork: Hardfork.Cancun,
customCrypto: { kzg },
})
Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.
Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).
Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie
library with a Node.js
web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.
startReportingPreimages()
method, PR #3143 and #3298
getOpcodesForHF()
helper method, PR #3322
Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉
Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm
name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.
This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg
initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).
Note that kzg-wasm
needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):
import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
const kzg = await loadKZG()
// Instantiate `common`
const common = new Common({
chain: Chain.Mainnet,
hardfork: Hardfork.Cancun,
customCrypto: { kzg },
})
Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.
Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).
Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie
library with a Node.js
web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.
Maintenance release with downstream dependency updates, see PR #3297
Maintenance release with downstream dependency updates, see PR #3297
Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉
Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm
name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.
This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg
initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).
Note that kzg-wasm
needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):
import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
const kzg = await loadKZG()
// Instantiate `common`
const common = new Common({
chain: Chain.Mainnet,
hardfork: Hardfork.Cancun,
customCrypto: { kzg },
})
Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.
Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).
Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie
library with a Node.js
web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.
Block.fromRPC()
and BlockHeader.fromRPC()
constructors to not parse the parentBeaconBlockRoot
correctly, PR #3283
Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉
Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm
name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.
This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg
initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).
Note that kzg-wasm
needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):
import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
const kzg = await loadKZG()
// Instantiate `common`
const common = new Common({
chain: Chain.Mainnet,
hardfork: Hardfork.Cancun,
customCrypto: { kzg },
})
Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.
Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).
Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie
library with a Node.js
web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.
opts
in fromProof()
, PR #3276
getAppliedKey()
method for the interface (see interface definition in @ethereumjs/common
), PR #3143
lru-cache
dependency, PR #3285
Maintenance release with downstream dependency updates, see PR #3297