Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency @ethereumjs/vm to v8 #442

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 19, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@ethereumjs/vm (source) 6.5.0 -> 8.1.1 age adoption passing confidence

Release Notes

ethereumjs/ethereumjs-monorepo (@​ethereumjs/vm)

v8.1.1: @​ethereumjs/vm v8.1.1

Compare Source

  • Fixes a Transient Storage EIP-1153 bug in the underlying EVM related to not clearing Transient Storage after creating a contract at tx-level (thanks @​yann300 ❤️), PR #​3643

v8.1.0: @​ethereumjs/util v8.1.0

Compare Source

This release is part of a final planned release round for the current major EthereumJS release versions, with next major versions planned to be released in July 2023.

It mainly removes all non-final EIP-4844, KZG and SSZ code from the libraries (mainly block, tx, util, evm, vm, blockchain) - see PR #​2721 - to allow for a clean slate for the current major versions to transition to maintenance mode. In particular the @chainsafe/ssz dependency is removed from the @ethereumjs/util library, which is a dependency of all other upstream EthereumJS libraries and removal therefore makes the whole stack lighter again.

If you are interested in continuously following EIP-4844 work have a look at and follow our upcoming breaking releases where major changes will be integrated with 4844 nearing a final state.

v8.0.0

Compare Source

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

v7.2.1

Compare Source

v7.2.0: @​ethereumjs/vm v7.2.0

Compare Source

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.

At the moment using the Node.js bindings for the c-kzg library is the only option to get KZG related functionality to work, note that this solution is not browser compatible. We are currently working on a WASM build of that respective library. Let us know on the urgency of this task! 😆

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.

v7.1.0: @​ethereumjs/vm v7.1.0

Compare Source

New EVM/VM Profiler

This releases ships with a completely new dedicated EVM/VM profiler (❤️ to Jochem for the integration) to measure how the different opcode implementations are doing, see PR #​2988, #​3011, #​3013 and #​3041.

Most of profiling is taking place in the EVM (so: the dedicated opcode profiling), see the respective README section for usage instructions and the EVM v2.1.0 CHANGELOG for latest performance gains.

The VM adds to the profiler (see new profiler option) by adding output within the tx or block scope along runTx() or runBlock() runs (committing state, block rewards,...).

The VM profiler addition now also allows for running blockchain or state tests with the profiler activated, e.g. to benchmark certain extreme-case or attack scenarios, see DEVELOPER docs for usage instructions (see PR #​3115).

EIP-7516 BLOBBASEFEE Opcode

This release supports EIP-7516 with a new BLOBBASEFEE opcode added to and scheduled for the Dencun HF, see PR #​3035 and #​3068. The opcode returns the value of the blob base-fee of the current block it is executing in.

Dencun devnet-11 Compatibility

This release contains various fixes and spec updates related to the Dencun (Deneb/Cancun) HF and is now compatible with the specs as used in devnet-11 (October 2023).

  • Update EIP-4788: do not use precompile anymore but use the pre-deployed bytecode, PR #​2955
  • Additional EIP-4788 updates (address + modulus), PR #​3068
  • Update the beacon block root contract address, PR #​3003

Bugfixes

  • Fix block builder london HF transition, PR #​3039

Other Changes

  • Allow for users to decide if to either downlevel (so: adopt them for a short-lived scenario) state caches or not on shallowCopy() by adding a new downlevelCaches parameter (default: true), PR #​3063
  • Update ethereum tests to 12.3, PR #​2971
  • Update ethereum tests to 12.4, PR #​3052
  • Reactivate selected slow tests, PR #​2991
  • Better error message for runTx() gasLimit check to avoid confusion with EIP1559 base fee, PR #​3118

v7.0.0: @​ethereumjs/vm v7.0.0

Compare Source

Final release version from the breaking release round from Summer 2023 on the EthereumJS libraries, thanks to the whole team for this amazing accomplishment! ❤️ 🥳

See RC1 release notes for the main change description.

Following additional changes since RC1:


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/ethereumjs-vm-8.x branch from b37258b to 3f24a27 Compare August 15, 2024 13:14
@renovate renovate bot force-pushed the renovate/ethereumjs-vm-8.x branch from 3f24a27 to 109eae7 Compare September 9, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants