Skip to content

Commit f906e71

Browse files
authored
Merge pull request ethereumjs#394 from ethereumjs/new-release-v250
New release v2.5.0
2 parents 852bde7 + 1c268db commit f906e71

File tree

5 files changed

+109
-22
lines changed

5 files changed

+109
-22
lines changed

CHANGELOG.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,101 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
(modification: no type change headlines) and this project adheres to
66
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
9+
## [2.5.0] - 2018-11-21
10+
11+
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.
12+
13+
### Constantinople Support
14+
15+
For running the VM with ``Constantinople`` hardfork rules, set the [option](https://github.com/ethereumjs/ethereumjs-vm/blob/master/docs/index.md#vm) 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.
16+
17+
Changes related to Constantinople:
18+
19+
- EIP 1283 ``SSTORE``, see PR [#367](https://github.com/ethereumjs/ethereumjs-vm/pull/367)
20+
- EIP 1014 ``CREATE2``, see PR [#329](https://github.com/ethereumjs/ethereumjs-vm/pull/329)
21+
- EIP 1052 ``EXTCODEHASH``, see PR [#324](https://github.com/ethereumjs/ethereumjs-vm/pull/324)
22+
- Constantinople ready versions of [ethereumjs-block](https://github.com/ethereumjs/ethereumjs-block/releases/tag/v2.1.0) and [ethereumjs-blockchain](https://github.com/ethereumjs/ethereumjs-blockchain/releases/tag/v3.3.0) dependencies (difficulty bomb delay), see PRs [#371](https://github.com/ethereumjs/ethereumjs-vm/pull/371), [#325](https://github.com/ethereumjs/ethereumjs-vm/pull/325)
23+
24+
### Consensus Conformity
25+
26+
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](https://github.com/ethereumjs/ethereumjs-vm/pull/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. 🏆 🏆 🏆
27+
28+
Consensus Conformity related changes:
29+
30+
- Reset ``selfdestruct`` on ``REVERT``, see PR [#392](https://github.com/ethereumjs/ethereumjs-vm/pull/392)
31+
- Undo ``Bloom`` filter changes from PR [#295](https://github.com/ethereumjs/ethereumjs-vm/pull/295), see PR [#384](https://github.com/ethereumjs/ethereumjs-vm/pull/384)
32+
- Fixes broken ``BLOCKHASH`` opcode, see PR [#381](https://github.com/ethereumjs/ethereumjs-vm/pull/381)
33+
- Fix failing blockchain test ``GasLimitHigherThan2p63m1``, see PR [#380](https://github.com/ethereumjs/ethereumjs-vm/pull/380)
34+
- Stop adding ``account`` to ``cache`` when checking if it is empty, see PR [#375](https://github.com/ethereumjs/ethereumjs-vm/pull/375)
35+
36+
### State Manager Interface
37+
38+
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](https://github.com/ethereumjs/ethereumjs-vm/blob/master/docs/stateManager.md).
39+
40+
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](https://github.com/ethereumjs/ethereumjs-vm/issues/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.
41+
42+
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.
43+
44+
Change related to the new ``StateManager`` interface:
45+
46+
47+
- ``StateManager`` interface simplification, see PR [#388](https://github.com/ethereumjs/ethereumjs-vm/pull/388)
48+
- Make ``StateManager`` cache and trie private, see PR [#385](https://github.com/ethereumjs/ethereumjs-vm/pull/385)
49+
- Remove vm accesses to ``StateManager`` ``trie`` and ``cache``, see PR [#376](https://github.com/ethereumjs/ethereumjs-vm/pull/376)
50+
- Remove explicit direct cache interactions, see PR [#366](https://github.com/ethereumjs/ethereumjs-vm/pull/366)
51+
- Remove contract specific commit, see PR [#335](https://github.com/ethereumjs/ethereumjs-vm/pull/335)
52+
- Fixed incorrect references to ``trie`` in tests, see PR [#345](https://github.com/ethereumjs/ethereumjs-vm/pull/345)
53+
- Added ``StateManager`` API documentation, see PR [#393](https://github.com/ethereumjs/ethereumjs-vm/pull/393)
54+
55+
56+
### New Features
57+
58+
- New ``emitFreeLogs`` option, 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](https://github.com/ethereumjs/ethereumjs-vm/pull/378), [#379](https://github.com/ethereumjs/ethereumjs-vm/pull/379)
59+
60+
### Testing and Documentation
61+
62+
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.
63+
64+
On the documentation side the API documentation has also been consolidated and there is now a unified and auto-generated [API documentation](https://github.com/ethereumjs/ethereumjs-vm/blob/master/docs/index.md) (previously being manually edited (and too often forgotten) in ``README``).
65+
66+
- Added API tests for ``index.js``, ``StateManager``, see PR [#364](https://github.com/ethereumjs/ethereumjs-vm/pull/364)
67+
- Added API Tests for ``runJit`` and ``fakeBlockchain``, see PR [#331](https://github.com/ethereumjs/ethereumjs-vm/pull/331)
68+
- Added API tests for ``runBlockchain``, see PR [#336](https://github.com/ethereumjs/ethereumjs-vm/pull/336)
69+
- Added ``runBlock`` API tests, see PR [#360](https://github.com/ethereumjs/ethereumjs-vm/pull/360)
70+
- Added ``runTx`` API tests, see PR [#352](https://github.com/ethereumjs/ethereumjs-vm/pull/352)
71+
- Added API Tests for the ``Bloom`` module, see PR [#330](https://github.com/ethereumjs/ethereumjs-vm/pull/330)
72+
- New consistent auto-generated [API documentation](https://github.com/ethereumjs/ethereumjs-vm/blob/master/docs/index.md), see PR [#377](https://github.com/ethereumjs/ethereumjs-vm/pull/377)
73+
- Blockchain tests now run by default on CI, see PR [#374](https://github.com/ethereumjs/ethereumjs-vm/pull/374)
74+
- Switched from ``istanbul`` to ``nyc``, see PR [#334](https://github.com/ethereumjs/ethereumjs-vm/pull/334)
75+
- Usage of ``sealEngine`` in blockchain tests, see PR [#373](https://github.com/ethereumjs/ethereumjs-vm/pull/373)
76+
- New ``tap-spec`` option to get a formatted test run result summary, see [README](https://github.com/ethereumjs/ethereumjs-vm#running-tests-with-a-reporterformatter), see PR [#363](https://github.com/ethereumjs/ethereumjs-vm/pull/363)
77+
- Updates/fixes on the JSDoc comments, see PRs [#362](https://github.com/ethereumjs/ethereumjs-vm/pull/362), [#361](https://github.com/ethereumjs/ethereumjs-vm/pull/361)
78+
79+
### Bug Fixes and Maintenance
80+
81+
Some bug fix and maintenance updates:
82+
83+
- Fix error handling in ``fakeBlockChain``, see PR [#320](https://github.com/ethereumjs/ethereumjs-vm/pull/320)
84+
- Update of ``ethereumjs-util`` to [v6.0.0](https://github.com/ethereumjs/ethereumjs-util/releases/tag/v6.0.0), see PR [#369](https://github.com/ethereumjs/ethereumjs-vm/pull/369)
85+
86+
87+
### Thank You
88+
89+
Special thanks to:
90+
91+
- @mattdean-digicatapult for his indefatigable work on the new StateManager interface and for fixing a large portion of the failing blockchain tests
92+
- @rmeissner for the work on Constantinople
93+
- @vpulim for jumping in so quickly and doing a reliable ``SSTORE`` implementation within 4 days
94+
- @s1na for the new API test suite
95+
96+
Beyond this release contains contributions from the following people:
97+
@jwasinger, @Agusx1211, @HolgerD77, @danjm, @whymarrh, @seesemichaelj, @kn
98+
99+
Thank you all very much, and thanks @axic for keeping an ongoing eye on overall library quality!
100+
101+
[2.5.0]: https://github.com/ethereumjs/ethereumjs-vm/compare/v2.4.0...v2.5.0
102+
8103
## [2.4.0] - 2018-07-27
9104

10105
With the ``2.4.x`` release series we now start to gradually add ``Constantinople`` features with the

README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,7 @@ Implements Ethereum's VM in Javascript.
1313

1414
#### Fork Support
1515

16-
With the ``2.4.x`` release series we now start to gradually add ``Constantinople`` features with the
17-
bitwise shifting instructions from [EIP 145](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md)
18-
making the start being introduced in the ``v2.4.0`` release.
19-
20-
Since both the scope of the ``Constantinople`` hardfork as well as the state of at least some of the EIPs
21-
to be included are not yet finalized, this is only meant for ``EXPERIMENTAL`` purposes, e.g. for developer
22-
tools to give users early access and make themself familiar with dedicated features.
23-
24-
Once scope and EIPs from ``Constantinople`` are final we will target a ``v2.5.0`` release which will officially
25-
introduce ``Constantinople`` support with all the changes bundled together.
26-
27-
Note that from this release on we also introduce new ``chain`` (default: ``mainnet``) and ``hardfork``
28-
(default: ``byzantium``) parameters, which make use of our new [ethereumjs-common](https://github.com/ethereumjs/ethereumjs-common) library and in the future will allow
29-
for parallel hardfork support from ``Byzantium`` onwards.
30-
31-
Since ``hardfork`` default might be changed or dropped in future releases, you might want to explicitly
32-
set this to ``byzantium`` on your next update to avoid future unexpected behavior.
16+
Starting with the ``v2.5.0`` release we now support both ``Byzantium`` and ``Constantinople`` fork rules - with ``Byzantium`` currently being the default (this will change in the future). See [release notes](https://github.com/ethereumjs/ethereumjs-vm/releases/tag/v2.5.0) for further details and have a look at the [API docs](./docs/index.md) on instructions how to instantiate the VM with the respective fork rules.
3317

3418
If you are still looking for a [Spurious Dragon](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-607.md) compatible version of this library install the latest of the ``2.2.x`` series (see [Changelog](./CHANGELOG.md)).
3519

@@ -61,8 +45,16 @@ To build for standalone use in the browser, install `browserify` and check [run-
6145

6246
# API
6347

48+
## VM
49+
6450
For documentation on ``VM`` instantiation, exposed API and emitted ``events`` see generated [API docs](./docs/index.md).
6551

52+
## StateManger
53+
54+
The API for the ``StateManager`` is currently in ``Beta``, separate documentation can be found [here](./docs/stateManager.md).
55+
56+
The ``StateManager`` API has been largely reworked recently and the ``StateManager`` will be removed from the VM and provided as a separate package in a future ``v3.0.0`` release, see [release notes](https://github.com/ethereumjs/ethereumjs-vm/releases/tag/v2.5.0) for the ``v2.5.0`` VM release for further details.
57+
6658
# Internal Structure
6759
The VM processes state changes at many levels.
6860

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ VM Class, `new VM(opts)` creates a new VM object
4949
- `opts.state` **Trie** a merkle-patricia-tree instance for the state tree (ignored if stateManager is passed)
5050
- `opts.blockchain` **Blockchain** a blockchain object for storing/retrieving blocks (ignored if stateManager is passed)
5151
- `opts.chain` **([String][31] \| [Number][32])** the chain the VM operates on [default: 'mainnet']
52-
- `opts.hardfork` **[String][31]** hardfork rules to be used [default: 'byzantium', supported: 'byzantium' (will throw on unsupported)]
52+
- `opts.hardfork` **[String][31]** hardfork rules to be used [default: 'byzantium', supported: 'byzantium', 'constantinople' (will throw on unsupported)]
5353
- `opts.activatePrecompiles` **[Boolean][33]** create entries in the state tree for the precompiled contracts
5454
- `opts.allowUnlimitedContractSize` **[Boolean][33]** allows unlimited contract sizes while debugging. By setting this to `true`, the check for contract size limit of 24KB (see [EIP-170][34]) is bypassed. (default: `false`; ONLY set to `true` during debugging)
5555
- `opts.emitFreeLogs` **[Boolean][33]** Changes the behavior of the LOG opcode, the gas cost of the opcode becomes zero and calling it using STATICCALL won't throw. (default: `false`; ONLY set to `true` during debugging)

lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ VM.deps = {
3636
* @param {Trie} opts.state a merkle-patricia-tree instance for the state tree (ignored if stateManager is passed)
3737
* @param {Blockchain} opts.blockchain a blockchain object for storing/retrieving blocks (ignored if stateManager is passed)
3838
* @param {String|Number} opts.chain the chain the VM operates on [default: 'mainnet']
39-
* @param {String} opts.hardfork hardfork rules to be used [default: 'byzantium', supported: 'byzantium' (will throw on unsupported)]
39+
* @param {String} opts.hardfork hardfork rules to be used [default: 'byzantium', supported: 'byzantium', 'constantinople' (will throw on unsupported)]
4040
* @param {Boolean} opts.activatePrecompiles create entries in the state tree for the precompiled contracts
4141
* @param {Boolean} opts.allowUnlimitedContractSize allows unlimited contract sizes while debugging. By setting this to `true`, the check for contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. (default: `false`; ONLY set to `true` during debugging)
4242
* @param {Boolean} opts.emitFreeLogs Changes the behavior of the LOG opcode, the gas cost of the opcode becomes zero and calling it using STATICCALL won't throw. (default: `false`; ONLY set to `true` during debugging)
@@ -47,8 +47,8 @@ function VM (opts = {}) {
4747
let chain = opts.chain ? opts.chain : 'mainnet'
4848
let hardfork = opts.hardfork ? opts.hardfork : 'byzantium'
4949
let supportedHardforks = [
50-
'byzantium', // Officially supported
51-
'constantinople' // No official support yet, only for testing reasons
50+
'byzantium',
51+
'constantinople'
5252
]
5353
this._common = new Common(chain, hardfork, supportedHardforks)
5454

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereumjs-vm",
3-
"version": "2.4.0",
3+
"version": "2.5.0",
44
"description": "An Ethereum VM implementation",
55
"main": "dist/index.js",
66
"files": [

0 commit comments

Comments
 (0)