Skip to content

Releases: ethereumjs/ethereumjs-monorepo

@ethereumjs/verkle v0.2.0-alpha.1

24 Mar 17:30

Choose a tag to compare

Pre-release

We are getting there! 😁 While still in an experimental stage this release makes a big leap towards stateful Verkle-based EVM execution, by applying various updates and aligning with a new experimental StatefulVerkleStateManager.

  • Use node hash as db key, PR #3472
  • Apply leaf marker on all touched values, PR #3520
  • Proof function renaming (e.g. createProof() -> createVerkleProof()), PR #3557
  • Refactor trie and verkle utils, PR #3600
  • Add and integrate StatefulVerkleStateManager, PR #3628
  • Various Verkle Fixes, PR #3650

@ethereumjs/util v10.0.0-alpha.1

24 Mar 16:04

Choose a tag to compare

Pre-release

This is a first round of alpha releases for our upcoming breaking release round with a focus on bundle size (tree shaking) and security (dependencies down + no WASM (by default)). Note that alpha releases are not meant to be fully API-stable yet and are for early testing only. This release series will be then followed by a beta release round where APIs are expected to be mostly stable. Final releases can then be expected for late October/early November 2024.

Renamings

Static Constructors

The static constructors for our library classes have been reworked to now be standalone methods (with a similar naming scheme). This allows for better tree shaking of unused constructor code:

account

See PR #3524:

  • Account.fromAccountData() -> createAccount()
  • Account.fromRlpSerializedAccount() -> createAccountFromRLP()
  • Account.fromRlpSerializedPartialAccount() -> createPartialAccountFromRLP()
  • Account.fromValuesArray() --> createAccountFromBytesArray()
  • Account.fromPartialAccountData() --> createPartialAccount()
address

See PR #3544:

  • Address.zero() -> createZeroAddress()
  • Address.fromString() -> createAddressFromString()
  • Address.fromPublicKey() -> createAddressFromPublicKey()
  • Address.fromPrivateKey() -> createAddressFromPrivateKey()
  • Address.generate() -> createContractAddress()
  • Address.generate2() -> createContractAddress2()
  • New: createAddressFromBigInt()
withdrawal

See PR #3589

  • Withdrawal.fromWithdrawalData() -> createWithdrawal()
  • Withdrawal.fromValuesArray() -> createWithdrawalFromBytesArray()
  • Withdrawal.toBytesArray() -> withdrawalToBytesArray()
request

See PR #3589

  • *Request.fromRequestData() -> create*Request()
  • *Request.fromJSON() -> create*RequestFromJSON()
  • *Request.deserialize() -> create*RequestFromRLP()

Other Breaking Changes

  • bytes: Restrict hexToBytes(), unpadHex() and hexToBigInt() to accept only hex-prefixed values, PR #3510
  • Remove deprecated initKZG() method, PR #3635
  • Renaming all camel-case Rpc-> RPC and Json -> JSON names, PR #3638
  • Remove redundant fills and zeros() function, PR #3709

Other Changes

  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668
  • kaustinen7 verkle testnet preparation (update verkle leaf structure -> BASIC_DATA), PR #3433
  • Use noble bytes conversion utilities internally, PR #3698
  • Added two simple unit conversion methods, Units.ether() and Units.gwei(), mainly to ease tx creation a bit, PRs #3734, #3736 and #3738

@ethereumjs/tx v6.0.0-alpha.1

24 Mar 16:50

Choose a tag to compare

Pre-release

This is a first round of alpha releases for our upcoming breaking release round with a focus on bundle size (tree shaking) and security (dependencies down + no WASM (by default)). Note that alpha releases are not meant to be fully API-stable yet and are for early testing only. This release series will be then followed by a beta release round where APIs are expected to be mostly stable. Final releases can then be expected for late October/early November 2024.

Renamings

Transaction Classes

