Releases: ethereumjs/ethereumjs-monorepo
@ethereumjs/common v2.0.0-rc.1
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta and RC Releases feedback issue #923 or our Discord channel.
This is the first release candidate towards a final library release, see beta.2 and especially beta.1 release notes for an overview on the full changes since the last publicly released version.
No changes since beta.2 release.
@ethereumjs/blockchain v5.0.0-rc.1
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta and RC Releases feedback issue #923 or our Discord channel.
This is the first release candidate towards a final library release, see beta.2 and especially beta.1 release notes for an overview on the full changes since the last publicly released version.
- Exposed private
Blockchain._getTd()total difficulty function asBlockchain.getTotalDifficulty(), PR #956
@ethereumjs/block v3.0.0-rc.1
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta and RC Releases feedback issue #923 or our Discord channel.
This is the first release candidate towards a final library release, see beta.2 and especially beta.1 release notes for an overview on the full changes since the last publicly released version.
- Additional consistency and validation checks in
Block.validateUncles()for included uncle headers, PR #935
@ethereumjs/vm v5.0.0-beta.2
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta Releases feedback issue #923 or our Discord channel.
This is the second beta release towards a final library release, see beta.1 release notes for an overview on the full changes since the last publicly released version.
@ethereumjs/tx v3.0.0-beta.2
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta Releases feedback issue #923 or our Discord channel.
This is the second beta release towards a final library release, see beta.1 release notes for an overview on the full changes since the last publicly released version.
- Added
freezeoption to allow for transaction freeze deactivation (e.g. to allow for subclassing tx and adding additional parameters), see PR #941 - Breaking: Reworked constructor to take in data as a
TxDatatyped dictionary instead of single values, theTx.fromTxData()factory method becomes an alias for the constructor with this change, see PR #944
@ethereumjs/common v2.0.0-beta.2
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta Releases feedback issue #923 or our Discord channel.
This is the second beta release towards a final library release, see beta.1 release notes for an overview on the full changes since the last publicly released version.
- Added consensus information to chains, new functions
Common.consensusType()for consensus type access ("pow" or "poa") andCommon.consensusAlgorithm()to get the associated algorithm or protocol (e.g. "ethash" PoW algorithm or "clique" PoA protocol), see PR #937
@ethereumjs/blockchain v5.0.0-beta.2
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta Releases feedback issue #923 or our Discord channel.
This is the second beta release towards a final library release, see beta.1 release notes for an overview on the full changes since the last publicly released version.
This release introduces new breaking changes, so please carefully read the additional release note sections!
Safe Static Constructor
The library now has an additional safe static constructor Blockchain.create() which awaits the init method and throws if the init method throws:
const common = new Common({ chain: 'ropsten' })
const blockchain = await Blockchain.create({ common })This is the new recommended way to instantiate a Blockchain object, see PR #930.
Refactored Genesis Block Handling Mechanism
Genesis handling has been reworked to now be safer and reduce the risk of wiping a blockchain by setting a new genesis, see PR #930.
Breaking: The dedicated setGenesisBlock() methods and the optional isGenesis option on Blockchain.putBlock() have been removed. Instead the genesis block is created on initialization either from the Common library instance passed or a custom genesis block passed along with the genesisBlock option. If a custom genesis block is used, this custom block now always has to be passed along on Blockchain initialization, also when operating on an already existing DB.
Changes and Refactoring
- Refactored
DBManagerwith the introduction of an abstract DB operation handling mechanism, if you have modifiedDBManagerin your code this will be a potentially breaking change for you, PR #927 - Renaming of internal variables like
Blockchain._headBlock, if you are using these variables in your code this will be a potentially breaking change for you, PR #930 - Made internal
_methods like_saveHeads()private, if you are using these functions in your code this will be a potentially breaking change for you, PR #930 - Improved code documentation, PR #930
- Fixed potential blockchain DB concurrency issues along PR #930
Testing and CI
- Dedicated
blockchainreorg test setup and executable test, PR #926 - Breaking:
validatePowoption has been renamed tovalidateConsensusto prepare for a future integration of non-PoW (PoA) consensus mechanisms,validateConsensusas well asvalidateBlocksoptions now throw when set totruefor validation on a non-PoW chain (determined byCommon, e.g. 'goerli'), see PR #937
@ethereumjs/block v3.0.0-beta.2
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta Releases feedback issue #923 or our Discord channel.
This is the second beta release towards a final library release, see beta.1 release notes for an overview on the full changes since the last publicly released version.
- Added
freezeoption to allow for block freeze deactivation (e.g. to allow for subclassing block and adding additional parameters), see PR #941 - Breaking: Difficulty-depending methods
canonicalDifficulty()andvalidateDifficulty()in block and header now throw on non-PoW chains, see PR #937 - Breaking: Non-blockchain dependent validation checks have been extracted from
validate()to its ownBlock.validateData()function. For thevalidate()method in block and headerblockchainis now a mandatory parameter, see PR #942 - Fixed bug where block options have not been passed on to the main constructor from the static factory methods, see PR #941
@ethereumjs/vm v5.0.0-beta.1
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta.1 Releases feedback issue #923 or our Discord channel.
New Package Name
Attention! This new version is part of a series of EthereumJS releases all moving to a new scoped package name format. In this case the library is renamed as follows:
ethereumjs-vm->@ethereumjs/vm
Please update your library references accordingly or install with:
npm i @ethereumjs/vmSupport for all current Hardforks / HF API Changes
This is the first release of the VM which supports all hardforks currently applied on mainnet starting with the support of the Frontier HF rules all along up to MuirGlacier. 🎉
The following HFs have been added:
- Spurious Dragon, PR #791
- Tangerine Whistle, PR #807
- DAO, PR #843
- Homestead, PR #815
- Frontier, PR #828
A VM with the specific HF rules (on the chain provided) can be instantiated by passing in a Common instance:
import VM from '@ethereumjs/vm'
import Common from '@ethereumjs/common'
const common = new Common({ chain: 'mainnet', hardfork: 'spuriousDragon' })
const vm = new VM({ common })Breaking: The default HF from the VM has been updated from petersburg to instanbul. The HF setting is now automatically taken from the HF set for Common.DEAULT_HARDFORK, see PR #906.
Breaking: Please note that the options to directly pass in chain and hardfork strings have been removed to simplify the API. Providing a Common instance is now the only way to change the chain setup, see PR #863
Berlin HF Support / HF-independent EIPs
This releases adds support for subroutines (EIP-2315) which gets activated under the berlin HF setting which can now be used as a hardfork instantiation option, see PR #754.
Attention! Berlin HF support is still considered experimental and implementations can change on non-major VM releases!
Support for BLS12-381 precompiles (EIP-2537) is added as an independent EIP implementation - see PR #785 - since there is still an ongoing discussion on taking this EIP in for Berlin or using a more generalized approach on curve computation with the Ethereum EVM (evm384 by the eWASM team).
Another new EIP added is the EIP-2929 with gas cost increases for state access opcodes, see PR #889.
These integrations come along with an API addition to the VM to support the activation of specific EIPs, see PR #856, PR #869 and PR #872.
This API can be used as follows:
import VM from '@ethereumjs/vm'
const vm = new VM({ eips: [2537] })API Change: New Major Library Versions
The following EthereumJS libraries which are used within the VM internally and can be passed in on instantiation have been updated to new major versions.
merkle-patricia-treev3(VM optionstate) ->merkle-patricia-treev4, PR #787ethereumjs-blockchainv4->@ethereumjs/blockchainv5, PR #833ethereumjs-commonv1->@ethereumjs/commonv2
Breaking: If you pass in instances of these libraries to the VM please make sure to update these library versions as stated. Please also take a note on the package name changes!
All these libraries are now written in TypeScript and use promises instead of callbacks for accessing their APIs.
New StateManager Interface / StateManager API Changes
There is now a new TypeScript interface for the StateManager, see PR #763. If you are using a custom StateManager you can use this interface to get better assurance that you are using a StateManager which conforms with the current StateManager API and will run in the VM without problems.
The integration of this new interface is highly encouraged since this release also comes with StateManager API changes. Usage of the old ethereumjs-account package (this package will be retired) has been replaced by the new Account class
from the ethereumjs-util package. This affects all Account related StateManager methods, see PR #911.
The Util package also introduces a new Address class. This class replaces all current Buffer inputs on StateManager methods representing an address.
Dual ES5 and ES2017 Builds
We significantly updated our internal tool and CI setup along the work on PR #913 with an update to ESLint from TSLint for code linting and formatting and the introduction of a new build setup.
Packages now target ES2017 for Node.js builds (the main entrypoint from package.json) and introduce a separate ES5 build distributed along using the browser directive as an entrypoint, see PR #921. This will result in performance benefits for Node.js consumers, see here for a releated discussion.
Other Changes
Changes and Refactoring
- Group opcodes based upon hardfork, PR #798
- Split opcodes logic into codes, fns, and utils files, PR #896
- Group precompiles based upon hardfork, PR #783
- Breaking: the
stepevent now emits anethereumjs-utilAccount object instead of an ethereumjs-account (package retired) object - Breaking:
NewContractEventnow emits anaddressof typeAddress(seeethereumjs-util) instead of aBuffer, PR #919 - Breaking:
EVMResultnow returns acreatedAddressof typeAddress(seeethereumjs-util) instead of aBuffer, PR #919 - Breaking:
RunTxResultnow returns acreatedAddressof typeAddress(seeethereumjs-util) instead of aBuffer, PR #919 - Breaking:
RunCallOptsnow expectsorigin,callerandtoinputs to be of typeAddress(seeethereumjs-util) instead of aBuffer, PR #919 - Breaking:
RunCodeOptsnow expectsorigin,callerand
addressinputs to be of typeAddress(seeethereumjs-util) instead of aBuffer, PR #919 - Make
memory.tsuse Buffers instead of Arrays, PR #850 - Use
MapforOpcodeListandopcodehandlers, PR #852 - Compare buffers directly, PR #851
- Moved gas base fees from VM to Common, PR #806
- Return precompiles on
getPrecompile()based on hardfork,
PR #783 - Removed
asyncdependency, PR #779 - Updated
ethereumjs-utilto v7, PR #748
CI and Test Improvements
- New benchmarking tool for the VM, CI integration on GitHub actions, PR #794 and PR #830
- Various updates, fixes and refactoring work on the test runner, PR #752 and PR #849
- Integrated
ethereumjs-testingcode logic into VM for more flexible future test load optimizations, PR #808 - Transition VM tests to TypeScript, PR #881 and PR #882
Bug Fixes
@ethereumjs/tx v3.0.0-beta.1
ATTENTION: This is a pre-release and only meant to be used for testing purposes.
Do not use in production!
Feedback is extremely welcome, please use the beta.1 Releases feedback issue #923 or our Discord channel.
New Package Name
Attention! This new version is part of a series of EthereumJS releases all moving to a new scoped package name format. In this case the library is renamed as follows:
ethereumjs-tx->@ethereumjs/tx
Please update your library references accordingly or install with:
npm i @ethereumjs/txMajor Refactoring - Breaking Changes
This release is a major refactoring of the transaction library to simplify and strengthen its code base. Refactoring work has been done along PR #812 and PR #887.
New Constructor Params
The constructor used to accept a varying amount of options but now has the following shape:
Transaction(
nonce: BN,
gasPrice: BN,
gasLimit: BN,
to: Address | undefined,
value: BN,
data: Buffer,
v?: BN,
r?: BN,
s?: BN,
opts?: TxOptions
)Initializing from other data types is assisted with new static factory helpers fromTxData, fromRlpSerializedTx, and fromValuesArray.
Examples:
// Initializing from serialized data
const s1 = tx1.serialize().toString('hex')
const tx = Transaction.fromRlpSerializedTx(toBuffer('0x' + s1))
// Initializing with object
const txData = {
gasPrice: 1000,
gasLimit: 10000000,
value: 42,
}
const tx = Transaction.fromTxData(txData)
// Initializing from array of 0x-prefixed strings.
// First, convert to array of Buffers.
const arr = txFixture.raw.map(toBuffer)
const tx = Transaction.fromValuesArray(arr)Learn more about the full API in the docs.
Immutability
The returned transaction is now frozen and immutable. To work with a maliable transaction, copy it with const fakeTx = Object.create(tx).
from
The tx.from alias was removed, please use const from = tx.getSenderAddress().
Message to sign
Getting a message to sign has been changed from calling tx.hash(false) to tx.getMessageToSign().
Fake Transaction
The FakeTransaction class was removed since its functionality can now be implemented with less code. To create a fake tansaction for use in e.g. VM.runTx() overwrite getSenderAddress with your own Address. See a full example in the section in the README.
New Default Hardfork
Breaking: The default HF on the library has been updated from petersburg to instanbul, see PR #906.
The HF setting is now automatically taken from the HF set for Common.DEAULT_HARDFORK, see PR #863.
Dual ES5 and ES2017 Builds
We significantly updated our internal tool and CI setup along the work on PR #913 with an update to ESLint from TSLint for code linting and formatting and the introduction of a new build setup.
Packages now target ES2017 for Node.js builds (the main entrypoint from package.json) and introduce a separate ES5 build distributed along using the browser directive as an entrypoint, see PR #921. This will result in performance benefits for Node.js consumers, see here for a releated discussion.
Other Changes
Changes and Refactoring