Skip to content

Releases: ethereumjs/ethereumjs-monorepo

@ethereumjs/common v4.2.0

08 Feb 16:01
b258fd9
Compare
Choose a tag to compare

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.

The following is an example using the @polkadot/wasm-crypto package:

import { keccak256, waitReady } from '@polkadot/wasm-crypto'
import { Chain, Common } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'

const main = async () => {
  // @polkadot/wasm-crypto specific initialization
  await waitReady()

  const common = new Common({ chain: Chain.Mainnet, customCrypto: { keccak256 } })
  const block = Block.fromBlockData({}, { common })

  // Method invocations within EthereumJS library instantiations where the common
  // instance above is passed will now use the custom keccak256 implementation
  console.log(block.hash())
}

main()

We internally use this new feature for various crypto overwrites within the client package, see Client cli.ts implementation for guidance on how to setup with other crypto primitives (e.g. ECDSA signature verification).

Note: replacing native JS crypto primitives with WASM based libraries comes with new security assumptions (additional external dependencies, unauditability of WASM code). It is therefore recommended to evaluate your usage context before applying!

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.

Other Changes

  • Schedule Cancun for testnets, PR #3211
  • Internalize crc dependency (security), PR #3224
  • Added Hardfork.Prague as a new hardfork (experimental), PR #3139

@ethereumjs/client v0.10.0

08 Feb 19:17
11f3a9c
Compare
Choose a tag to compare

This client release now comes with official Dencun hardfork support 🎉 and by default uses WASM for crypto primitives for faster block execution times.

Dencun Hardfork Support

This release now officially supports networks running with or switching to the Dencun hardfork ruleset by including the finalized underlying EthereumJS libraries for the various functionality parts (EVM, Block and Tx libraries).

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 EIPs now supported along a Dencun switch (called Cancun for the execution switch part):

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

Note that while HF timestamp switches for all testnets are included, a mainnet HF timestamp has not yet been set in this release.

WASM Crypto Support

With this release the client uses WASM by default for all crypto related operations like hashing or signature verification, see PR #3192. As a WASM crypto library @polkadot/wasm-crypto is being used and WASM comes into play in the EVM for hashing opcodes and precompiles, block and tx hashing and ECDSA signature verfication down to trie key hashing and all hashing and signature functionality in the devp2p layer.

This makes up for a significantly lighter and sped-up client experience regarding both block execution and sync times.

Note that this functionality can be disabled by using the --useJsCrypto flag.

Stability Fixes

  • Patch fcu skeleton blockfill process to avoid chain reset, PR #3137
  • Fix bug in tx pool during handling NewPooledTransactionHashes message, PR #3156
  • Improved receipt reorg logic, PR #3146
  • Block fetcher stabilizations, PR #3240

Other Changes

  • Fix RPC debug inconsistencies, PR #3125
  • Better typing/refactoring for devp2p ETH method binding, PR #3164
  • Replace superagent with direct RPC calls in RPC tests, PR #3173
  • testdouble to vi refactoring, PR #3182
  • Fetcher Small Bugfixes and Log Improvements, PR #3024

@ethereumjs/block v5.1.1

08 Feb 17:20
ff43fc1
Compare
Choose a tag to compare
  • Hotfix release adding a missing debug dependency to the @ethereumjs/trie package (dependency), PR #3271

@ethereumjs/block v5.1.0

08 Feb 16:20
b258fd9
Compare
Choose a tag to compare

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.

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.

Other Changes

  • Block.validateData() now throws if unsigned txs are added, PR #3240
  • New verifyTxs flag for Block.verifyData() allowing to skip tx verification for certain use cases, PR #3240
  • Experimental Verkle block support, PR #3139

@ethereumjs/wallet v2.0.1

02 Nov 09:03
c6d8b39
Compare
Choose a tag to compare
  • Add fromMnemonic() static constructor to BIP32 HD wallet, PR #192

@ethereumjs/vm v7.1.0

02 Nov 09:20
c6d8b39
Compare
Choose a tag to compare

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

@ethereumjs/util v9.0.1

02 Nov 08:39
c6d8b39
Compare
Choose a tag to compare

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 peer dependency for kzg module to use the official trusted setup for mainnet, PR #3107