The names for the tx classes have been shortened and simplified (see PRs #3533):

  • FeeMarketEIP1559Transaction -> FeeMarket1559Tx
  • AccessListEIP2930Transaction -> AccessList2930Tx
  • BlobEIP4844Transaction -> Blob4844Tx
  • EOACodeEIP7702Transaction -> EOACode7702Tx

Static Constructors

The static constructors for our library classes have been reworked to now be standalone methods (with a similar naming scheme). This allows for better tree shaking of unused constructor code (see PRs #3533 and #3597).

Here an example for the FeeMarket1559Tx class:

  • FeeMarketEIP1559Transaction.fromTxData() -> createFeeMarket1559Tx()
  • FeeMarketEIP1559Transaction.fromSerializedTx() -> createFeeMarket1559TxFromRLP()
  • FeeMarketEIP1559Transaction.fromValuesArray() -> create1559FeeMarketTxFromBytesArray()

New names from other tx types, to grasp the scheme:

  • createBlob4844Tx()
  • createAccessList2930Tx()
  • createEOACode7702Tx()

Transaction Factory

Similar renamings have been done for the generic TransactionFactory (see PRs #3514 and #3667):

  • TransactionFactory.fromTxData() -> createTx()
  • TransactionFactory.fromSerializedData() -> createTxFromRLP()
  • TransactionFactory.fromBlockBodyData() -> createTxFromBlockBodyData()
  • TransactionFactory.fromJsonRpcProvider() -> createTxFromJSONRPCProvider()
  • New: createTxFromRPC() (just from the data, without the provider fetch)

Library Methods

See: PR #3535

  • *Tx.getBaseFee() -> *Tx.getIntrinsicGas() (avoid confusion with 1559 base fee)
  • *Tx.getDataFee() -> *Tx.getDataGas() (be more explicit about method's gas unit)

EIP-7702 EOA Account Abstraction Support (experimental)

The tx library now support the creation of EIP-7702 txs, which allow to transform an EOA into a smart contract for the period of one transaction and execute the respective bytecode, see PRs #3470 and #3577.

The following is an example on how to create an EIP-7702 tx (note that you need to replace the authorizationList parameters with real-world tx and signature values):

import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import { createEOACode7702Tx } from '@ethereumjs/tx'
import { type PrefixedHexString, createAddressFromPrivateKey, randomBytes } from '@ethereumjs/util'

const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString

const common = new Common({ chain: Mainnet, hardfork: Hardfork.Cancun, eips: [7702] })
const tx = createEOACode7702Tx(
  {
    authorizationList: [
      {
        chainId: '0x2',
        address: `0x${'20'.repeat(20)}`,
        nonce: '0x1',
        yParity: '0x1',
        r: ones32,
        s: ones32,
      },
    ],
    to: createAddressFromPrivateKey(randomBytes(32)),
  },
  { common },
)

Own Tx Parameter Set

HF-sensitive parameters like txGas were previously by design all provided by the @ethereumjs/common library. This meant that all parameter sets were shared among the libraries and libraries carried around a lot of unnecessary parameters.

With the Common refactoring from PR #3537 parameters now moved over to a dedicated params.ts file (exposed as e.g. paramsTx) within the parameter-using library and the library sets its own parameter set by internally calling a new Common method updateParams(). For shared Common instances parameter sets then accumulate as needed.

Beside having a lighter footprint this additionally allows for easier parameter customization. There is a new params constructor option which leverages this new possibility and where it becomes possible to provide a fully customized set of core library parameters.

New Common API

There is a new Common API for simplification and better tree shaking, see PR #3545. Change your Common initializations as follows (see Common release for more details):

// old
import { Chain, Common } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet })

// new
import { Common, Mainnet } from '@ethereumjs/common'
const common = new Common({ chain: Mainnet })

JavaScript KZG Support (no more WASM)

The WASM based KZG integration for 4844 support has been replaced with a pure JS-based solution (micro-eth-singer, thanks to paulmillr for the cooperation and Andrew for the integration! ❤️), see PR #3674. This makes this library fully independent from Web Assembly code for all supported functionality! 🎉 The JS version is indeed even faster then the WASM one (we benchmarked), so we recommend to just switch over!

KZG is one-time initialized by providing to Common, in the updated version now like this:

import { trustedSetup } from '@paulmillr/trusted-setups/fast.js'
import { KZG as microEthKZG } from 'micro-eth-signer/kzg'

const kzg = new microEthKZG(trustedSetup)
// Pass the following Common to the EthereumJS library
const common = new Common({
  chain: Mainnet,
  customCrypto: {
    kzg,
  },
})

Other Breaking Changes

  • New default hardfork: Shanghai -> Cancun, see PR #3566
  • Renaming all camel-case Rpc-> RPC and Json -> JSON names, PR #3638

Other Changes

  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Add T9N (TransactionTool) test consumption, PR #3742
  • Upgrade ethereum-cryptography to v3, PR #3668

@ethereumjs/statemanager v3.0.0-alpha.1

24 Mar 17:39

Choose a tag to compare

Pre-release

This is a first round of alpha releases for our upcoming breaking release round with a focus on bundle size (tree shaking) and security (dependencies down + no WASM (by default)). Note that alpha releases are not meant to be fully API-stable yet and are for early testing only. This release series will be then followed by a beta release round where APIs are expected to be mostly stable. Final releases can then be expected for late October/early November 2024.

Renamings

Default Merkle SM

We have renamed the previously called DefaultStateManager to a more neutral MerkleStateManager, see PR #3641, to reflect the rising importance of other state managers and align with future (at least) dual Merkle/Verkle state world:

  • DefaultStateManager -> MerkleStateManager

Core State get/put Methods

The names for the core state manager methods to access and write state have been simplified, see PR #3541:

  • getContractCode() -> getCode()
  • putContractCode() -> putCode()
  • getContractCodeSize() -> getCodeSize()
  • getContractStorage() -> getStorage()
  • putContractStorage() -> putStorage()
  • clearContractStorage() -> clearStorage()

Proof Functionality

The following proof methods have been taken out of the core classes and made standalone-methods (tree shaking + keep core classes limited to core state functionality), see PR #3672:

  • MerkleStateManager.getProof() -> getMerkleStateProof()

  • MerkleStateManager.fromProof() -> fromMerkleStateProof()

  • MerkleStateManager.addStorageProof() -> addMerkleStateStorageProof()

  • MerkleStateManager.addProofData() -> addMerkleStateProofData()

  • MerkleStateManager.verifyProof() -> verifyMerkleStateProof()

  • RPCStateManager.getProof() -> getRPCStateProof()

  • VerkleStateManager.getProof() -> getVerkleStateProof()

  • VerkleStateManager.verifyVerkleProof() -> verifyVerkleStateProof()

New Common API

There is a new Common API for simplification and better tree shaking, see PR #3545. Change your Common initializations as follows (see Common release for more details):

// old
import { Chain, Common } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet })

