Skip to content

@ethereumjs/vm v6.4.0

Compare
Choose a tag to compare
@holgerd77 holgerd77 released this 24 Feb 10:20
· 859 commits to master since this release
47c293d

Functional Shanghai Support

This release fully supports all EIPs included in the Shanghai feature hardfork scheduled for early 2023. Note that a timestamp to trigger the Shanghai fork update is only added for the sepolia testnet and not yet for goerli or mainnet.

You can instantiate a Shanghai-enabled Common instance for your transactions with:

import { Common, Chain, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai })

Note: that this is only a finalizing release by e.g. integrating an updated @ethereumjs/common library with an updated Shanghai HF setting and all Shanghai related EIP functionality has been already released in former releases. Do a fulltext search on the EIP numbers in the EVM/VM CHANGELOG files for additional information and usage instructions.

Experimental EIP-4844 Shard Blob Transactions Support

This release supports an experimental version of the blob transaction type introduced with EIP-4844 as being specified in the 01d3209 EIP version from February 8, 2023 and deployed along eip4844-devnet-4 (January 2023), see PR #2349 as well as PRs #2522 and #2526.

Initialization

To run VM/EVM related EIP-4844 functionality you have to active the EIP in the associated @ethereumjs/common library:

import { Common, Chain, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai, eips: [4844] })

EIP-4844 comes with a new opcode DATAHASH and adds a new point evaluation precompile at address 0x14 in the underlying @ethereumjs/evm package.

Note: Usage of the point evaluation precompile needs a manual KZG library installation and global initialization, see KZG Setup for instructions.

Shard Blob Transactions and Block Building

The VM is now capable of running blob-including txs and blocks with VM.runTx() and VM.runBlock() taking the new gas costs for blob transactions into account. The underlying EVM v1.3.0 now supports the new DATAHASH opcode and the new point evaluation precompile.

The Block Builder API (see README) has been expanded to now also allow for building blocks including shard blob transactions and calculate the correct values for data gas usage.

Other Changes

  • Added minerValue as a getter to the BlockBuilder and a result value for RunTxResult, PR #2457
  • New option skipHardforkValidation for VM.runTx() and VM.runBlock(), PR #2486
  • Breaking (for experimental feature): Changes withdrawal amount representation from WEI to GWEI, see PR #2483
  • More flexible logic to execute pre-/post Merge txs with VM.runTx() when exact HF is not known, see PR #2505
  • VM/EEI copy fixes, PR #2529
  • Block builder related logic updates in VM.buildBlock() and VM.runTx(), PR #2533