Other Changes

  • Performance: New reoccurringly used BigInt constants (BIGINT_0, BIGINT_32, BIGINT_2EXP96,...) in the bytes module for reusage along performance optimizations, PR #3050
  • Performance: bytesToBigInt() performance optimization for 1-byte bytes, PR #3054
  • Fix a bug in fromUtf8(), PR #3112

@ethereumjs/tx v5.1.0

02 Nov 08:49
c6d8b39
Compare
Choose a tag to compare

More Type-Aligned Library Structure

This release gently introduces a backwards-compatible new/adopted library structure which is more aligned with the idea of independent tx types, bundling various functionalities together in a way that is not necessarily hierarchical, see PR #2993 and #3010.

Reused functionality (e.g. calculating the upfront-cost (getUpfrontCost()) of an EIP-1559-compatible tx - is internally bundled in capability files (e.g. capabilities/eip1559.ts), which provide static call access to the respective methods.

These methods are then called and the functionality exposed by the respective methods in the tx classes, see the following example code for an FeeMarketEIP1559Transaction:

getUpfrontCost(baseFee: bigint = BigInt(0)): bigint {
    return EIP1559.getUpfrontCost(this, baseFee)
  }

This makes creating additional or custom tx types and reusing of existing functionality substantially easier and makes the library substantially more robust by largely consolidating previously redundant code parts.

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 peer dependency for kzg module to use the official trusted setup for mainnet, PR #3107

Other Changes

  • Performance: cache tx sender to avoid redundant and costly ecrecover calls, PR #2985
  • Add new method getDataFee() to BlobEIP4844Transaction, PR #2955

@ethereumjs/trie v6.0.1

02 Nov 08:54
c6d8b39
Compare
Choose a tag to compare

Native Support for Uint8Array Values in DBs

The trie library now allows to store values being passed as native Uint8Array values instead of strings, see PR #3067.

This leads to a significant performance increase when dealing with larger state DBs and it is recommended to activate for new DBs by using the new valueEncoding option.

Attention!: Switching value encoding by using this new option is not compatible with existing databases.

Debug Logging

The trie library now allows for using debug logging with the DEBUG=ethjs,trie:* flag on the command line as already being implemented in other EthereumJS libraries, see PR #3019.

See Debugging README section for usage instructions. This comes in pretty handy if in-depth trie analysis with step-by-step following of path reads is needed.

Bugfixes

  • Fix empty-root check, PR #3001

Other Changes

  • New parameter skipKeyTransform (default: false) for Trie put(), del() and batch() method to allow to pass in already hashed keys, PR #2950
  • New keyPrefix option tries to store node keys with a static prefix (used upstream in the statemanager package to speed to storage trie reads), PR #3023
  • Peformance: findPath() optimizations, PR #3066
  • Make null available as type option for put() method value, PR #3020
  • Allow partial trie options for shallowCopy() (e.g. for a more flexible cache configuration for the trie copy), PR #3063
  • Use lock class from @ethereumjs/util, PR #3109
  • Improve util types and handling, PR #2951

@ethereumjs/statemanager v2.1.0

02 Nov 09:05
c6d8b39
Compare
Choose a tag to compare

New Diff-Based Code Cache

This release introduces a new code cache implementation, see PR #3022 and #3080. The new cache complements the expanded account and storage caches and now also tracks stored/deployed-code-changes along commits and reverts and so only keeps code in the cache which made it to the final state change.

The new cache is substantially more robust towards various type of revert-based attacks and grows a more-used cache over time, since never-applied values are consecutively sorted out.

Peformance Option to store Storage Keys with Prefix

This release introduces a new option prefixStorageTrieKeys which triggers the underlying trie to store storage key values with a prefix based on the account address, see PR #3023. This significantly increases performance for consecutive storage accesses for the same account on especially larger tries, since trie node accesses get noticeably faster when performed by the underlying key-value store since values are stored close to each other.

While this option is deactivated by default it is recommended for most use cases for it to be activated. Note that this option is not backwards-compatible with existing databases and therefore can't be used if access to existing DBs needs to be guaranteed.

Bugfixes

  • Fix for dumpStorage() for EthersStateManager, PR #3009

Other Changes

  • Allow for users to decide if to either downlevel (so: adopt them for a short-lived scenario) caches or not on shallowCopy() by adding a new downlevelCaches parameter (default: true), PR #3063
  • Return zero values for getProof() as 0x0, PR #3038
  • Deactivate storage/account caches for cache size 0, PR #3012