// new
import { Common, Mainnet } from '@ethereumjs/common'
const common = new Common({ chain: Mainnet })

New SimpleStateManager

We have added a new < 200 LoC state manager SimpleStateManager, which has less dependencies (no tree backend) and allows for easier state reasoning and debugging, since there is no code or cache usage overhead. This new state manager is now also the default state manager for the EVM. Note that this state manager is meant to be used for simple use cases and should be replaced by a cache-backed state manager (in most cases atm: MerkleStateManager) for things like mainnet tx execution.

The new state manager can be used like this:

import { Account, createAddressFromPrivateKey, randomBytes } from '@ethereumjs/util'

import { SimpleStateManager } from '@ethereumjs/statemanager'

const main = async () => {
  const sm = new SimpleStateManager()
  const address = createAddressFromPrivateKey(randomBytes(32))
  const account = new Account(0n, 0xfffffn)
  await sm.putAccount(address, account)
  console.log(await sm.getAccount(address))
}

void main()

Cache API Refactor

There is a new abstraction layer for the account, code and storage caches for all state managers, called Caches, see PRs #3554, #3569 and #3596.

This allows for a cleaner separation of cache and pure state access code and also enables tree shaking for use cases where the caches are not needed.

The API along cache initialization slightly changes along with this. There is a new caches option and a a Caches object must be created and passed in explicitly along state manager initialization if caches should be used:

import { Caches, MerkleStateManager } from '@ethereumjs/statemanager'

const sm = new MerkleStateManager({ caches: new Caches() })

TypeScript: StateManagerInterface Refactoring/Simplification

The StateManagerInterface, which all state managers implement, is located in the @ethereumjs/common package for re-usability reasons. Along the breaking release work, this interface as been strongly simplified, see PRs #3543 and #3541. A dedicated EVMStateManagerInterface has been removed, which allows for easier state manager usage within the EVM package.

Somewhat non-core functionality is now marked as optional (with a ?), so if you make custom usage of the state manager you might need to add some ! in your TypeScript code. Have a look at the interface linked above to see what has changed.

Other Breaking Changes

  • Do not throw calling getContractStorage() on non-existing accounts, PR #3536
  • Renaming all camel-case Rpc-> RPC and Json -> JSON names, PR #3638

Other Changes

  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668
  • kaustinen7 verkle testnet preparation (update verkle leaf structure -> BASIC_DATA), PR #3433
  • Switch js-sdsl to js-sdsl/orderedMap sub package, PR #3528

@ethereumjs/rlp v6.0.0-alpha.1

24 Mar 15:25

Choose a tag to compare

