@@ -6,6 +6,230 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
(modification: no type change headlines) and this project adheres to
7
7
[ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
8
8
9
+ ## [ 4.0.0-beta.1] - 2019-06-19
10
+
11
+ Since changes in this release are pretty deep reaching and broadly distributed,
12
+ we will first drop out one or several ` beta ` releases until we are confident on
13
+ both external API as well as inner structural changes. See
14
+ [ v4 branch] ( https://github.com/ethereumjs/ethereumjs-vm/pull/479 ) for some
15
+ major entry point into the work on the release.
16
+
17
+ It is highly recommended that you do some testing of your library against this
18
+ and following ` beta ` versions and give us some feedback!
19
+
20
+ These will be the main release notes for the ` v4 ` feature updates, subsequent
21
+ ` beta ` releases and the final release will just publish the delta changes and
22
+ point here for reference.
23
+
24
+ Breaking changes in the release notes are preeceeded with ` [BREAKING] ` , do a
25
+ search for an overview.
26
+
27
+ The outstanding work of [ @s1na ] ( https://github.com/s1na ) has to be mentioned
28
+ here. He has done the very large portion of the coding and without him this
29
+ release wouldn't have been possible. Thanks Sina! 🙂
30
+
31
+ So what's new?
32
+
33
+ ### TypeScript
34
+
35
+ This is the first ` TypeScript ` release of the VM (yay! 🎉).
36
+
37
+ ` TypeScript ` handles ` ES6 ` transpilation
38
+ [ a bit differently] ( https://github.com/Microsoft/TypeScript/issues/2719 ) (at the
39
+ end: cleaner) than ` babel ` so ` require ` syntax of the library slightly changes to:
40
+
41
+ ``` javascript
42
+ const VM = require (' ethereumjs-vm' ).default
43
+ ```
44
+
45
+ The library now also comes with ** type declaration files** distributed along
46
+ with the package published.
47
+
48
+ ##### Relevant PRs
49
+
50
+ - Preparation, migration of ` Bloom ` , ` Stack ` and ` Memory ` ,
51
+ PR [ #495 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/495 )
52
+ - ` StateManager ` migration,
53
+ PR [ #496 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/496 )
54
+ - Migration of precompiles, opcode list, ` EEI ` , ` Message ` , ` TxContext ` to
55
+ ` TypeScript ` , PR [ #497 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/497 )
56
+ - Migration of ` EVM ` (old: ` Interpreter ` ) and exceptions,
57
+ PR [ #504 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/504 )
58
+ - Migration of ` Interpreter ` (old: ` Loop ` ),
59
+ PR [ #505 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/505 )
60
+ - Migration of ` opFns ` (opcode implementations),
61
+ PR [ #506 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/506 )
62
+ - Migration of the main ` index.js ` ` VM ` class,
63
+ PR [ #507 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/507 )
64
+ - Migration of ` VM.runCode() ` ,
65
+ PR [ #508 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/508 )
66
+ - Migration of ` VM.runCall() ` ,
67
+ PR [ #510 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/510 )
68
+ - Migration of ` VM.runTx() ` ,
69
+ PR [ #511 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/511 )
70
+ - Migration of ` VM.runBlock() ` ,
71
+ PR [ #512 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/512 )
72
+ - Migration of ` VM.runBlockchain() ` ,
73
+ PR [ #517 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/517 )
74
+ - ` TypeScript ` finalization PR, config switch,
75
+ PR [ #518 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/518 )
76
+ - Doc generation via ` TypeDoc ` ,
77
+ PR [ #522 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/522 )
78
+
79
+ ### EVM Modularization and Structural Refactoring
80
+
81
+ ##### New Call and Code Loop Structure / EVM Encapsulation
82
+
83
+ This release switches to a new class based and promisified structure for
84
+ working down VM calls and running through code loops, and encapsulates this
85
+ logic to be bound to the specific ` EVM ` (so the classical Ethereum Virtual Machine)
86
+ implementation in the
87
+ [ evm] ( https://github.com/ethereumjs/ethereumjs-vm/tree/master/lib/evm ) module,
88
+ opening the way for a future parallel ` eWASM ` additional implementation.
89
+
90
+ This new logic is mainly handled by the two new classes ` EVM ` (old: ` Interpreter ` )
91
+ and ` Interpreter ` (old: ` Loop ` ),
92
+ see PR [ #483 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/483 )
93
+ for the initial work on this. The old ` VM.runCall() ` and ` VM.runCode() `
94
+ methods are just kept as being wrappers and will likely be deprecated on future
95
+ releases once the inner API structure further stabilizes.
96
+
97
+ This new structure should make extending the VM by subclassing and
98
+ adopting functionality much easier, e.g. by changing opcode functionality or adding
99
+ custom onces by using an own ` Interpreter.getOpHandler() ` implementation. You are
100
+ highly encouraged to play around, see what you can do and give us feedback on
101
+ possibilities and limitations.
102
+
103
+ #### EEI for Environment Communication
104
+
105
+ For interacting with the blockchain environment there has been introduced a
106
+ dedicated ` EEI ` (Ethereum Environment Interface) module closely resembling the
107
+ respective
108
+ [ EEI spec] ( https://github.com/ewasm/design/blob/master/eth_interface.md ) , see
109
+ PR [ #486 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/486 ) for the initial
110
+ work.
111
+
112
+ This makes handling of environmental data by the VM a lot cleaner and transparent
113
+ and should as well allow for much easier extension and modification.
114
+
115
+ ##### Changes
116
+
117
+ - Detached precompiles from the VM,
118
+ PR [ #492 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/492 )
119
+ - Subdivided ` runState ` , refactored ` Interpreter ` (old: ` Loop ` ),
120
+ PR [ #498 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/498 )
121
+ - [ BREAKING] Dropped ` emitFreeLogs ` flag, to replace it is suggested to
122
+ implement by inheriting ` Interpreter ` (old: ` Loop ` ),
123
+ PR [ #498 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/498 )
124
+ - Split ` EVM.executeMessage() ` with ` EVM.executeCall() ` and
125
+ ` EVM.executeCreate() ` for ` call ` and ` create ` specific logic
126
+ (old names: ` Interpreter.[METHOD_NAME]() ` ),
127
+ PR [ #499 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/499 )
128
+ - Further simplification of ` Interpreter ` /` EVM `
129
+ (old: ` Loop ` /` Interpreter ` ) structure,
130
+ PR [ #506 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/506 )
131
+ - [ BREAKING] Dropped ` VM.runJit() ` in favor of direct handling in
132
+ ` EVM ` (old: ` Interpreter ` ),
133
+ officially not part of the external API but mentioning just in case,
134
+ PR [ #515 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/515 )
135
+ - Removed ` StorageReader ` , moved logic to ` StateManager ` ,
136
+ [ #534 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/534 )
137
+
138
+ ### Istanbul Process Start
139
+
140
+ With this release we start the ` Istanbul ` hardfork integration process and
141
+ have activated the ` istanbul ` ` hardfork ` option for the constructor.
142
+
143
+ This is meant to be used experimentation and reference implementations, we have made
144
+ a start with integrating draft [ EIP-1108] ( https://eips.ethereum.org/EIPS/eip-1108 )
145
+ ` Istanbul ` candidate support reducing the gas costs for ` alt_bn128 ` precompiles,
146
+ see PR [ #539 ] ( https://github.com/ethereumjs/ethereumjs-vm/issues/539 ) for
147
+ implementation details.
148
+
149
+ Note that this is still very early in the process since no EIP in a final
150
+ state is actually accepted for being included into ` Istanbul ` on the time of
151
+ release. The ` v4 ` release series will be kept as an experimental series
152
+ during the process with breaking changes introduced along the way without too
153
+ much notice, so be careful and tighten the VM dependency if you want to give
154
+ your users the chance for some early experimentation with some specific
155
+ implementation state.
156
+
157
+ Once scope of ` Istanbul ` as well as associated EIPs are finalized a stable
158
+ ` Istanbul ` VM version will be released as a subsequent major release.
159
+
160
+ ### Code Modernization and Version Updates
161
+
162
+ The main API with the ` v4 ` release switches from being ` callback ` based to
163
+ using promises,
164
+ see PR [ #546 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/546 ) .
165
+
166
+ Here is an example for changed API call ` runTx ` .
167
+
168
+ Old ` callback ` -style invocation:
169
+
170
+ ``` javascript
171
+ vm .runTx (
172
+ {
173
+ tx: tx,
174
+ },
175
+ function (err , result ) {
176
+ if (err) {
177
+ // Handle errors appropriately
178
+ }
179
+ // Do something with the result
180
+ },
181
+ )
182
+ ```
183
+
184
+ Promisified usage:
185
+
186
+ ``` javascript
187
+ try {
188
+ let result = await vm .runTx ({ tx: tx })
189
+ // Do something with the result
190
+ } catch (err) {
191
+ // handle errors appropriately
192
+ }
193
+ ```
194
+
195
+ ##### Code Modernization Changes
196
+
197
+ - Promisified internal usage of async opcode handlers,
198
+ PR [ #491 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/491 )
199
+ - Promisified ` runTx ` internals,
200
+ PR [ #493 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/493 )
201
+ - Promisified ` runBlock ` internals, restructure, reduced shared global state,
202
+ PR [ #494 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/494 )
203
+
204
+ ##### Version Updates
205
+
206
+ - Updated ` ethereumjs-account ` from ` 2.x ` to ` 3.x ` , part of
207
+ PR [ #496 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/496 )
208
+
209
+ ##### Features
210
+
211
+ - The VM now also supports a
212
+ [ Common] ( https://github.com/ethereumjs/ethereumjs-common )
213
+ class instance for chain and HF setting,
214
+ PRs [ #525 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/525 ) and
215
+ [ #526 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/526 )
216
+
217
+ ##### Bug Fixes
218
+
219
+ - Fixed error message in ` runTx() ` ,
220
+ PR [ #523 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/523 )
221
+ - Changed default hardfork in ` StateManager ` to ` petersburg ` ,
222
+ PR [ #524 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/524 )
223
+ - Replaced ` Object.assign() ` calls and fixed type errors,
224
+ PR [ #529 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/529 )
225
+
226
+ #### Development
227
+
228
+ - Significant blockchain test speed improvements,
229
+ PR [ #536 ] ( https://github.com/ethereumjs/ethereumjs-vm/pull/536 )
230
+
231
+ [ 4.0.0-beta.1 ] : https://github.com/ethereumjs/ethereumjs-vm/compare/v3.0.0...v4.0.0-beta.1
232
+
9
233
## [ 3.0.0] - 2019-03-29
10
234
11
235
This release comes with a modernized ` ES6 ` -class structured code base, some
0 commit comments