From 6a63b42a59f475c4431c6ace7a423db7a44ae494 Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Wed, 11 Sep 2019 22:06:22 +0200 Subject: [PATCH 1/2] Bumped version to v4.1.0, added CHANGELOG entry and updated README on Istanbul support --- CHANGELOG.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 45 +++++++++++++++++++++--------------- package.json | 2 +- 3 files changed, 92 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c89ddae65c..a6f2676380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,71 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [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](https://eips.ethereum.org/EIPS/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](https://github.com/ethereumjs/ethereumjs-vm/issues/501) for a summary +on all the changes. + +Added EIPs: + +- [EIP-152](https://github.com/ethereum/EIPs/pull/2129): Blake 2b `F` precompile, + PR [#584](https://github.com/ethereumjs/ethereumjs-vm/pull/584) +- [EIP-1108](https://eips.ethereum.org/EIPS/eip-1108): Reduce `alt_bn128` + precompile gas costs, + PR [#540](https://github.com/ethereumjs/ethereumjs-vm/pull/540) + (already released in `v4.0.0`) +- [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344): Add ChainID Opcode, + PR [#572](https://github.com/ethereumjs/ethereumjs-vm/pull/572) +- [EIP-1884](https://eips.ethereum.org/EIPS/eip-1884): Trie-size-dependent + Opcode Repricing, + PR [#581](https://github.com/ethereumjs/ethereumjs-vm/pull/581) +- [EIP-2200](https://github.com/ethereum/EIPs/pull/2200): Rebalance net-metered + SSTORE gas costs, + PR [#590](https://github.com/ethereumjs/ethereumjs-vm/pull/590) + +**Other Features** + +- Two new event types `beforeMessage` and `afterMessage`, emitting a `Message` + before and an `EVMResult` after running a `Message`, see also the + [updated section](https://github.com/ethereumjs/ethereumjs-vm#vms-tracing-events) + in the `README` on this, + PR [#577](https://github.com/ethereumjs/ethereumjs-vm/pull/577) + +**Bug Fixes** + +- Transaction error strings should not contain multiple consecutive whitespace + characters, this has been fixed, + PR [#578](https://github.com/ethereumjs/ethereumjs-vm/pull/578) +- Fixed `vm.stateManager.generateCanonicalGenesis()` to produce a correct + genesis block state root (in particular for the `Goerli` testnet), + PR [#589](https://github.com/ethereumjs/ethereumjs-vm/pull/589) + +**Refactoring / Docs** + +- Preparation for separate lists of opcodes for the different HFs, + PR [#582](https://github.com/ethereumjs/ethereumjs-vm/pull/582), + see also follow-up + PR [#592](https://github.com/ethereumjs/ethereumjs-vm/pull/592) making this + list a property of the VM instance +- Clarification in the docs for the behavior of the `activatePrecompiles` + VM option, + PR [#595](https://github.com/ethereumjs/ethereumjs-vm/pull/595) + +[4.1.0]: https://github.com/ethereumjs/ethereumjs-vm/compare/v4.0.0...v4.1.0 + ## [4.0.0] - 2019-08-06 First `TypeScript` based VM release, other highlights: diff --git a/README.md b/README.md index 11a7811f2e..bbcafb6c6d 100644 --- a/README.md +++ b/README.md @@ -16,30 +16,37 @@ The VM currently supports the following hardfork rules: - `Byzantium` - `Constantinople` - `Petersburg` (default) -- `Istanbul` (`DRAFT`) +- `Istanbul` (`beta`) 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)). ##### Istanbul Harfork Support -With the `v4.0.0` release we are starting to add implementations of EIPs being -candidates or accepted for inclusion within the `Istanbul` hardfork. You can -activate a preliminary `Istanbul` VM by using the `istanbul` `hardfork` option -flag. - -Currently supported `Istanbul` EIPs: - -- [EIP-1108](https://eips.ethereum.org/EIPS/eip-1803) (Candidate): `alt_bn128` Gas Cost Reductions, see PR [#540](https://github.com/ethereumjs/ethereumjs-vm/pull/540) - -Note that this is highly experimental and solely meant for experimental purposes, -since `Istanbul` scope is not yet finalized and most EIPs are still in a `DRAFT` -state and likely subject to updates and changes. - -A final `Istanbul` VM will be released along a major version bump to likely -`v5.0.0` or `v6.0.0`. - -Have a look at the corresponding issue to follow the discussion and current state on -[Istanbul planning](https://github.com/ethereumjs/ethereumjs-vm/issues/501). +A feature-complete `Istanbul` HF implementation is available since the `v4.1.0` +VM release. You can activate an `Istanbul` VM by using the `istanbul` +`hardfork` option flag. + +Supported `Istanbul` EIPs: + +- [EIP-152](https://github.com/ethereum/EIPs/pull/2129): Blake 2b `F` precompile, + PR [#584](https://github.com/ethereumjs/ethereumjs-vm/pull/584) +- [EIP-1108](https://eips.ethereum.org/EIPS/eip-1108): Reduce `alt_bn128` + precompile gas costs, + PR [#540](https://github.com/ethereumjs/ethereumjs-vm/pull/540) + (already released in `v4.0.0`) +- [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344): Add ChainID Opcode, + PR [#572](https://github.com/ethereumjs/ethereumjs-vm/pull/572) +- [EIP-1884](https://eips.ethereum.org/EIPS/eip-1884): Trie-size-dependent + Opcode Repricing, + PR [#581](https://github.com/ethereumjs/ethereumjs-vm/pull/581) +- [EIP-2200](https://github.com/ethereum/EIPs/pull/2200): Rebalance net-metered + SSTORE gas costs, + PR [#590](https://github.com/ethereumjs/ethereumjs-vm/pull/590) + +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. # INSTALL diff --git a/package.json b/package.json index 9b93107f5f..4a99f86df2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ethereumjs-vm", - "version": "4.0.0", + "version": "4.1.0", "description": "An Ethereum VM implementation", "main": "dist/index.js", "types": "dist/index.d.ts", From 1f49e81743940f43f26bddd5b0135655b90c28c7 Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Wed, 11 Sep 2019 22:07:19 +0200 Subject: [PATCH 2/2] Regenerated the documentation --- docs/README.md | 25 ++++++++++ docs/classes/statemanager.md | 76 ++++++++++++++--------------- docs/classes/vm.md | 50 +++++++++++++------ docs/classes/vmerror.md | 6 +-- docs/enums/error.md | 32 +++++++----- docs/interfaces/evmresult.md | 24 ++++----- docs/interfaces/execresult.md | 46 +++++------------ docs/interfaces/newcontractevent.md | 38 +++++++++++++++ docs/interfaces/runblockopts.md | 8 +-- docs/interfaces/runblockresult.md | 4 +- docs/interfaces/runcallopts.md | 30 ++++++------ docs/interfaces/runcodeopts.md | 32 ++++++------ docs/interfaces/runtxopts.md | 10 ++-- docs/interfaces/runtxresult.md | 38 +++++++-------- docs/interfaces/statemanageropts.md | 4 +- docs/interfaces/txreceipt.md | 10 ++-- docs/interfaces/vmopts.md | 24 +++++---- 17 files changed, 266 insertions(+), 191 deletions(-) create mode 100644 docs/interfaces/newcontractevent.md diff --git a/docs/README.md b/docs/README.md index 0d020df518..a916038f63 100644 --- a/docs/README.md +++ b/docs/README.md @@ -17,6 +17,7 @@ * [EVMResult](interfaces/evmresult.md) * [ExecResult](interfaces/execresult.md) +* [NewContractEvent](interfaces/newcontractevent.md) * [RunBlockOpts](interfaces/runblockopts.md) * [RunBlockResult](interfaces/runblockresult.md) * [RunCallOpts](interfaces/runcallopts.md) @@ -28,5 +29,29 @@ * [TxReceipt](interfaces/txreceipt.md) * [VMOpts](interfaces/vmopts.md) +### Functions + +* [OOGResult](#oogresult) + --- +## Functions + + + +### OOGResult + +▸ **OOGResult**(gasLimit: *`BN`*): [ExecResult](interfaces/execresult.md) + +*Defined in [evm/evm.ts:80](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L80)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| gasLimit | `BN` | + +**Returns:** [ExecResult](interfaces/execresult.md) + +___ + diff --git a/docs/classes/statemanager.md b/docs/classes/statemanager.md index 9909d50249..9fe97caf83 100644 --- a/docs/classes/statemanager.md +++ b/docs/classes/statemanager.md @@ -61,7 +61,7 @@ Interface for getting and setting data from an underlying state trie. ⊕ **new StateManager**(opts?: *[StateManagerOpts](../interfaces/statemanageropts.md)*): [StateManager](statemanager.md) -*Defined in [state/stateManager.ts:45](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L45)* +*Defined in [state/stateManager.ts:45](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L45)* Instantiate the StateManager interface. @@ -83,7 +83,7 @@ ___ **● _cache**: *`Cache`* -*Defined in [state/stateManager.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L41)* +*Defined in [state/stateManager.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L41)* ___ @@ -92,7 +92,7 @@ ___ **● _checkpointCount**: *`number`* -*Defined in [state/stateManager.ts:44](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L44)* +*Defined in [state/stateManager.ts:44](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L44)* ___ @@ -101,7 +101,7 @@ ___ **● _common**: *`Common`* -*Defined in [state/stateManager.ts:38](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L38)* +*Defined in [state/stateManager.ts:38](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L38)* ___ @@ -110,7 +110,7 @@ ___ **● _originalStorageCache**: *`Map`<`string`, `Map`<`string`, `Buffer`>>* -*Defined in [state/stateManager.ts:45](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L45)* +*Defined in [state/stateManager.ts:45](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L45)* ___ @@ -119,7 +119,7 @@ ___ **● _storageTries**: *`any`* -*Defined in [state/stateManager.ts:40](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L40)* +*Defined in [state/stateManager.ts:40](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L40)* ___ @@ -128,7 +128,7 @@ ___ **● _touched**: *`Set`<`string`>* -*Defined in [state/stateManager.ts:42](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L42)* +*Defined in [state/stateManager.ts:42](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L42)* ___ @@ -137,7 +137,7 @@ ___ **● _touchedStack**: *`Set`<`string`>[]* -*Defined in [state/stateManager.ts:43](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L43)* +*Defined in [state/stateManager.ts:43](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L43)* ___ @@ -146,7 +146,7 @@ ___ **● _trie**: *`any`* -*Defined in [state/stateManager.ts:39](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L39)* +*Defined in [state/stateManager.ts:39](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L39)* ___ @@ -158,7 +158,7 @@ ___ ▸ **_getStorageTrie**(address: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:177](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L177)* +*Defined in [state/stateManager.ts:177](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L177)* Gets the storage trie for an account from the storage cache or does a lookup. @@ -178,7 +178,7 @@ ___ ▸ **_lookupStorageTrie**(address: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:159](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L159)* +*Defined in [state/stateManager.ts:159](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L159)* Creates a storage trie from the primary storage trie for an account and saves this in the storage cache. @@ -198,7 +198,7 @@ ___ ▸ **_modifyContractStorage**(address: *`Buffer`*, modifyTrie: *`any`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:255](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L255)* +*Defined in [state/stateManager.ts:264](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L264)* Modifies the storage trie of an account @@ -219,7 +219,7 @@ ___ ▸ **accountIsEmpty**(address: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:537](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L537)* +*Defined in [state/stateManager.ts:554](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L554)* Checks if the `account` corresponding to `address` is empty as defined in EIP-161 ([https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md)](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md)). @@ -239,7 +239,7 @@ ___ ▸ **checkpoint**(cb: *`any`*): `void` -*Defined in [state/stateManager.ts:321](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L321)* +*Defined in [state/stateManager.ts:334](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L334)* Checkpoints the current state of the StateManager instance. State changes that follow can then be committed by calling `commit` or `reverted` by calling rollback. @@ -258,7 +258,7 @@ ___ ▸ **cleanupTouchedAccounts**(cb: *`any`*): `void` -*Defined in [state/stateManager.ts:558](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L558)* +*Defined in [state/stateManager.ts:575](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L575)* Removes accounts form the state trie that have been touched, as defined in EIP-161 ([https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md)](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md)). @@ -277,7 +277,7 @@ ___ ▸ **clearContractStorage**(address: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:304](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L304)* +*Defined in [state/stateManager.ts:317](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L317)* Clears all storage entries for the account corresponding to `address`. @@ -297,7 +297,7 @@ ___ ▸ **commit**(cb: *`any`*): `void` -*Defined in [state/stateManager.ts:334](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L334)* +*Defined in [state/stateManager.ts:347](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L347)* Commits the current change-set to the instance since the last call to checkpoint. @@ -316,9 +316,9 @@ ___ ▸ **copy**(): [StateManager](statemanager.md) -*Defined in [state/stateManager.ts:71](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L71)* +*Defined in [state/stateManager.ts:71](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L71)* -Copies the current instance of the `DefaultStateManager` at the last fully committed point, i.e. as if all current checkpoints were reverted. +Copies the current instance of the `StateManager` at the last fully committed point, i.e. as if all current checkpoints were reverted. **Returns:** [StateManager](statemanager.md) @@ -329,7 +329,7 @@ ___ ▸ **dumpStorage**(address: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:447](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L447)* +*Defined in [state/stateManager.ts:460](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L460)* Dumps the the storage values for an `account` specified by `address`. @@ -349,7 +349,7 @@ ___ ▸ **generateCanonicalGenesis**(cb: *`any`*): `void` -*Defined in [state/stateManager.ts:487](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L487)* +*Defined in [state/stateManager.ts:500](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L500)* Generates a canonical genesis state on the instance based on the configured chain parameters. Will error if there are uncommitted checkpoints on the instance. @@ -368,7 +368,7 @@ ___ ▸ **generateGenesis**(initState: *`any`*, cb: *`any`*): `any` -*Defined in [state/stateManager.ts:506](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L506)* +*Defined in [state/stateManager.ts:519](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L519)* Initializes the provided genesis state into the state trie @@ -388,7 +388,7 @@ ___ ▸ **getAccount**(address: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:89](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L89)* +*Defined in [state/stateManager.ts:89](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L89)* Gets the [`ethereumjs-account`](https://github.com/ethereumjs/ethereumjs-account) associated with `address`. Returns an empty account if the account does not exist. @@ -408,7 +408,7 @@ ___ ▸ **getContractCode**(address: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:145](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L145)* +*Defined in [state/stateManager.ts:145](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L145)* Gets the code corresponding to the provided `address`. @@ -428,17 +428,17 @@ ___ ▸ **getContractStorage**(address: *`Buffer`*, key: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:202](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L202)* +*Defined in [state/stateManager.ts:203](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L203)* -Gets the storage value associated with the provided `address` and `key`. +Gets the storage value associated with the provided `address` and `key`. This method returns the shortest representation of the stored value. **Parameters:** | Name | Type | Description | | ------ | ------ | ------ | | address | `Buffer` | Address of the account to get the storage for | -| key | `Buffer` | Key in the account's storage to get the value for | -| cb | `any` | | +| key | `Buffer` | Key in the account's storage to get the value for. Must be 32 bytes long. | +| cb | `any` | **Returns:** `void` @@ -449,7 +449,7 @@ ___ ▸ **getOriginalContractStorage**(address: *`Buffer`*, key: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:225](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L225)* +*Defined in [state/stateManager.ts:230](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L230)* Caches the storage value associated with the provided `address` and `key` on first invocation, and returns the cached (original) value from then onwards. This is used to get the original value of a storage slot for computing gas costs according to EIP-1283. @@ -458,7 +458,7 @@ Caches the storage value associated with the provided `address` and `key` on fir | Name | Type | Description | | ------ | ------ | ------ | | address | `Buffer` | Address of the account to get the storage for | -| key | `Buffer` | Key in the account's storage to get the value for | +| key | `Buffer` | Key in the account's storage to get the value for. Must be 32 bytes long. | | cb | `any` | **Returns:** `void` @@ -470,7 +470,7 @@ ___ ▸ **getStateRoot**(cb: *`any`*): `void` -*Defined in [state/stateManager.ts:383](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L383)* +*Defined in [state/stateManager.ts:396](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L396)* Gets the state-root of the Merkle-Patricia trie representation of the state of this StateManager. Will error if there are uncommitted checkpoints on the instance. @@ -489,7 +489,7 @@ ___ ▸ **hasGenesisState**(cb: *`any`*): `void` -*Defined in [state/stateManager.ts:476](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L476)* +*Defined in [state/stateManager.ts:489](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L489)* Checks whether the current instance has the canonical genesis state for the configured chain parameters. @@ -508,7 +508,7 @@ ___ ▸ **putAccount**(address: *`Buffer`*, account: *`Account`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:100](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L100)* +*Defined in [state/stateManager.ts:100](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L100)* Saves an [`ethereumjs-account`](https://github.com/ethereumjs/ethereumjs-account) into state under the provided `address`. @@ -529,7 +529,7 @@ ___ ▸ **putContractCode**(address: *`Buffer`*, value: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:117](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L117)* +*Defined in [state/stateManager.ts:117](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L117)* Adds `value` to the state trie as code, and sets `codeHash` on the account corresponding to `address` to reference this. @@ -550,7 +550,7 @@ ___ ▸ **putContractStorage**(address: *`Buffer`*, key: *`Buffer`*, value: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:282](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L282)* +*Defined in [state/stateManager.ts:291](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L291)* Adds value to the state trie for the `account` corresponding to `address` at the provided `key`. @@ -559,7 +559,7 @@ Adds value to the state trie for the `account` corresponding to `address` at the | Name | Type | Description | | ------ | ------ | ------ | | address | `Buffer` | Address to set a storage value for | -| key | `Buffer` | Key to set the value at | +| key | `Buffer` | Key to set the value at. Must be 32 bytes long. | | value | `Buffer` | Value to set at \`key\` for account corresponding to \`address\` | | cb | `any` | Callback function | @@ -572,7 +572,7 @@ ___ ▸ **revert**(cb: *`any`*): `void` -*Defined in [state/stateManager.ts:352](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L352)* +*Defined in [state/stateManager.ts:365](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L365)* Reverts the current change-set to the instance since the last call to checkpoint. @@ -591,7 +591,7 @@ ___ ▸ **setStateRoot**(stateRoot: *`Buffer`*, cb: *`any`*): `void` -*Defined in [state/stateManager.ts:405](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L405)* +*Defined in [state/stateManager.ts:418](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L418)* Sets the state of the instance to that represented by the provided `stateRoot`. Will error if there are uncommitted checkpoints on the instance or if the state root does not exist in the state trie. diff --git a/docs/classes/vm.md b/docs/classes/vm.md index f1a0081552..228a638a9e 100644 --- a/docs/classes/vm.md +++ b/docs/classes/vm.md @@ -4,6 +4,8 @@ Execution engine which can be used to run a blockchain, individual blocks, individual transactions, or snippets of EVM bytecode. +This class is an AsyncEventEmitter, which means that event handlers are run to completion before continuing. If an error is thrown in an event handler, it will bubble up to the VM and thrown from the method call that triggered the event. + ## Hierarchy `any` @@ -19,6 +21,7 @@ Execution engine which can be used to run a blockchain, individual blocks, indiv ### Properties * [_common](vm.md#_common) +* [_opcodes](vm.md#_opcodes) * [allowUnlimitedContractSize](vm.md#allowunlimitedcontractsize) * [blockchain](vm.md#blockchain) * [opts](vm.md#opts) @@ -44,7 +47,7 @@ Execution engine which can be used to run a blockchain, individual blocks, indiv ⊕ **new VM**(opts?: *[VMOpts](../interfaces/vmopts.md)*): [VM](vm.md) -*Defined in [index.ts:61](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L61)* +*Defined in [index.ts:74](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L74)* Instantiates a new [VM](vm.md) Object. @@ -66,7 +69,16 @@ ___ **● _common**: *`Common`* -*Defined in [index.ts:58](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L58)* +*Defined in [index.ts:70](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L70)* + +___ + + +### _opcodes + +**● _opcodes**: *`OpcodeList`* + +*Defined in [index.ts:74](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L74)* ___ @@ -75,16 +87,16 @@ ___ **● allowUnlimitedContractSize**: *`boolean`* -*Defined in [index.ts:61](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L61)* +*Defined in [index.ts:73](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L73)* ___ ### blockchain -**● blockchain**: *`any`* +**● blockchain**: *`Blockchain`* -*Defined in [index.ts:60](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L60)* +*Defined in [index.ts:72](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L72)* ___ @@ -93,7 +105,7 @@ ___ **● opts**: *[VMOpts](../interfaces/vmopts.md)* -*Defined in [index.ts:57](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L57)* +*Defined in [index.ts:69](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L69)* ___ @@ -102,7 +114,7 @@ ___ **● stateManager**: *[StateManager](statemanager.md)* -*Defined in [index.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L59)* +*Defined in [index.ts:71](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L71)* ___ @@ -114,7 +126,7 @@ ___ ▸ **_emit**(topic: *`string`*, data: *`any`*): `Promise`<`any`> -*Defined in [index.ts:160](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L160)* +*Defined in [index.ts:192](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L192)* **Parameters:** @@ -132,7 +144,7 @@ ___ ▸ **copy**(): [VM](vm.md) -*Defined in [index.ts:152](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L152)* +*Defined in [index.ts:184](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L184)* Returns a copy of the [VM](vm.md) instance. @@ -145,10 +157,12 @@ ___ ▸ **runBlock**(opts: *[RunBlockOpts](../interfaces/runblockopts.md)*): `Promise`<[RunBlockResult](../interfaces/runblockresult.md)> -*Defined in [index.ts:124](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L124)* +*Defined in [index.ts:148](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L148)* Processes the `block` running all of the transactions it contains and updating the miner's account +This method modifies the state. If `generate` is `true`, the state modifications will be reverted if an exception is raised. If it's `false`, it won't revert if the block's header is invalid. If an error is thrown from an event handler, the state may or may not be reverted. + **Parameters:** | Name | Type | Description | @@ -164,10 +178,12 @@ ___ ▸ **runBlockchain**(blockchain: *`any`*): `Promise`<`void`> -*Defined in [index.ts:115](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L115)* +*Defined in [index.ts:134](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L134)* Processes blocks and adds them to the blockchain. +This method modifies the state. + **Parameters:** | Name | Type | Description | @@ -183,10 +199,12 @@ ___ ▸ **runCall**(opts: *[RunCallOpts](../interfaces/runcallopts.md)*): `Promise`<[EVMResult](../interfaces/evmresult.md)> -*Defined in [index.ts:138](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L138)* +*Defined in [index.ts:168](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L168)* runs a call (or create) operation. +This method modifies the state. + **Parameters:** | Name | Type | @@ -202,10 +220,12 @@ ___ ▸ **runCode**(opts: *[RunCodeOpts](../interfaces/runcodeopts.md)*): `Promise`<[ExecResult](../interfaces/execresult.md)> -*Defined in [index.ts:145](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L145)* +*Defined in [index.ts:177](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L177)* Runs EVM code. +This method modifies the state. + **Parameters:** | Name | Type | @@ -221,10 +241,12 @@ ___ ▸ **runTx**(opts: *[RunTxOpts](../interfaces/runtxopts.md)*): `Promise`<[RunTxResult](../interfaces/runtxresult.md)> -*Defined in [index.ts:131](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L131)* +*Defined in [index.ts:159](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L159)* Process a transaction. Run the vm. Transfers eth. Checks balances. +This method modifies the state. If an error is thrown, the modifications are reverted, except when the error is thrown from an event handler. In the latter case the state may or may not be reverted. + **Parameters:** | Name | Type | diff --git a/docs/classes/vmerror.md b/docs/classes/vmerror.md index e16d566299..cedf6eb9d1 100644 --- a/docs/classes/vmerror.md +++ b/docs/classes/vmerror.md @@ -27,7 +27,7 @@ ⊕ **new VmError**(error: *[ERROR](../enums/error.md)*): [VmError](vmerror.md) -*Defined in [exceptions.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L17)* +*Defined in [exceptions.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L18)* **Parameters:** @@ -47,7 +47,7 @@ ___ **● error**: *[ERROR](../enums/error.md)* -*Defined in [exceptions.ts:16](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L16)* +*Defined in [exceptions.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L17)* ___ @@ -56,7 +56,7 @@ ___ **● errorType**: *`string`* -*Defined in [exceptions.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L17)* +*Defined in [exceptions.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L18)* ___ diff --git a/docs/enums/error.md b/docs/enums/error.md index 99840c2cad..d3d0b4fdaa 100644 --- a/docs/enums/error.md +++ b/docs/enums/error.md @@ -12,6 +12,7 @@ * [INVALID_OPCODE](error.md#invalid_opcode) * [OUT_OF_GAS](error.md#out_of_gas) * [OUT_OF_RANGE](error.md#out_of_range) +* [REFUND_EXHAUSTED](error.md#refund_exhausted) * [REVERT](error.md#revert) * [STACK_OVERFLOW](error.md#stack_overflow) * [STACK_UNDERFLOW](error.md#stack_underflow) @@ -28,7 +29,7 @@ **CREATE_COLLISION**: = "create collision" -*Defined in [exceptions.ts:11](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L11)* +*Defined in [exceptions.ts:11](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L11)* ___ @@ -37,7 +38,7 @@ ___ **INTERNAL_ERROR**: = "internal error" -*Defined in [exceptions.ts:10](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L10)* +*Defined in [exceptions.ts:10](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L10)* ___ @@ -46,7 +47,7 @@ ___ **INVALID_JUMP**: = "invalid JUMP" -*Defined in [exceptions.ts:5](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L5)* +*Defined in [exceptions.ts:5](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L5)* ___ @@ -55,7 +56,7 @@ ___ **INVALID_OPCODE**: = "invalid opcode" -*Defined in [exceptions.ts:6](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L6)* +*Defined in [exceptions.ts:6](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L6)* ___ @@ -64,7 +65,7 @@ ___ **OUT_OF_GAS**: = "out of gas" -*Defined in [exceptions.ts:2](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L2)* +*Defined in [exceptions.ts:2](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L2)* ___ @@ -73,7 +74,16 @@ ___ **OUT_OF_RANGE**: = "value out of range" -*Defined in [exceptions.ts:7](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L7)* +*Defined in [exceptions.ts:7](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L7)* + +___ + + +### REFUND_EXHAUSTED + +**REFUND_EXHAUSTED**: = "refund exhausted" + +*Defined in [exceptions.ts:13](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L13)* ___ @@ -82,7 +92,7 @@ ___ **REVERT**: = "revert" -*Defined in [exceptions.ts:8](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L8)* +*Defined in [exceptions.ts:8](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L8)* ___ @@ -91,7 +101,7 @@ ___ **STACK_OVERFLOW**: = "stack overflow" -*Defined in [exceptions.ts:4](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L4)* +*Defined in [exceptions.ts:4](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L4)* ___ @@ -100,7 +110,7 @@ ___ **STACK_UNDERFLOW**: = "stack underflow" -*Defined in [exceptions.ts:3](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L3)* +*Defined in [exceptions.ts:3](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L3)* ___ @@ -109,7 +119,7 @@ ___ **STATIC_STATE_CHANGE**: = "static state change" -*Defined in [exceptions.ts:9](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L9)* +*Defined in [exceptions.ts:9](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L9)* ___ @@ -118,7 +128,7 @@ ___ **STOP**: = "stop" -*Defined in [exceptions.ts:12](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/exceptions.ts#L12)* +*Defined in [exceptions.ts:12](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/exceptions.ts#L12)* ___ diff --git a/docs/interfaces/evmresult.md b/docs/interfaces/evmresult.md index 9f31218297..650336b14b 100644 --- a/docs/interfaces/evmresult.md +++ b/docs/interfaces/evmresult.md @@ -15,8 +15,8 @@ Result of executing a message via the \[\[EVM\]\]. ### Properties * [createdAddress](evmresult.md#createdaddress) +* [execResult](evmresult.md#execresult) * [gasUsed](evmresult.md#gasused) -* [vm](evmresult.md#vm) --- @@ -28,31 +28,31 @@ Result of executing a message via the \[\[EVM\]\]. **● createdAddress**: *`Buffer`* -*Defined in [evm/evm.ts:38](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L38)* +*Defined in [evm/evm.ts:32](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L32)* Address of created account durint transaction, if any ___ - + -### gasUsed +### execResult -**● gasUsed**: *`BN`* +**● execResult**: *[ExecResult](execresult.md)* -*Defined in [evm/evm.ts:34](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L34)* +*Defined in [evm/evm.ts:36](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L36)* -Amount of gas used by the transaction +Contains the results from running the code, if any, as described in [runCode](../classes/vm.md#runcode) ___ - + -### vm +### gasUsed -**● vm**: *[ExecResult](execresult.md)* +**● gasUsed**: *`BN`* -*Defined in [evm/evm.ts:42](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L42)* +*Defined in [evm/evm.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L28)* -Contains the results from running the code, if any, as described in [runCode](../classes/vm.md#runcode) +Amount of gas used by the transaction ___ diff --git a/docs/interfaces/execresult.md b/docs/interfaces/execresult.md index 7bd2b11b6e..97fbdd91f2 100644 --- a/docs/interfaces/execresult.md +++ b/docs/interfaces/execresult.md @@ -12,13 +12,11 @@ Result of executing a call via the \[\[EVM\]\]. ### Properties -* [exception](execresult.md#exception) * [exceptionError](execresult.md#exceptionerror) * [gas](execresult.md#gas) * [gasRefund](execresult.md#gasrefund) * [gasUsed](execresult.md#gasused) * [logs](execresult.md#logs) -* [return](execresult.md#return) * [returnValue](execresult.md#returnvalue) * [runState](execresult.md#runstate) * [selfdestruct](execresult.md#selfdestruct) @@ -27,24 +25,13 @@ Result of executing a call via the \[\[EVM\]\]. ## Properties - - -### exception - -**● exception**: *`IsException`* - -*Defined in [evm/evm.ts:53](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L53)* - -`0` if the contract encountered an exception, `1` otherwise - -___ ### `` exceptionError -**● exceptionError**: *[VmError](../classes/vmerror.md) \| [ERROR](../enums/error.md)* +**● exceptionError**: *[VmError](../classes/vmerror.md)* -*Defined in [evm/evm.ts:57](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L57)* +*Defined in [evm/evm.ts:47](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L47)* Description of the exception, if any occured @@ -55,7 +42,7 @@ ___ **● gas**: *`BN`* -*Defined in [evm/evm.ts:61](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L61)* +*Defined in [evm/evm.ts:51](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L51)* Amount of gas left @@ -66,7 +53,7 @@ ___ **● gasRefund**: *`BN`* -*Defined in [evm/evm.ts:81](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L81)* +*Defined in [evm/evm.ts:67](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L67)* Amount of gas to refund from deleting storage values @@ -77,7 +64,7 @@ ___ **● gasUsed**: *`BN`* -*Defined in [evm/evm.ts:65](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L65)* +*Defined in [evm/evm.ts:55](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L55)* Amount of gas the code used to run @@ -88,31 +75,20 @@ ___ **● logs**: *`any`[]* -*Defined in [evm/evm.ts:73](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L73)* +*Defined in [evm/evm.ts:63](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L63)* Array of logs that the contract emitted -___ - - -### return - -**● return**: *`Buffer`* - -*Defined in [evm/evm.ts:69](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L69)* - -Return value from the contract - ___ -### `` returnValue +### returnValue **● returnValue**: *`Buffer`* -*Defined in [evm/evm.ts:77](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L77)* +*Defined in [evm/evm.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L59)* -Value returned by the contract +Return value from the contract ___ @@ -121,7 +97,7 @@ ___ **● runState**: *`RunState`* -*Defined in [evm/evm.ts:49](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L49)* +*Defined in [evm/evm.ts:43](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L43)* ___ @@ -130,7 +106,7 @@ ___ **● selfdestruct**: *`undefined` \| `object`* -*Defined in [evm/evm.ts:85](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L85)* +*Defined in [evm/evm.ts:71](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L71)* A map from the accounts that have self-destructed to the addresses to send their funds to diff --git a/docs/interfaces/newcontractevent.md b/docs/interfaces/newcontractevent.md new file mode 100644 index 0000000000..bf9a9db6a8 --- /dev/null +++ b/docs/interfaces/newcontractevent.md @@ -0,0 +1,38 @@ +[ethereumjs-vm](../README.md) > [NewContractEvent](../interfaces/newcontractevent.md) + +# Interface: NewContractEvent + +## Hierarchy + +**NewContractEvent** + +## Index + +### Properties + +* [address](newcontractevent.md#address) +* [code](newcontractevent.md#code) + +--- + +## Properties + + + +### address + +**● address**: *`Buffer`* + +*Defined in [evm/evm.ts:75](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L75)* + +___ + + +### code + +**● code**: *`Buffer`* + +*Defined in [evm/evm.ts:77](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L77)* + +___ + diff --git a/docs/interfaces/runblockopts.md b/docs/interfaces/runblockopts.md index d5a934ede2..d35277b72f 100644 --- a/docs/interfaces/runblockopts.md +++ b/docs/interfaces/runblockopts.md @@ -27,7 +27,7 @@ Options for running a block. **● block**: *`any`* -*Defined in [runBlock.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L18)* +*Defined in [runBlock.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L18)* The [`Block`](https://github.com/ethereumjs/ethereumjs-block) to process @@ -38,7 +38,7 @@ ___ **● generate**: *`undefined` \| `false` \| `true`* -*Defined in [runBlock.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L27)* +*Defined in [runBlock.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L27)* Whether to generate the stateRoot. If false `runBlock` will check the stateRoot of the block against the Trie @@ -49,7 +49,7 @@ ___ **● root**: *`Buffer`* -*Defined in [runBlock.ts:22](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L22)* +*Defined in [runBlock.ts:22](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L22)* Root of the state trie @@ -60,7 +60,7 @@ ___ **● skipBlockValidation**: *`undefined` \| `false` \| `true`* -*Defined in [runBlock.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L31)* +*Defined in [runBlock.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L31)* If true, will skip block validation diff --git a/docs/interfaces/runblockresult.md b/docs/interfaces/runblockresult.md index 7cf0c78dc3..0de1de9d27 100644 --- a/docs/interfaces/runblockresult.md +++ b/docs/interfaces/runblockresult.md @@ -25,7 +25,7 @@ Result of [runBlock](../classes/vm.md#runblock) **● receipts**: *[TxReceipt](txreceipt.md)[]* -*Defined in [runBlock.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L41)* +*Defined in [runBlock.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L41)* Receipts generated for transactions in the block @@ -36,7 +36,7 @@ ___ **● results**: *[RunTxResult](runtxresult.md)[]* -*Defined in [runBlock.ts:45](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L45)* +*Defined in [runBlock.ts:45](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L45)* Results of executing the transactions in the block diff --git a/docs/interfaces/runcallopts.md b/docs/interfaces/runcallopts.md index bbc72d88f2..f8f8d6dcab 100644 --- a/docs/interfaces/runcallopts.md +++ b/docs/interfaces/runcallopts.md @@ -38,7 +38,7 @@ Options for running a call (or create) operation **● block**: *`any`* -*Defined in [runCall.ts:13](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L13)* +*Defined in [runCall.ts:13](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L13)* ___ @@ -47,7 +47,7 @@ ___ **● caller**: *`Buffer`* -*Defined in [runCall.ts:16](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L16)* +*Defined in [runCall.ts:16](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L16)* ___ @@ -56,7 +56,7 @@ ___ **● code**: *`Buffer`* -*Defined in [runCall.ts:24](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L24)* +*Defined in [runCall.ts:24](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L24)* This is for CALLCODE where the code to load is different than the code from the to account @@ -67,7 +67,7 @@ ___ **● compiled**: *`undefined` \| `false` \| `true`* -*Defined in [runCall.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L26)* +*Defined in [runCall.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L26)* ___ @@ -76,7 +76,7 @@ ___ **● data**: *`Buffer`* -*Defined in [runCall.ts:20](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L20)* +*Defined in [runCall.ts:20](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L20)* ___ @@ -85,7 +85,7 @@ ___ **● delegatecall**: *`undefined` \| `false` \| `true`* -*Defined in [runCall.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L30)* +*Defined in [runCall.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L30)* ___ @@ -94,7 +94,7 @@ ___ **● depth**: *`undefined` \| `number`* -*Defined in [runCall.ts:25](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L25)* +*Defined in [runCall.ts:25](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L25)* ___ @@ -103,7 +103,7 @@ ___ **● gasLimit**: *`Buffer`* -*Defined in [runCall.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L17)* +*Defined in [runCall.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L17)* ___ @@ -112,7 +112,7 @@ ___ **● gasPrice**: *`Buffer`* -*Defined in [runCall.ts:14](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L14)* +*Defined in [runCall.ts:14](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L14)* ___ @@ -121,7 +121,7 @@ ___ **● origin**: *`Buffer`* -*Defined in [runCall.ts:15](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L15)* +*Defined in [runCall.ts:15](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L15)* ___ @@ -130,7 +130,7 @@ ___ **● salt**: *`Buffer`* -*Defined in [runCall.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L28)* +*Defined in [runCall.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L28)* ___ @@ -139,7 +139,7 @@ ___ **● selfdestruct**: *`undefined` \| `object`* -*Defined in [runCall.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L29)* +*Defined in [runCall.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L29)* ___ @@ -148,7 +148,7 @@ ___ **● static**: *`undefined` \| `false` \| `true`* -*Defined in [runCall.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L27)* +*Defined in [runCall.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L27)* ___ @@ -157,7 +157,7 @@ ___ **● to**: *`Buffer`* -*Defined in [runCall.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L18)* +*Defined in [runCall.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L18)* ___ @@ -166,7 +166,7 @@ ___ **● value**: *`Buffer`* -*Defined in [runCall.ts:19](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCall.ts#L19)* +*Defined in [runCall.ts:19](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCall.ts#L19)* ___ diff --git a/docs/interfaces/runcodeopts.md b/docs/interfaces/runcodeopts.md index c3952c5174..b774dd98b3 100644 --- a/docs/interfaces/runcodeopts.md +++ b/docs/interfaces/runcodeopts.md @@ -39,7 +39,7 @@ Options for the [runCode](../classes/vm.md#runcode) method. **● address**: *`Buffer`* -*Defined in [runCode.ts:63](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L63)* +*Defined in [runCode.ts:63](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L63)* The address of the account that is executing this code. The address should be a `Buffer` of bytes. Defaults to `0` @@ -50,7 +50,7 @@ ___ **● block**: *`any`* -*Defined in [runCode.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L28)* +*Defined in [runCode.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L28)* The [`Block`](https://github.com/ethereumjs/ethereumjs-block) the `tx` belongs to. If omitted a blank block will be used @@ -61,7 +61,7 @@ ___ **● caller**: *`Buffer`* -*Defined in [runCode.ts:40](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L40)* +*Defined in [runCode.ts:40](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L40)* The address that ran this code. The address should be a `Buffer` of 20bits. Defaults to `0` @@ -72,7 +72,7 @@ ___ **● code**: *`Buffer`* -*Defined in [runCode.ts:44](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L44)* +*Defined in [runCode.ts:44](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L44)* The EVM code to run @@ -83,7 +83,7 @@ ___ **● data**: *`Buffer`* -*Defined in [runCode.ts:48](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L48)* +*Defined in [runCode.ts:48](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L48)* The input data @@ -94,7 +94,7 @@ ___ **● depth**: *`undefined` \| `number`* -*Defined in [runCode.ts:57](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L57)* +*Defined in [runCode.ts:57](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L57)* ___ @@ -103,7 +103,7 @@ ___ **● evm**: *`EVM`* -*Defined in [runCode.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L29)* +*Defined in [runCode.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L29)* ___ @@ -112,7 +112,7 @@ ___ **● gasLimit**: *`Buffer`* -*Defined in [runCode.ts:52](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L52)* +*Defined in [runCode.ts:52](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L52)* Gas limit @@ -123,7 +123,7 @@ ___ **● gasPrice**: *`Buffer`* -*Defined in [runCode.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L31)* +*Defined in [runCode.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L31)* ___ @@ -132,7 +132,7 @@ ___ **● isStatic**: *`undefined` \| `false` \| `true`* -*Defined in [runCode.ts:58](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L58)* +*Defined in [runCode.ts:58](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L58)* ___ @@ -141,7 +141,7 @@ ___ **● message**: *`Message`* -*Defined in [runCode.ts:36](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L36)* +*Defined in [runCode.ts:36](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L36)* ___ @@ -150,7 +150,7 @@ ___ **● origin**: *`Buffer`* -*Defined in [runCode.ts:35](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L35)* +*Defined in [runCode.ts:35](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L35)* The address where the call originated from. The address should be a `Buffer` of 20bits. Defaults to `0` @@ -161,7 +161,7 @@ ___ **● pc**: *`undefined` \| `number`* -*Defined in [runCode.ts:67](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L67)* +*Defined in [runCode.ts:67](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L67)* The initial program counter. Defaults to `0` @@ -172,7 +172,7 @@ ___ **● selfdestruct**: *`undefined` \| `object`* -*Defined in [runCode.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L59)* +*Defined in [runCode.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L59)* ___ @@ -181,7 +181,7 @@ ___ **● txContext**: *`TxContext`* -*Defined in [runCode.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L30)* +*Defined in [runCode.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L30)* ___ @@ -190,7 +190,7 @@ ___ **● value**: *`Buffer`* -*Defined in [runCode.ts:56](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runCode.ts#L56)* +*Defined in [runCode.ts:56](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runCode.ts#L56)* The value in ether that is being sent to `opt.address`. Defaults to `0` diff --git a/docs/interfaces/runtxopts.md b/docs/interfaces/runtxopts.md index 56f1a2607b..6a2d81a1b6 100644 --- a/docs/interfaces/runtxopts.md +++ b/docs/interfaces/runtxopts.md @@ -27,7 +27,7 @@ Options for the `runTx` method. **● block**: *`any`* -*Defined in [runTx.ts:19](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runTx.ts#L19)* +*Defined in [runTx.ts:20](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runTx.ts#L20)* The block to which the `tx` belongs @@ -38,7 +38,7 @@ ___ **● skipBalance**: *`undefined` \| `false` \| `true`* -*Defined in [runTx.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runTx.ts#L31)* +*Defined in [runTx.ts:32](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runTx.ts#L32)* If true, skips the balance check @@ -49,7 +49,7 @@ ___ **● skipNonce**: *`undefined` \| `false` \| `true`* -*Defined in [runTx.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runTx.ts#L27)* +*Defined in [runTx.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runTx.ts#L28)* If true, skips the nonce check @@ -58,9 +58,9 @@ ___ ### tx -**● tx**: *`any`* +**● tx**: *`Transaction`* -*Defined in [runTx.ts:23](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runTx.ts#L23)* +*Defined in [runTx.ts:24](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runTx.ts#L24)* A [`Transaction`](https://github.com/ethereum/ethereumjs-tx) to run diff --git a/docs/interfaces/runtxresult.md b/docs/interfaces/runtxresult.md index 73dc057bbc..15e6059336 100644 --- a/docs/interfaces/runtxresult.md +++ b/docs/interfaces/runtxresult.md @@ -17,9 +17,9 @@ Execution result of a transaction * [amountSpent](runtxresult.md#amountspent) * [bloom](runtxresult.md#bloom) * [createdAddress](runtxresult.md#createdaddress) +* [execResult](runtxresult.md#execresult) * [gasRefund](runtxresult.md#gasrefund) * [gasUsed](runtxresult.md#gasused) -* [vm](runtxresult.md#vm) --- @@ -31,7 +31,7 @@ Execution result of a transaction **● amountSpent**: *`BN`* -*Defined in [runTx.ts:45](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runTx.ts#L45)* +*Defined in [runTx.ts:46](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runTx.ts#L46)* The amount of ether used by this transaction @@ -42,7 +42,7 @@ ___ **● bloom**: *`Bloom`* -*Defined in [runTx.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runTx.ts#L41)* +*Defined in [runTx.ts:42](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runTx.ts#L42)* Bloom filter resulted from transaction @@ -55,10 +55,23 @@ ___ *Inherited from [EVMResult](evmresult.md).[createdAddress](evmresult.md#createdaddress)* -*Defined in [evm/evm.ts:38](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L38)* +*Defined in [evm/evm.ts:32](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L32)* Address of created account durint transaction, if any +___ + + +### execResult + +**● execResult**: *[ExecResult](execresult.md)* + +*Inherited from [EVMResult](evmresult.md).[execResult](evmresult.md#execresult)* + +*Defined in [evm/evm.ts:36](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L36)* + +Contains the results from running the code, if any, as described in [runCode](../classes/vm.md#runcode) + ___ @@ -66,7 +79,7 @@ ___ **● gasRefund**: *`BN`* -*Defined in [runTx.ts:49](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runTx.ts#L49)* +*Defined in [runTx.ts:50](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runTx.ts#L50)* The amount of gas as that was refunded during the transaction (i.e. `gasUsed = totalGasConsumed - gasRefund`) @@ -79,22 +92,9 @@ ___ *Inherited from [EVMResult](evmresult.md).[gasUsed](evmresult.md#gasused)* -*Defined in [evm/evm.ts:34](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L34)* +*Defined in [evm/evm.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/evm/evm.ts#L28)* Amount of gas used by the transaction ___ - - -### vm - -**● vm**: *[ExecResult](execresult.md)* - -*Inherited from [EVMResult](evmresult.md).[vm](evmresult.md#vm)* - -*Defined in [evm/evm.ts:42](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/evm/evm.ts#L42)* - -Contains the results from running the code, if any, as described in [runCode](../classes/vm.md#runcode) - -___ diff --git a/docs/interfaces/statemanageropts.md b/docs/interfaces/statemanageropts.md index 34446e1469..4bc54fe0cd 100644 --- a/docs/interfaces/statemanageropts.md +++ b/docs/interfaces/statemanageropts.md @@ -25,7 +25,7 @@ Options for constructing a [StateManager](../classes/statemanager.md). **● common**: *`Common`* -*Defined in [state/stateManager.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L26)* +*Defined in [state/stateManager.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L26)* Parameters of the chain ([`Common`](https://github.com/ethereumjs/ethereumjs-common)) @@ -36,7 +36,7 @@ ___ **● trie**: *`any`* -*Defined in [state/stateManager.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/state/stateManager.ts#L30)* +*Defined in [state/stateManager.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/state/stateManager.ts#L30)* A [`merkle-patricia-tree`](https://github.com/ethereumjs/merkle-patricia-tree) instance diff --git a/docs/interfaces/txreceipt.md b/docs/interfaces/txreceipt.md index dc8bade252..f54dc2223b 100644 --- a/docs/interfaces/txreceipt.md +++ b/docs/interfaces/txreceipt.md @@ -27,7 +27,7 @@ Receipt generated for a transaction **● bitvector**: *`Buffer`* -*Defined in [runBlock.ts:63](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L63)* +*Defined in [runBlock.ts:63](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L63)* Bloom bitvector @@ -38,7 +38,7 @@ ___ **● gasUsed**: *`Buffer`* -*Defined in [runBlock.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L59)* +*Defined in [runBlock.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L59)* Gas used @@ -49,7 +49,7 @@ ___ **● logs**: *`any`[]* -*Defined in [runBlock.ts:67](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L67)* +*Defined in [runBlock.ts:67](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L67)* Logs emitted @@ -60,9 +60,9 @@ ___ **● status**: *`0` \| `1`* -*Defined in [runBlock.ts:55](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/runBlock.ts#L55)* +*Defined in [runBlock.ts:55](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/runBlock.ts#L55)* -Status of transaction, `0` if successful, `1` if an exception occured +Status of transaction, `1` if successful, `0` if an exception occured ___ diff --git a/docs/interfaces/vmopts.md b/docs/interfaces/vmopts.md index b0b79fd65c..d1005d9549 100644 --- a/docs/interfaces/vmopts.md +++ b/docs/interfaces/vmopts.md @@ -31,9 +31,13 @@ Options for instantiating a [VM](../classes/vm.md). **● activatePrecompiles**: *`undefined` \| `false` \| `true`* -*Defined in [index.ts:44](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L44)* +*Defined in [index.ts:52](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L52)* -If true, create entries in the state tree for the precompiled contracts +If true, create entries in the state tree for the precompiled contracts, saving some gas the first time each of them is called. + +If this parameter is false, the first call to each of them has to pay an extra 25000 gas for creating the account. + +Setting this to true has the effect of precompiled contracts' gas costs matching mainnet's from the very first call, which is intended for testing networks. ___ @@ -42,7 +46,7 @@ ___ **● allowUnlimitedContractSize**: *`undefined` \| `false` \| `true`* -*Defined in [index.ts:48](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L48)* +*Defined in [index.ts:56](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L56)* 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 @@ -51,9 +55,9 @@ ___ ### `` blockchain -**● blockchain**: *`any`* +**● blockchain**: *`Blockchain`* -*Defined in [index.ts:40](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L40)* +*Defined in [index.ts:41](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L41)* A [blockchain](https://github.com/ethereumjs/ethereumjs-blockchain) object for storing/retrieving blocks @@ -64,7 +68,7 @@ ___ **● chain**: *`undefined` \| `string`* -*Defined in [index.ts:23](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L23)* +*Defined in [index.ts:24](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L24)* The chain the VM operates on @@ -75,7 +79,7 @@ ___ **● common**: *`Common`* -*Defined in [index.ts:49](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L49)* +*Defined in [index.ts:57](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L57)* ___ @@ -84,7 +88,7 @@ ___ **● hardfork**: *`undefined` \| `string`* -*Defined in [index.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L27)* +*Defined in [index.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L28)* Hardfork rules to be used @@ -95,7 +99,7 @@ ___ **● state**: *`any`* -*Defined in [index.ts:36](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L36)* +*Defined in [index.ts:37](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L37)* A [merkle-patricia-tree](https://github.com/ethereumjs/merkle-patricia-tree) instance for the state tree (ignored if stateManager is passed) @@ -108,7 +112,7 @@ ___ **● stateManager**: *[StateManager](../classes/statemanager.md)* -*Defined in [index.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/3e1633c/lib/index.ts#L31)* +*Defined in [index.ts:32](https://github.com/ethereumjs/ethereumjs-vm/blob/439570a/lib/index.ts#L32)* A [StateManager](../classes/statemanager.md) instance to use as the state store (Beta API)