Skip to content

Releases: ethereumjs/ethereumjs-monorepo

@ethereumjs/evm v3.1.0

15 Aug 11:42
27e2c02
Compare
Choose a tag to compare

EIP-2537 BLS Precompiles (Prague)

Starting with this release the EVM support the BLS precompiles introduced with EIP-2537. These precompiles run natively using the @noble/curves library (❤️ to @paulmillr!), see PRs #3350 and #3471.

An alternative WASM implementation (using bls-wasm) can be optionally used like this if needed for performance reasons:

import { EVM, MCLBLS } from '@ethereumjs/evm'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Prague })
await mcl.init(mcl.BLS12_381)
const mclbls = new MCLBLS(mcl)
const evm = await EVM.create({ common, bls })

Verkle Dependency Decoupling

We have relatively light-heartedly added a new @ethereumjs/verkle main dependency to the VM/EVM stack in the v7.2.1 release, which added an additional burden to the bundle size by several hundred KB and additionally draws in unnecessary WASM code. Coupling with Verkle has been refactored in PR #3462 and the direct dependency has been removed again.

An update to this release is therefore strongly recommended even if other fixes or features are not that relevant for you right now.

Verkle Updates

  • Adds ability to run EIP-7702 EOA code transactions (see tx library for full documentation), see PR #3470
  • Fixes for Kaustinen4 support, PR #3269
  • Kaustinen5 related fixes, PR #3343
  • Kaustinen6 adjustments, verkle-cryptography-wasm migration, PRs #3355 and #3356
  • Update kzg-wasm to 0.4.0, PR #3358
  • Shift Verkle to osaka hardfork, PR #3371
  • Fix accessWitness passing, PR #3405
  • Remove the hacks to prevent account cleanups of system contracts, PR #3418
  • Fix EIP-2935 address conversion issues, PR #3447

Other Features

  • Add support for retroactive EIP-7610, PR #3480
  • Adds bundle visualizer (to be used with npm run visualize:bundle), PR #3463
  • Stricter prefixed hex typing, PRs #3348, #3427 and #3357 (some changes removed in PR #3382 for backwards compatibility reasons, will be reintroduced along upcoming breaking releases)

Other Changes

  • Removes support for EIP-2315 simple subroutines for EVM (deprecated with an alternative version integrated into EOF), PR #3342
  • Update mcl-wasm Dependency (Esbuild Issue), PR #3461

Bugfixes

  • BLS precompile fixes, PR #3400
  • Ignore precompile addresses for some target access events, PR #3366

@ethereumjs/ethash v3.0.4

15 Aug 11:32
27e2c02
Compare
Choose a tag to compare

Maintenance release with downstream dependency updates, see PR #3527

@ethereumjs/devp2p v6.1.3

15 Aug 11:08
27e2c02
Compare
Choose a tag to compare

Maintenance release with downstream dependency updates, see PR #3527

@ethereumjs/common v4.4.0

15 Aug 10:56
27e2c02
Compare
Choose a tag to compare

EIP-7685 Requests: EIP-6110 (Deposits) / EIP-7002 (Withdrawals) / EIP-7251 (Consolidations)

This library now supports EIP-6110 deposit requests, see PR #3390, EIP-7002 withdrawal requests, see PR #3385 and EIP-7251 consolidation requests, see PR #3477 as well as the underlying generic execution layer request logic introduced with EIP-7685 (PR #3372).

These new request types will be activated with the Prague hardfork, see @ethereumjs/block README for detailed documentation.

Verkle Updates

  • Fixes for Kaustinen4 support, PR #3269
  • Kaustinen5 related fixes, PR #3343
  • Kaustinen6 adjustments, verkle-cryptography-wasm migration, PRs #3355 and #3356
  • Verkle decoupling, PR #3462

Other Features

  • Adds support for EIP-7702 EOA code transactions (outdated) (see tx library for full documentation), see PR #3470
  • Adds support for EIP-2935 Serve Historical Block Hashes from State (Prague) (see EVM for full docs) as well as the related EIP-7709, PR #3475
  • Stricter prefixed hex typing, PRs #3348, #3427 and #3357 (some changes removed in PR #3382 for backwards compatibility reasons, will be reintroduced along upcoming breaking releases)

Other Changes

  • Removes support for EIP-2315 simple subroutines for EVM (deprecated with an alternative version integrated into EOF), PR #3342
  • Clean up access to deposit address, PR #3411
  • Add spec test for 2935 contract code and update history storage address, PR #3373
  • Parse deposit contract address from geth genesis for chain config, PR #3422

Bugfixes

  • BLS gas prices fixes, PR #3400

@ethereumjs/client v0.10.2

15 Aug 11:47
27e2c02
Compare
Choose a tag to compare

