Releases: ethereumjs/ethereumjs-monorepo
@ethereumjs/common v5.0.0-alpha.1
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 #3502):
Common.custom()->createCustomCommon()Common.fromGethGenesis()->createCommonFromGethGenesis()
Refactoring
The inner workings and mechanisms of Common have been substantially refactored with the goal of simplifying both usage and underlying data structures as well as making Common more lightweight and performant to put less of a burden on other integrating libraries.
Direct Chain Passing
The Common constructor has been simplified and instead of passing in a chain enum value like Chain.Mainnet the respective chain configuration is passed in directly, see PR #3545. With this the Common initialization changes as follows:
// 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 })This allows to tree-shake out other chain configurations and simplifies custom chain usage.
No more Topics
Parameter topics like gasConfig or gasPrices have been removed leading to non-sub-structured parameter files, see PR #3532. Parameter access changes as follows:
common.param('gasPrices', 'ecAddGas') // old
common.param('ecAddGas') // newNo more default Parameter Sets
Parameters have been removed from Common - see PR #3537 - and moved over to params.ts files (exposed as e.g. paramsBlock) within the parameter-using libraries. The removes e.g. the tx library from the burden of carrying the somewhat large EVM parameter set around without the need for using it.
The libraries internally call a new Common method updateParams() and parameter sets accumulate as needed for shared Common instances.
Removal of TTD Logic (live-Merge Transition Support)
Total terminal difficulty (TTD) logic related to fork switching has been removed from the libraries, see PRs #3518 and #3556. This means that a Merge-type live hardfork transition solely triggered by TTD is not supported anymore. It is still possible though to replay and deal with both pre- and post Merge HF blocks.
For this library this means:
ttdin chain configurations (e.g.Mainnet) has been removed- Passing
tdingetHardforkBy(),setHardforkBy()andparamByBlock()has been removed - The
hardforkTTD()method has been removed - The
mergeForkIdPostMergeoption increateCommonFromGethGenesis()has been removed
Other Breaking Changes
- New default hardfork:
Shanghai->Cancun, see PR #3566 - Move HF/EIP param description string from being an object field to a comment, same for
comment,urlandstatusfrom the EIP/hardfork configuration, PRs #3500 and #3512 - Remove HF names from Params dict, PR #3517
- Remove
networkIdproperty from chain files (usechainIdinstead), PR #3513 - No more
BigIntfor chainID in chain config (use string), PR #3545 - The
customChainsconstructor option has been removed, PR #3545 - More straightforward
createCustomCommon()API (e.g.createCustomCommon({chainId: 123}, Mainnet)), PR #3545 - Renaming all camel-case
Rpc->RPCandJson->JSONnames, PR #3638
Other Changes
@ethereumjs/blockchain v8.0.0-alpha.1
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 #3491):
Blockchain.create()->createBlockchainBlockchain.fromBlocksData()->createBlockchainFromBlocksData()
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 })No Consensus Validation by Default
Along the transition to Proof-of-Stake, Ethereum consensus validation has moved to the consensus layer. Therefore the consensus integration of this library has been reworked (see PR #3504) and there is now no consensus validation/integration by default anymore (reflected by the validateConsensus flag now being set to false by default). This allows for substantial tree shaking gains by eliminating the need for by-default bundle all consensus code as well as external dependencies like the @ethereumjs/ethash library.
It is still easy to set up a Clique or Ethash blockchain by using the new consensusDict option and pass in an instantiated consensus instance, see the respective option documentation or the related example in the blockchain examples folder.
Removal of TTD Logic (live-Merge Transition Support)
Total terminal difficulty (TTD) logic related to fork switching has been removed from the libraries, see PRs #3518 and #3556. This means that a Merge-type live hardfork transition solely triggered by TTD is not supported anymore. It is still possible though to replay and deal with both pre- and post Merge HF blocks.
For the Blockchain library this means that it is not supported to operate on a PoW/PoS hybrid blockchain where the transition from PoW -> PoS happens solely by TTD.
Other Changes
@ethereumjs/block v6.0.0-alpha.1
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 PRs #3489, #3549, #3550, #3558 and #3586).
Block class:
Block.fromBlockData()->createBlock()Block.fromRLPSerializedBlock()->createBlockFromRLP()Block.fromValuesArray()->createBlockFromValuesArray()Block.fromRPC()->createBlockFromRPC()Block.fromJSONRPCProvider()->createBlockFromJSONRPCProvider()Block.fromExecutionPayload()->createBlockFromExecutionPayload()Block.fromBeaconPayloadJSON()->createBlockFromBeaconPayloadJSON()
Header class:
Header.fromHeaderData()->createBlockHeader()Header.fromRLPSerializedHeader()->createBlockHeaderFromRLP()Header.fromValuesArray()->createBlockHeaderFromValuesArray()Header.fromRPC()->createBlockHeaderFromRPC()
Also renamed in similar way: Block trie root methods (e.g. Block.genWithdrawalsTrieRoot() -> genWithdrawalsTrieRoot())
Own Block Parameter Set
HF-sensitive parameters like targetBlobGasPerBlock 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. paramsBlock) 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 })Clique/Ethash Logic Extraction
Since downgraded in importance and otherwise bloating the core Block class too much, most clique and ethash consensus related functionality has been taken out of the core class implementation and moved to standalone methods, see PR #3571.
Both clique and ethash blocks can still be created though and used within the wider EthereumJS stack. For clique, the cliqueSigner option has been removed. Instead there is a dedicated static constructor/standalone method to create a clique block:
let block = createSealedCliqueBlock({
/* ... */
})Most clique methods are now invoked in a standalone-way, e.g.:
header.cliqueEpochTransitionSigners(), // old
cliqueEpochTransitionSigners(header) // newJavaScript 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,
},
})Removal of TTD Logic (live-Merge Transition Support)
Total terminal difficulty (TTD) logic related to fork switching has been removed from the libraries, see PRs #3518 and #3556. This means that a Merge-type live hardfork transition solely triggered by TTD is not supported anymore. It is still possible though to replay and deal with both pre- and post Merge HF blocks.
For this library this means:
- The
setHardforkconstructor option is simplified to only accept abooleanand noBigIntLikefor an eventual TD value anymore
Other Breaking Changes
- New default hardfork:
Shanghai->Cancun, see PR #3566 - The
normalizeTxParams()helper method moved over to the tx library, PR #3588 - Renaming all camel-case
Rpc->RPCandJson->JSONnames, PR #3638
Other Changes
@ethereumjs/vm v8.1.1
@ethereumjs/evm v3.1.1
@ethereumjs/wallet v2.0.4
Maintenance release with downstream dependency updates, see PR #3527
@ethereumjs/[email protected]
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.
EIP-2935 Serve Historical Block Hashes from State (Prague)
Starting with this release the VM supports EIP-2935 which stores the latest 256 block hashes in the storage of a system contract, see PR #3475 as the major integrational PR (while work on this has already been done in previous PRs).
This EIP will be activated along the Prague hardfork. Note that this EIP has no effect on the resolution of the BLOCKHASH opcode, which will be a separate activation taking place by the integration of EIP-7709 in the following Osaka hardfork.
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
- Fixes for Kaustinen4 support, PR #3269
- Kaustinen5 related fixes, PR #3343
- Kaustinen6 adjustments,
verkle-cryptography-wasmmigration, PRs #3355 and #3356 - Missing beaconroot account verkle fix, PR #3421
- Remove the hacks to prevent account cleanups of system contracts, PR #3418
- Updates EIP-2935 tests with the new proposed bytecode and corresponding config, PR #3438
- Fix EIP-2935 address conversion issues, PR #3447
- Remove backfill of block hashes on EIP-2935 activation, PR #3478
Other Features
- Add
evmOptsto the VM opts to allow for options chaining to the underlying EVM, PR #3481 - 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
- Small clean-up to
VM._emit(), PR #3396 - Update
mcl-wasmDependency (Esbuild Issue), PR #3461
Bugfixes
@ethereumjs/verkle v0.1.0
This is the first (still experimental) Verkle library release with some basic put() and get() functionality working! 🎉 Still highly moving and evolving parts, but early experiments and feedback welcome!
- Kaustinen6 adjustments,
verkle-cryptography-wasmmigration, PRs #3355 and #3356 - Move tree key computation to verkle and simplify, PR #3420
- Rename code keccak, PR #3426
- Add tests for verkle bytes helper, PR #3441
- Verkle decoupling, PR #3462
- Rename verkle utils and refactor, PR #3468
- Optimize storage of default values in VerkleNode, PR #3476
- Build out trie processing, PR #3430
- Implement
trie.put(), PR #3473 - Add
trie.del(), PR #3486
@ethereumjs/util v9.1.0
Support for Partial Accounts
For Verkle or other contexts it can be useful to create partial accounts not containing all the account parameters. This is now supported starting with this release, see PR #3269:
import { Account } from '@ethereumjs/util'
const account = Account.fromPartialAccountData({
nonce: '0x02',
balance: '0x0384',
})
console.log(`Partial account with nonce=${account.nonce} and balance=${account.balance} created`)New requests Module
This release introduces a new requests module (see PRs #3372, #3393, #3398 and #3477) with various type and an abstract base class for EIP-7685 general purpose execution layer requests to the CL (Prague hardfork) as well as concrete implementations for the currently supported request types:
- EIP-6110:
DepositRequest(Prague Hardfork) - EIP-7002:
WithdrawawlRequest(Prague Hardfork) - EIP-7251:
ConsolidationRequest(Prague Hardfork)
These request types are mainly used within the @ethereumjs/block library where applied usage instructions are provided in the README.
Verkle Updates
- Update
kzg-wasmto0.4.0, PR #3358 - Shift Verkle to
osakahardfork, PR #3371 - New
verklemodule with utility methods and interfaces, PR #3462 - Rename verkle utils and refactor, PR #3468
Other Features
- 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
- Adjust
Account.isContract()(in Verkle context work), PR #3343 - Rename deposit receipt to deposit request, PR #3408
- Adjust
Account.isEmpty()to also work for partial accounts, PR #3405 - Enhances typing of CL requests, PR #3398
- Rename withdrawal request's
validatorPublicKeytovalidatorPubkey, PR #3474
@ethereumjs/tx v5.4.0
EOA Code Transaction (EIP-7702) (outdated)
This release introduces support for a non-final version of EIP-7702 EOA code transactions, see PR #3470. This tx type allows to run code in the context of an EOA and therefore extend the functionality which can be "reached" from respectively integrated into the scope of an otherwise limited EOA account.
The following is a simple example how to use an EOACodeEIP7702Transaction with one autorization list item:
// ./examples/EOACodeTx.ts
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { EOACodeEIP7702Transaction } from '@ethereumjs/tx'
import type { PrefixedHexString } from '@ethereumjs/util'
const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Cancun, eips: [7702] })
const tx = EOACodeEIP7702Transaction.fromTxData(
{
authorizationList: [
{
chainId: '0x1',
address: `0x${'20'.repeat(20)}`,
nonce: ['0x1'],
yParity: '0x1',
r: ones32,
s: ones32,
},
],
},
{ common }
)
console.log(
`EIP-7702 EOA code tx created with ${tx.authorizationList.length} authorization list item(s).`
)Note: Things move fast with EIP-7702 and the released implementation is based on this commit and therefore already outdated. An up-to-date version will be released along our breaking release round planned for early September 2024.
Verkle Updates
Other Features
- Extend
BlobEIP4844Transaction.networkWrapperToJson()to also include the 4844 fields, PR #3365 - 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)
Bugfixes
- Fix bug in generic error message regarding chain ID reporting, PR #3386