All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog (modification: no type change headlines) and this project adheres to Semantic Versioning.
4.1.0 - 2019-09-12
This is the first feature-complete Istanbul release, containing implementations
for all 6 EIPs, see the HF meta EIP EIP-1679
for an overview. Beside this release contains further unrelated features as
well as bug fixes.
Note that Istanbul support is still labeled as beta. All implementations
have only basic test coverage since the official Ethereum consensus tests are
not yet merged. There might be also last minute changes to EIPs during the
testing period.
Istanbul Summary
See the VM Istanbul hardfork meta issue
#501 for a summary
on all the changes.
Added EIPs:
- EIP-152: Blake 2b
Fprecompile, PR #584 - EIP-1108: Reduce
alt_bn128precompile gas costs,
PR #540 (already released inv4.0.0) - EIP-1344: Add ChainID Opcode, PR #572
- EIP-1884: Trie-size-dependent Opcode Repricing, PR #581
- EIP-2200: Rebalance net-metered SSTORE gas costs, PR #590
Other Features
- Two new event types
beforeMessageandafterMessage, emitting aMessagebefore and anEVMResultafter running aMessage, see also the updated section in theREADMEon this, PR #577
Bug Fixes
- Transaction error strings should not contain multiple consecutive whitespace characters, this has been fixed, PR #578
- Fixed
vm.stateManager.generateCanonicalGenesis()to produce a correct genesis block state root (in particular for theGoerlitestnet), PR #589
Refactoring / Docs
- Preparation for separate lists of opcodes for the different HFs, PR #582, see also follow-up PR #592 making this list a property of the VM instance
- Clarification in the docs for the behavior of the
activatePrecompilesVM option, PR #595
4.0.0 - 2019-08-06
First TypeScript based VM release, other highlights:
- New Call and Code Loop Structure / EVM Encapsulation
- EEI for Environment Communication
- Istanbul Process Start
- Promise-based API
See v4.0.0-beta.1 release for full release notes.
Changes since last beta
- Simplification of execution results, PR #551
- Fix error propagation in
Cache.flush()method fromStateManager, PR #562 StateManagerstorage key length validation (now throws on addresses not having a 32-byte length), PR #565
4.0.0-beta.1 - 2019-06-19
Since changes in this release are pretty deep reaching and broadly distributed,
we will first drop out one or several beta releases until we are confident on
both external API as well as inner structural changes. See
v4 branch for some
major entry point into the work on the release.
It is highly recommended that you do some testing of your library against this
and following beta versions and give us some feedback!
These will be the main release notes for the v4 feature updates, subsequent
beta releases and the final release will just publish the delta changes and
point here for reference.
Breaking changes in the release notes are preeceeded with [BREAKING], do a
search for an overview.
The outstanding work of @s1na has to be mentioned here. He has done the very large portion of the coding and without him this release wouldn't have been possible. Thanks Sina! 🙂
So what's new?
This is the first TypeScript release of the VM (yay! 🎉).
TypeScript handles ES6 transpilation
a bit differently (at the
end: cleaner) than babel so require syntax of the library slightly changes to:
const VM = require('ethereumjs-vm').defaultThe library now also comes with type declaration files distributed along with the package published.
- Preparation, migration of
Bloom,StackandMemory, PR #495 StateManagermigration, PR #496- Migration of precompiles, opcode list,
EEI,Message,TxContexttoTypeScript, PR #497 - Migration of
EVM(old:Interpreter) and exceptions, PR #504 - Migration of
Interpreter(old:Loop), PR #505 - Migration of
opFns(opcode implementations), PR #506 - Migration of the main
index.jsVMclass, PR #507 - Migration of
VM.runCode(), PR #508 - Migration of
VM.runCall(), PR #510 - Migration of
VM.runTx(), PR #511 - Migration of
VM.runBlock(), PR #512 - Migration of
VM.runBlockchain(), PR #517 TypeScriptfinalization PR, config switch, PR #518- Doc generation via
TypeDoc, PR #522
This release switches to a new class based and promisified structure for
working down VM calls and running through code loops, and encapsulates this
logic to be bound to the specific EVM (so the classical Ethereum Virtual Machine)
implementation in the
evm module,
opening the way for a future parallel eWASM additional implementation.
This new logic is mainly handled by the two new classes EVM (old: Interpreter)
and Interpreter (old: Loop),
see PR #483
for the initial work on this. The old VM.runCall() and VM.runCode()
methods are just kept as being wrappers and will likely be deprecated on future
releases once the inner API structure further stabilizes.
This new structure should make extending the VM by subclassing and
adopting functionality much easier, e.g. by changing opcode functionality or adding
custom onces by using an own Interpreter.getOpHandler() implementation. You are
highly encouraged to play around, see what you can do and give us feedback on
possibilities and limitations.
For interacting with the blockchain environment there has been introduced a
dedicated EEI (Ethereum Environment Interface) module closely resembling the
respective
EEI spec, see
PR #486 for the initial
work.
This makes handling of environmental data by the VM a lot cleaner and transparent and should as well allow for much easier extension and modification.
- Detached precompiles from the VM, PR #492
- Subdivided
runState, refactoredInterpreter(old:Loop), PR #498 - [BREAKING] Dropped
emitFreeLogsflag, to replace it is suggested to implement by inheritingInterpreter(old:Loop), PR #498 - Split
EVM.executeMessage()withEVM.executeCall()andEVM.executeCreate()forcallandcreatespecific logic (old names:Interpreter.[METHOD_NAME]()), PR #499 - Further simplification of
Interpreter/EVM(old:Loop/Interpreter) structure, PR #506 - [BREAKING] Dropped
VM.runJit()in favor of direct handling inEVM(old:Interpreter), officially not part of the external API but mentioning just in case, PR #515 - Removed
StorageReader, moved logic toStateManager, #534
With this release we start the Istanbul hardfork integration process and
have activated the istanbul hardfork option for the constructor.
This is meant to be used experimentation and reference implementations, we have made
a start with integrating draft EIP-1108
Istanbul candidate support reducing the gas costs for alt_bn128 precompiles,
see PR #539 for
implementation details.
Note that this is still very early in the process since no EIP in a final
state is actually accepted for being included into Istanbul on the time of
release. The v4 release series will be kept as an experimental series
during the process with breaking changes introduced along the way without too
much notice, so be careful and tighten the VM dependency if you want to give
your users the chance for some early experimentation with some specific
implementation state.
Once scope of Istanbul as well as associated EIPs are finalized a stable
Istanbul VM version will be released as a subsequent major release.
The main API with the v4 release switches from being callback based to
using promises,
see PR #546.
Here is an example for changed API call runTx.
Old callback-style invocation:
vm.runTx(
{
tx: tx,
},
function(err, result) {
if (err) {
// Handle errors appropriately
}
// Do something with the result
},
)Promisified usage:
try {
let result = await vm.runTx({ tx: tx })
// Do something with the result
} catch (err) {
// handle errors appropriately
}- Promisified internal usage of async opcode handlers, PR #491
- Promisified
runTxinternals, PR #493 - Promisified
runBlockinternals, restructure, reduced shared global state, PR #494
- Updated
ethereumjs-accountfrom2.xto3.x, part of PR #496
- Fixed error message in
runTx(), PR #523 - Changed default hardfork in
StateManagertopetersburg, PR #524 - Replaced
Object.assign()calls and fixed type errors, PR #529
- Significant blockchain test speed improvements, PR #536
3.0.0 - 2019-03-29
This release comes with a modernized ES6-class structured code base, some
significant local refactoring work regarding how Stack and Memory
are organized within the VM and it finalizes a first round of module structuring
now having separate folders for bloom, evm and state related code. The
release also removes some rarely used parts of the API (hookedVM, VM.deps).
All this is to a large extend preparatory work for a v4.0.0 release which will
follow in the next months with TypeScript support and more system-wide
refactoring work leading to a more modular and expandable VM and providing the
ground for future eWASM integration. If you are interested in the release
process and want to take part in the refactoring discussion see the associated
issue #455.
VM Refactoring/Breaking Changes
- New
Memoryclass for evm memory manipulation, PR #442 - Refactored
Stackmanipulation in evm, PR #460 - Dropped
createHookedVm(BREAKING), being made obsolete by the newStateManagerAPI, PR #451 - Dropped
VM.depsattribute (please require dependencies yourself if you used this), PR #478 - Removed
fakeBlockchainclass and associated tests, PR #466 - The
petersburghardfork rules are now run as default (before:byzantium), PR #485
Modularization
- Renamed
vmmodule toevm, moveprecompilestoevmmodule, PR #481 - Moved
stateManager,storageReaderandcachetostatemodule, #443 - Replaced static VM
logTablewith dynamic inline version inEXPopcode, #450
Code Modernization/ES6
- Converted
VMtoES6class, PR #478 - Migrated
stateManagerandstorageReadertoES6class syntax, PR #452
Bug Fixes
- Fixed a bug where
stateManager.setStateRoot()didn't clear the_storageTriescache, PR #445 - Fixed longer output than return length in
CALLopcode, PR #454 - Use
BN.toArrayLike()instead ofBN.toBuffer()(browser compatibility), PR #458 - Fixed tx value overflow 256 bits, PR #471
Maintenance/Optimization
- Use
BNreduction context inMODEXPprecompile, PR #463
Documentation
- Fixed API doc types for
Bloomfilter methods, PR #439
Testing
- New Karma browser testing for the API tests, PRs #461, #468
- Removed unused parts and tests within the test setup, PR #437
- Fixed a bug using
--jsontrace flag in the tests, PR #438 - Complete switch to Petersburg on tests, fix coverage, PR #448
- Added test for
StateManager.dumpStorage(), PR #462 - Fixed
ecmul_0-3_5616_28000_96(by test setup adoption), PR #473
2.6.0 - 2019-02-07
Petersburg Support
Support for the Petersburg (aka constantinopleFix) hardfork by integrating
Petersburg ready versions of associated libraries, see also
PR #433:
ethereumjs-common(chain and HF logic and helper functionality) v1.1.0ethereumjs-blockchainv3.4.0ethereumjs-blockv2.2.0
To instantiate the VM with Petersburg HF rules set the opts.hardfork
constructor parameter to petersburg. This will run the VM on the new
Petersburg rules having removed the support for
EIP 1283.
Goerli Readiness
The VM is now also ready to execute on blocks from the final version of the
Goerli cross-client testnet and can
therefore be instantiated with opts.chain set to goerli.
Bug Fixes
- Fixed mixed
sync/asyncfunctions incache, PR #422 - Fixed a bug in
setStaterootand caching by clearing thestateManagercache after setting the state root such that stale values are not returned, PR #420 - Fixed cache access on the hooked VM (deprecated), PR #434
Refactoring
Following changes might be relevant for you if you are hotfixing/monkey-patching on parts of the VM:
- Moved
bloomto its own directory, PR #429 - Moved
opcodes,opFnsandlogTabletolib/vm, PR #425 - Converted
BloomtoES6class, PR #428 - Converted
CachetoES6class, added unit tests, PR 427
2.5.1 - 2019-01-19
- Added
memoryWordCountto thestepevent object, PR #405
- Fixed a bug which caused an overwrite of the passed state trie (
opts.state) when instantiating the library with theopts.activatePrecompilesoption, PR #415 - Fixed error handling in
runCode(in caseloadContractfails), PR #408 - Fixed a bug in the
StateManager.generateGenesis()function, PR #400
- Upgraded
ethereumjs-blockchainandlevelfor test runs, PR #414 - Fixed issue when running code coverage on PRs from forks, PR #402
2.5.0 - 2018-11-21
This is the first release of the VM with full support for all Constantinople EIPs. It further comes along with huge improvements on consensus conformity and introduces the Beta version of a new StateManager API.
For running the VM with Constantinople hardfork rules, set the option in the VM constructor opts.hardfork to constantinople. Supported hardforks are byzantium and constantinople, default setting will stay on byzantium for now but this will change in a future release.
Changes related to Constantinople:
- EIP 1283
SSTORE, see PR #367 - EIP 1014
CREATE2, see PR #329 - EIP 1052
EXTCODEHASH, see PR #324 - Constantinople ready versions of ethereumjs-block and ethereumjs-blockchain dependencies (difficulty bomb delay), see PRs #371, #325
This release is making a huge leap forward regarding consensus conformity, and even if you are not interested in Constantinople support at all, you should upgrade just for this reason. Some context: we couldn't run blockchain tests for a long time on a steady basis due to performance constraints and when we re-triggered a test run after quite some time with PR #341 the result was a bit depressing with over 300 failing tests. Thanks to joined efforts from the community and core team members we could bring this down far quicker than expected and this is the first release for a long time which practically comes with complete consensus conformity - with just three recently added tests failing (see skipBroken list in tests/tester.js) and otherwise passing all blockchain tests and all state tests for both Constantinople and Byzantium rules. 🏆 🏆 🏆
Consensus Conformity related changes:
- Reset
selfdestructonREVERT, see PR #392 - Undo
Bloomfilter changes from PR #295, see PR #384 - Fixes broken
BLOCKHASHopcode, see PR #381 - Fix failing blockchain test
GasLimitHigherThan2p63m1, see PR #380 - Stop adding
accounttocachewhen checking if it is empty, see PR #375
The StateManager (lib/stateManager.js) - providing a high-level interface to account and contract data from the underlying state trie structure - has been completely reworked and there is now a close-to-being finalized API (currently marked as Beta) coming with its own documentation.
This comes along with larger refactoring work throughout more-or-less the whole code base and the StateManager now completely encapsulates the trie structure and the cache backend used, see issue #268 and associated PRs for reference. This will make it much easier in the future to bring along an own state manager serving special needs (optimized for memory and performance, run on mobile,...) by e.g. using a different trie implementation, cache or underlying storage or database backend.
We plan to completely separate the currently still integrated state manager into its own repository in one of the next releases, this will then be a breaking v3.0.0 release. Discussion around a finalized interface (we might e.g. drop all genesis-releated methods respectively methods implemented in the DefaultStateManager) is still ongoing and you are very much invited to jump in and articulate your needs, just take e.g. the issue mentioned above as an entry point.
Change related to the new StateManager interface:
StateManagerinterface simplification, see PR #388- Make
StateManagercache and trie private, see PR #385 - Remove vm accesses to
StateManagertrieandcache, see PR #376 - Remove explicit direct cache interactions, see PR #366
- Remove contract specific commit, see PR #335
- Fixed incorrect references to
triein tests, see PR #345 - Added
StateManagerAPI documentation, see PR #393
- New
emitFreeLogsoption, allowing any contract to emit an unlimited quantity of events without modifying the block gas limit (default:false) which can be used in debugging contexts, see PRs #378, #379
Beyond the reintegrated blockchain tests there is now a separate test suite to test the API of the library, see tests/api. This should largely reduce the risk of introducing new bugs on the API level on future changes, generally ease the development process by being able to develop against the specific tests and also allows using the tests as a reference for examples on how to use the API.
On the documentation side the API documentation has also been consolidated and there is now a unified and auto-generated API documentation (previously being manually edited (and too often forgotten) in README).
- Added API tests for
index.js,StateManager, see PR #364 - Added API Tests for
runJitandfakeBlockchain, see PR #331 - Added API tests for
runBlockchain, see PR #336 - Added
runBlockAPI tests, see PR #360 - Added
runTxAPI tests, see PR #352 - Added API Tests for the
Bloommodule, see PR #330 - New consistent auto-generated API documentation, see PR #377
- Blockchain tests now run by default on CI, see PR #374
- Switched from
istanbultonyc, see PR #334 - Usage of
sealEnginein blockchain tests, see PR #373 - New
tap-specoption to get a formatted test run result summary, see README, see PR #363 - Updates/fixes on the JSDoc comments, see PRs #362, #361
Some bug fix and maintenance updates:
Special thanks to:
- @mattdean-digicatapult for his indefatigable work on the new StateManager interface and for fixing a large portion of the failing blockchain tests
- @rmeissner for the work on Constantinople
- @vpulim for jumping in so quickly and doing a reliable
SSTOREimplementation within 4 days - @s1na for the new API test suite
Beyond this release contains contributions from the following people: @jwasinger, @Agusx1211, @HolgerD77, @danjm, @whymarrh, @seesemichaelj, @kn
Thank you all very much, and thanks @axic for keeping an ongoing eye on overall library quality!
2.4.0 - 2018-07-27
With the 2.4.x release series we now start to gradually add Constantinople features with the
bitwise shifting instructions from EIP 145
making the start being introduced in the v2.4.0 release.
Since both the scope of the Constantinople hardfork as well as the state of at least some of the EIPs
to be included are not yet finalized, this is only meant for EXPERIMENTAL purposes, e.g. for developer
tools to give users early access and make themself familiar with dedicated features.
Once scope and EIPs from Constantinople are final we will target a v2.5.0 release which will officially
introduce Constantinople support with all the changes bundled together.
Note that from this release on we also introduce new chain (default: mainnet) and hardfork
(default: byzantium) initialization parameters, which make use of our new ethereumjs-common library and in the future will allow
for parallel hardfork support from Byzantium onwards.
Since hardfork default might be changed or dropped in future releases, you might want to explicitly
set this to byzantium on your next update to avoid future unexpected behavior.
All the changes from this release:
FEATURES/FUNCTIONALITY
- Improved chain and fork support, see PR #304
- Support for the
Constantinoplebitwise shifiting instructionsSHL,SHRandSAR, see PR #251 - New
newContractevent which can be used to do interrupting tasks on contract/address creation, see PR #306 - Alignment of behavior of bloom filter hashing to go along with mainnet compatible clients BREAKING, see PR #295
UPDATES/TESTING
- Usage of the latest
rustbn.jsAPI, see PR #312 - Some cleanup in precompile error handling, see PR #318
- Some cleanup for
StateManager, see PR #266 - Renaming of
util.sha3usages toutil.keccak256and bumpethereumjs-utiltov5.2.0(you should do to if you useethereumjs-util) - Parallel testing of the
ByzantiumandConstantinoplestate tests, see PR #317 - For lower build times our CI configuration now runs solely on
CircleCIand support forTravishave been dropped, see PR #316
BUG FIXES
- Programmatic runtime errors in the VM execution context (within an opcode) are no longer absorbed and displayed as a VMError but explicitly thrown, allowing for easier discovery of implementation bugs, see PR #307
- Fix of the
Bloom.check()method not working properly, see PR #311 - Fix a bug when
REVERTis used within aCREATEcontext, see PR #297 - Fix a bug in
FakeBlockChainerror handing, see PR #320
2.3.5 - 2018-04-25
- Fixed
BYTEopcode return value bug, PR #293 - Clean up touched-accounts management in
StateManager, PR #287 - New
stateManager.copy()function, PR #276 - Updated Circle CI configuration to 2.0 format, PR #292
2.3.4 - 2018-04-06
- Support of external statemanager in VM constructor (experimental), PR #264
ES5distribution on npm for better toolchain compatibility, PR #281allowUnlimitedContractSizeVM option for debugging purposes, PR #282- Added
gasRefundto transaction results, PR #284 - Test coverage / coveralls support for the library, PR #270
- Properly calculate totalgas for large return values, PR #275
- Improve iterateVm check output after step hook, PR #279
2.3.3 - 2018-02-02
- Reworked memory expansion/access for opcodes, PR #174 (fixes consensus bugs on large numbers >= 53 bit for opcodes using memory location)
- Keep stack items as bn.js instances (arithmetic performance increases), PRs #159, #254 and #256
- More consistent VM error handling, PR #219
- Validate stack items after operations, PR #222
- Updated
ethereumjs-utildependency from4.5.0to5.1.x, PR #241 - Fixed child contract deletion bug, PR #246
- Fixed a bug associated with direct stack usage, PR #240
- Fix error on large return fees, PR #235
- Various bug fixes
2.3.2 - 2017-10-29
- Better handling of
rustbn.jsexceptions - Fake (default if non-provided) blockchain fixes
- Testing improvements (separate skip lists)
- Minor optimizations and bug fixes
2.3.1 - 2017-10-11
Byzantiumcompatible- New opcodes
REVERT,RETURNDATAandSTATICCALL - Precompiles for curve operations and bigint mod exp
- Transaction return data in receipts
- For detailed list of changes see PR #161
- For a
Spurious Dragon/EIP 150compatible version of this library install latest version of2.2.x
2.2.2 - 2017-09-19
- Fixed JS number issues and certain edge cases
- Fixed various smaller bugs and improved code consistency
- Some VM speedups
- Testing improvements
- Narrowed down dependencies for library not to break after Byzantium release
2.2.1 - 2017-08-04
- Fixed bug prevent the library to be used in the browser
2.2.0 - 2017-07-28
Spurious Dragon&EIP 150compatible- Detailed list of changes in pull requests #147 and #143
- Removed
enableHomesteadoption when creating a new VM object (pre-Homestead fork rules not supported any more)
2.1.0 - 2017-06-28
- Homestead compatible
- update state test runner for General State Tests