Pre-release
  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668
  • Use noble bytes conversion utilities internally, PR #3698

@ethereumjs/mpt v7.0.0-alpha.1

24 Mar 17:27

Choose a tag to compare

Pre-release

This is a first round of alpha releases for our upcoming breaking release round with a focus on bundle size (tree shaking) and security (dependencies down + no WASM (by default)). Note that alpha releases are not meant to be fully API-stable yet and are for early testing only. This release series will be then followed by a beta release round where APIs are expected to be mostly stable. Final releases can then be expected for late October/early November 2024.

Renamings

New Package Name

The trie package itself has been renamed, see PR #3719:

  • @ethereumjs/trie -> @ethereumjs/mpt

This is to avoid confusion with Verkle in the future! Please update your dependencies and imports accordingly! The versioning of the package will be continuous from the old package and not "restart" in whatever way.

Main Class

The main class has been renamed to avoid confusion with Verkle, see PR #3717:

  • Trie -> MerklePatriciaTrie

Static Constructors

The static constructors for our library classes have been reworked to now be standalone methods (with a similar naming scheme). This allows for better tree shaking of unused constructor code (see PRs #3515:

  • Trie.create() -> createMPT()

Proof Functionality

Proof functionality also has been extracted from the trie class to make the core code base smaller, see PR #3551, also the names have been made more expressive to better distinguish between Merkle/Verkle, see PRs #3557, #3718 and #3730:

  • Trie.createFromProof() -> createMPTFromProof()
  • Trie.verifyProof() -> verifyMerkleProof()
  • Trie.verifyRangeProof() -> verifyMerkleRangeProof()
  • Trie.createProof() -> createMerkleProof()
  • Trie.updateFromProof() -> updateMPTFromMerkleProof()

Replaced Stream Functionality

One of the largest burdens for the trie library - dependency wise - was the readable-stream dependency, used for implementing a read stream for full trie dumps in a platform independent way. This dependency has a lot of downstream dependencies and posed therefore a strong and unnecessary security risk for our upstream stack.

We have now removed the stream functionality and the associated dependency and replaced with a simpler async value map retrieval by using trie.getValueMap(), see PR #3519. For an example see the MPT examples folder.

Other Breaking Changes

  • Refactor trie util helpers, PR #3534
  • Improve node typings and class architecture, PR #3708
  • Rename trie helpers to mpt, PR #3718

Other Changes

  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668
  • Address type issues and type-related improvements, PR #3624
  • Debug logger namespace standardization (use with # for the core logger, so e.g. mpt:#), PR #3692

@ethereumjs/genesis v0.3.0-alpha.1

24 Mar 16:58

Choose a tag to compare

Pre-release
  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668

@ethereumjs/evm v4.0.0-alpha.1

24 Mar 17:42

Choose a tag to compare

Pre-release

This is a first round of alpha releases for our upcoming breaking release round with a focus on bundle size (tree shaking) and security (dependencies down + no WASM (by default)). Note that alpha releases are not meant to be fully API-stable yet and are for early testing only. This release series will be then followed by a beta release round where APIs are expected to be mostly stable. Final releases can then be expected for late October/early November 2024.

Renamings

Static Constructors

The static constructors for our library classes have been reworked to now be standalone methods (with a similar naming scheme). This allows for better tree shaking of unused constructor code (see PR #3516):

  • EVM.create() -> createEVM

Pure JavaScript EVM (no default WASM)

This is the first EthereumJS EVM release where we could realize a fully WASM-free EVM by default! 🤩 We were finally able to replace all crypto primitives which still relied on Web Assembly code with pure JavaScript/TypeScript pendants, thanks a lot to @paulmillr from Noble for the cooperation on this! ❤️

Together with a strong dependency reduction being accomplished along this release this opens up for new use cases for the JavaScript EVM in more security sensitive contexts. The code of the EVM is now compact enough that it gets fully auditable (and we plan an EVM audit for 2025), see e.g. here for an EVM bundle snapshot including all dependencies!

So, what changed?

Generic BN254 (alt_BN128) Interface for Precompiles

The previously WASM-backed BN254 (or previously called alt_BN128) precompile implementations have first decoupled from the WASM-backend by introducing a generic interface EVMBN254Interface, see PR #3564. Then the WASM version - using the rustbn-wasm binding library to the BN Rust library - has been replaced by using the corresponding JS functionality from noble-curves.

It is still possible to use the WASM version (if more performance is needed) like this using the bn254 constructor option:

import { initRustBN } from 'rustbn-wasm'

const bn254 = await initRustBN()
const evm = await createEVM({ bn254: new RustBN254(bn254) })

JavaScript KZG Support

The WASM based KZG integration for 4844 support and usage for the EVM KZG point evaluation precompile has been replaced with a pure JS-based solution (micro-eth-singer, see PR #3674. The JS version is indeed even faster then the WASM one (we benchmarked), so we recommend to just switch over!

KZG is one-time initialized by providing to Common, in the updated version now like this:

import { trustedSetup } from '@paulmillr/trusted-setups/fast.js'
import { KZG as microEthKZG } from 'micro-eth-signer/kzg'

const kzg = new microEthKZG(trustedSetup)
// Pass the following Common to the EthereumJS library
const common = new Common({
  chain: Mainnet,
  customCrypto: {
    kzg,
  },
})

Note that you need to provide this if you want to have a fully Shanghai/Cancun compliant EVM (otherwise the KZG precompile will not work if called)!

Own EVM Parameter Set

HF-sensitive parameters like maxInitCodeSize were previously by design all provided by the @ethereumjs/common library. This meant that all parameter sets were shared among the libraries and libraries carried around a lot of unnecessary parameters.

With the Common refactoring from PR #3537 parameters now moved over to a dedicated params.ts file (exposed as e.g. paramsEVM) within the parameter-using library and the library sets its own parameter set by internally calling a new Common method updateParams(). For shared Common instances parameter sets then accumulate as needed.

Beside having a lighter footprint this additionally allows for easier parameter customization. There is a new params constructor option which leverages this new possibility and where it becomes possible to provide a fully customized set of core library parameters.

New Common API

There is a new Common API for simplification and better tree shaking, see PR #3545. Change your Common initializations as follows (see Common release for more details):

// old
import { Chain, Common } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet })

// new
import { Common, Mainnet } from '@ethereumjs/common'
const common = new Common({ chain: Mainnet })

Mega EOF Support (Experimental)

This is one of the few big EIP additions within this breaking release series: Jochem has re-taken upon EOF and fully implemented the new Mega EOF specification, see #3440 and #3553! ❤️ Note that - while most code should be there in its final form - the implementation is still marked as experimental - since there are still various moving parts within EOF.

It would get too extensive to fully recite the functional changes here. If you are interested in EOF please have a look at the above linked core implementation PR and see the EVM examples folder for EOF usage examples.

TypeScript: Use generic StateManagerInterface

The dedicated EVMStateManagerInterface has been removed and the EVM now uses the generic StateManagerInterface (located in the @ethereumjs/util package for re-usability reasons), see PR #3543. This comes along with some refactoring and adjustments on the interface itself (see @ethereumjs/statemanager release notes for more details).

This simplifies the StateManager usage and allows for easier swapping between different state managers (stateful/stateless, Verkle/Merkle, RPC).

Other Breaking Changes

  • New SimpleStateManager as default state manager (reduces bundle size), PR #3482
  • New default hardfork: Shanghai -> Cancun, see PR #3566
  • Removed EIP-3074 (AUTH / AUTHCALL opcodes) support, since superseded by EIP-7702, PR #3582
  • Rename ec* BN254 (aka alt_bn128) precompile parameters and names to bn254* (e.g. param ecAddGas -> bn254AddGas, name ECMUL -> BN254MUL), partly also BLS name alignment, PR #3655

Other Changes

  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668
  • Fix BLS usage for BLS12-381 precompiles, PR #3623
  • kaustinen7 verkle testnet preparation (update verkle leaf structure -> BASIC_DATA), PR #3433

@ethereumjs/ethash v4.0.0-alpha.1

24 Mar 17:00

Choose a tag to compare

Pre-release
  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668

@ethereumjs/devp2p v7.0.0-alpha.1

24 Mar 16:15

Choose a tag to compare

Pre-release

New Common API

There is a new Common API for simplification and better tree shaking, see PR #3545. Change your Common initializations as follows (see Common release for more details):

// old
import { Chain, Common } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet })

// new
import { Common, Mainnet } from '@ethereumjs/common'
const common = new Common({ chain: Mainnet })

Other Changes

  • Upgrade to TypeScript 5, PR #3607
  • Node 22 support, PR #3669
  • Upgrade ethereum-cryptography to v3, PR #3668
  • "Guard" logging to only run with ethjs guard, PR #3654
  • Debug logger namespace standardization (use with # for the core logger, so e.g. devp2p:#), PR #3692