This release comes with some RPC improvements as well as various updates to catch up for testnets preparing for the Prague hardfork as well as the Verkle tree integration. Note that for running/participating in the latest Prague and Verkle testnets it is still needed to join with a build from master since testnets are evolving so quickly that it is not practical to catch up with official client releases!

Verkle Updates

  • Fixes for Kaustinen4 support, PR #3269
  • Kaustinen5 related fixes, PR #3343
  • CLI option --ignoreStatelessInvalidExecs for Verkle debugging, PR #3269
  • Kaustinen6 adjustments, verkle-cryptography-wasm migration, PRs #3355 and #3356
  • Update kzg-wasm to 0.4.0, PR #3358
  • Shift Verkle to osaka hardfork, PR #3371
  • Simplify --ignoreStatelessInvalidExecs to just a boolean flag, PR #3395
  • Add verkle execution support to executeBlocks(), PR #3406
  • Verkle decoupling in underlying libraries, PR #3462

Other Features

  • Integrates support for EIP-7702 EOA code transactions (outdated) (see tx library for full documentation), see PR #3470
  • New --startExectionFrom and --startExecution CLI options, PR #3269
  • Add eth_blobBaseFee RPC endpoint, PR #3436
  • Add support for pending in eth_getTransactionCount RPC method, PR #3415
  • Add support for multiple sources of rlp blocks when loading with --loadBlocksFromRlp, PR #3442
  • Basic Prometheus metrics support (not many metrics yet), PR #3287

Other Changes

  • ESM-only client build, PRs #3359 and #3414
  • Add execution api v4 handling to engine, PR #3399
  • New mechanism to keep latest block from peers updated, PR #3354
  • Better --execution flag guard, PR #3363
  • Stricter prefixed hex typing, PR #3348
  • Update multiaddress dependency, PR #3384
  • Internalize QHeap dependency, PR #3451
  • Internalize jwt-simple dependency, PR #3458

Bugfixes

  • Fixes for the eth_estimateGas RPC endpoint, PR #3416
  • Fixes tx status in eth_getTransactionReceipt RPC method, PR #3435
  • Fixes the "block to payload" serialization for getPayloadV4, PR #3409
  • Fix the getPayloadV4 with a deposit tx and expected deposit requests, PR #3410

@ethereumjs/blockchain v7.3.0

15 Aug 11:40
27e2c02
Compare
Choose a tag to compare

EIP-7685 Requests: EIP-6110 (Deposits) / EIP-7002 (Withdrawals) / EIP-7251 (Consolidations)

This library now supports EIP-6110 deposit requests, see PR #3390, EIP-7002 withdrawal requests, see PR #3385 and EIP-7251 consolidation requests, see PR #3477 as well as the underlying generic execution layer request logic introduced with EIP-7685 (PR #3372).

These new request types will be activated with the Prague hardfork, see @ethereumjs/block README for detailed documentation.

Verkle Updates

  • Fix the block body parsing as well as save/load from blockchain, PR #3392
  • Handle nil block bodies for backwards compatibility, PR #3394

Other Features

  • Support for EIP-7685 blocks containing withdrawal and/or deposit requests (see @ethereumjs/block for main documentation), PR #3372
  • Stricter prefixed hex typing, PRs #3348, #3427 and #3357 (some changes removed in PR #3382 for backwards compatibility reasons, will be reintroduced along upcoming breaking releases)

@ethereumjs/block v5.3.0

15 Aug 11:31
27e2c02
Compare
Choose a tag to compare

Blocks with EIP-7685 Consensus Layer Requests

Starting with this release this library supports requests to the consensus layer (see PRs #3372 and #3393) which have been introduced with EIP-7685 and will come into play for deposit and withdrawal requests along the upcoming Prague hardfork.

EIP-6110 Deposit Requests

EIP-6110 introduces deposit requests allowing beacon chain deposits being triggered from the execution layer, see PRs #3390 and #3397. Starting with this release this library supports deposit requests and a containing block can be instantiated as follows:

import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'
import {
  bytesToBigInt,
  DepositRequest,
  randomBytes,
  type CLRequest,
  type CLRequestType,
} from '@ethereumjs/util'

const main = async () => {
  const common = new Common({
    chain: Chain.Mainnet,
    hardfork: Hardfork.Prague,
  })

  const depositRequestData = {
    pubkey: randomBytes(48),
    withdrawalCredentials: randomBytes(32),
    amount: bytesToBigInt(randomBytes(8)),
    signature: randomBytes(96),
    index: bytesToBigInt(randomBytes(8)),
  }
  const request = DepositRequest.fromRequestData(depositRequestData) as CLRequest<CLRequestType>
  const requests = [request]
  const requestsRoot = await Block.genRequestsTrieRoot(requests)

  const block = Block.fromBlockData(
    {
      requests,
      header: { requestsRoot },
    },
    { common }
  )
  console.log(
    `Instantiated block with ${
      block.requests?.length
    } request, requestTrieValid=${await block.requestsTrieIsValid()}`
  )
}

main()

Have a look at the EIP for some guidance on how to use and fill in the various deposit request parameters.

EIP-7002 Withdrawal Requests

EIP-7002 introduces the possibility for validators to trigger exits and partial withdrawals via the execution layer, see PR #3385. Starting with this release this library supports withdrawal requests and a containing block can be instantiated as follows:

import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'
import {
  bytesToBigInt,
  randomBytes,
  WithdrawalRequest,
  type CLRequest,
  type CLRequestType,
} from '@ethereumjs/util'

const main = async () => {
  const common = new Common({
    chain: Chain.Mainnet,
    hardfork: Hardfork.Prague,
  })

  const withdrawalRequestData = {
    sourceAddress: randomBytes(20),
    validatorPubkey: randomBytes(48),
    amount: bytesToBigInt(randomBytes(8)),
  }
  const request = WithdrawalRequest.fromRequestData(
    withdrawalRequestData
  ) as CLRequest<CLRequestType>
  const requests = [request]
  const requestsRoot = await Block.genRequestsTrieRoot(requests)

  const block = Block.fromBlockData(
    {
      requests,
      header: { requestsRoot },
    },
    { common }
  )
  console.log(
    `Instantiated block with ${
      block.requests?.length
    } withdrawal request, requestTrieValid=${await block.requestsTrieIsValid()}`
  )
}

main()

Have a look at the EIP for some guidance on how to use and fill in the various withdrawal request parameters.

EIP-7251 Consolidation Requests

EIP-7251 introduces consolidation requests allowing staked ETH from more than one validator on the beacon chain to be consolidated into one validator, triggered from the execution layer, see PR #3477. Starting with this release this library supports consolidation requests and a containing block can be instantiated as follows:

// ./examples/7251Requests.ts

import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'
import {
  bytesToBigInt,
  ConsolidationRequest,
  randomBytes,
  type CLRequest,
  type CLRequestType,
} from '@ethereumjs/util'

const main = async () => {
  const common = new Common({
    chain: Chain.Mainnet,
    hardfork: Hardfork.Prague,
  })

  const consolidationRequestData = {
    sourceAddress: randomBytes(20),
    sourcePubkey: randomBytes(48),
    targetPubkey: randomBytes(48),
  }
  const request = ConsolidationRequest.fromRequestData(
    consolidationRequestData
  ) as CLRequest<CLRequestType>
  const requests = [request]
  const requestsRoot = await Block.genRequestsTrieRoot(requests)

  const block = Block.fromBlockData(
    {
      requests,
      header: { requestsRoot },
    },
    { common }
  )
  console.log(
    `Instantiated block with ${
      block.requests?.length
    } consolidation request, requestTrieValid=${await block.requestsTrieIsValid()}`
  )
}

main()

Have a look at the EIP for some guidance on how to use and fill in the various deposit request parameters.

Verkle Updates

  • Fixes for Kaustinen4 support, PR #3269
  • Update kzg-wasm to 0.4.0, PR #3358
  • Shift Verkle to osaka hardfork, PR #3371
  • Fix the block body parsing as well as save/load from blockchain, PR #3392
  • Verkle type/interface refactoring (moved to Common package), PR #3462

Other Features

  • New Block.toExecutionPayload() method to map to the execution payload structure from the beacon chain, PR #3269
  • Stricter prefixed hex typing, PRs #3348, #3427 and #3357 (some changes removed in PR #3382 for backwards compatibility reasons, will be reintroduced along upcoming breaking releases)

Other Changes

  • Make EIP-4895 withdrawals trie check consistent with tx trie, PR #3338
  • Rename deposit receipt to deposit request, PR #3408
  • Enhances typing of CL requests, PR #3398
  • Rename withdrawal request's validatorPublicKey to validatorPubkey, PR #3474

@ethereumjs/wallet v2.0.3

18 Mar 12:39
48e6a30
Compare
Choose a tag to compare

Maintenance release with downstream dependency updates, see PR #3297

@ethereumjs/[email protected]

18 Mar 12:58
48e6a30
Compare
Choose a tag to compare

New EVM.create() Async Static Constructor / Mandatory VM.create() Constructor

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.

Full 4844 Browser Readiness

WASM KZG

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).

Trie Node.js Import Bug

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.

Other Changes

  • Support for Preimage generation (verkle-related, experimental), new reportPreimages VM.runTx() option, PR #3143 and #3298
  • Early support for EIP-2935 - "Save historical block hashes in state" (Verkle related, likely subject to change), PRs #3268 and #3327

@ethereumjs/util v9.0.3

18 Mar 12:22
48e6a30
Compare
Choose a tag to compare
  • Allow optional trustedSetupPath for the initKZG() method, PR #3296