Skip to content

Commit

Permalink
Added CHANGELOG entry, version bump, updated upstream dependency vers…
Browse files Browse the repository at this point in the history
…ions (@ethereumjs/vm v6.4.0)
  • Loading branch information
holgerd77 committed Feb 13, 2023
1 parent 9c39a5d commit 4b6179c
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@ethereumjs/trie": "5.0.3",
"@ethereumjs/tx": "4.1.0",
"@ethereumjs/util": "8.0.4",
"@ethereumjs/vm": "6.3.0",
"@ethereumjs/vm": "6.4.0",
"abstract-level": "^1.0.3",
"body-parser": "^1.19.2",
"chalk": "^4.1.2",
Expand Down
26 changes: 26 additions & 0 deletions packages/evm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,32 @@ Currently supported EIPs:
- [EIP-4895](https://eips.ethereum.org/EIPS/eip-4895) - Beacon chain push withdrawals as operations
- [EIP-5133](https://eips.ethereum.org/EIPS/eip-5133) - Delaying Difficulty Bomb to mid-September 2022

### EIP-4844 Shard Blob Transactions Support (experimental)

This library supports an experimental version of the blob transaction type introduced with [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) as being specified in the [01d3209](https://github.com/ethereum/EIPs/commit/01d320998d1d53d95f347b5f43feaf606f230703) EIP version from February 8, 2023 and deployed along `eip4844-devnet-4` (January 2023) starting with `v1.3.0`.

#### Initialization

To run EVM related EIP-4844 functionality you have to active the EIP in the associated `@ethereumjs/common` library:

```typescript
import { Common, Chain, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai, eips: [4844] })
```

EIP-4844 comes with a new opcode `DATAHASH` and adds a new point evaluation precompile at address `0x14`. This precompile needs to have a working `kzg` library installation in the global namespace adhering to the [Kzg](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/depInterfaces.ts) interface defined in the `@ethereumjs/tx` library.

The EthereumJS libraries have been tested with the [c-kzg](https://github.com/ethereum/c-kzg-4844) library which can be installed with `npm install c-kzg`.

This library then needs to be imported along the other library imports:

```typescript
import { Common, Hardfork } from '@ethereumjs/common'
import * as kzg from 'c-kzg'
import { EVM } from '@ethereumjs/evm'
```

### Tracing Events

Our `TypeScript` EVM is implemented as an [AsyncEventEmitter](https://github.com/ahultgren/async-eventemitter) and events are submitted along major execution steps which you can listen to.
Expand Down
43 changes: 43 additions & 0 deletions packages/vm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,49 @@ 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).

## 6.4.0 - 2023-01-16

### Functional Shanghai Support

This release fully supports all EIPs included in the [Shanghai](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md) feature hardfork scheduled for early 2023. Note that a `timestamp` to trigger the `Shanghai` fork update is only added for the `sepolia` testnet and not yet for `goerli` or `mainnet`.

You can instantiate a Shanghai-enabled Common instance for your transactions with:

```typescript
import { Common, Chain, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai })
```

Note: that this is only a finalizing release by e.g. integrating an updated `@ethereumjs/common` library with an updated Shanghai HF setting and all Shanghai related EIP functionality has been already released in former releases. Do a fulltext search on the EIP numbers in the EVM/VM CHANGELOG files for additional information and usage instructions.

### Experimental EIP-4844 Shard Blob Transactions Support

This release supports an experimental version of the blob transaction type introduced with [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) as being specified in the [01d3209](https://github.com/ethereum/EIPs/commit/01d320998d1d53d95f347b5f43feaf606f230703) EIP version from February 8, 2023 and deployed along `eip4844-devnet-4` (January 2023), see PR [#2349](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2349) as well as PRs [#2522](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2522) and [#2526](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2526).

#### Initialization

To run VM/EVM related EIP-4844 functionality you have to active the EIP in the associated `@ethereumjs/common` library:

```typescript
import { Common, Chain, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai, eips: [4844] })
```

#### Shard Blob Transactions and Block Building

The VM is now capable of running blob-including txs and blocks with `VM.runTx()` and `VM.runBlock()` taking the new gas costs for blob transactions into account. The underlying EVM `v1.3.0` now supports the new `DATAHASH` opcode and the new point evaluation precompile.

The Block Builder API (see [README](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/vm)) has been expanded to now also allow for building blocks including shard blob transactions and calculate the correct values for data gas usage.

### Other Changes

- Added `minerValue` as a getter to the `BlockBuilder` and a result value for `RunTxResult`, PR [#2457](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2457)
- New option `skipHardforkValidation` for `VM.runTx()` and `VM.runBlock()`, PR [#2486](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2486)
- **Breaking** (for experimental feature): Changes withdrawal amount representation from WEI to GWEI, see PR [#2483](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2483)
- More flexible logic to execute pre-/post Merge txs with `VM.runTx()` when exact HF is not known, see PR [#2505](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2505)

## 6.3.0 - 2022-12-09

### Experimental EIP-4895 Beacon Chain Withdrawals Support
Expand Down
58 changes: 58 additions & 0 deletions packages/vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ npm install @ethereumjs/vm

## Usage

### Running a Transaction

```typescript
import { Address } from '@ethereumjs/util'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
Expand All @@ -45,6 +47,36 @@ const tx = Transaction.fromTxData({
await vm.runTx({ tx, skipBalance: true })
```

Note that there is an additional API method `VM.runBlock()` which allows to run the whole block and execute all included transactions along.

### Building a Block

The VM package can also be used to construct a new valid block by executing and then integrating txs one-by-one.

The following non-complete example gives some illustration on how to use the Block Builder API:

```typescript
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { VM } from '@ethereumjs/vm'

const common = new Common({ chain: Chain.Mainnet })
const vm = await VM.create({ common })

const blockBuilder = await vm.buildBlock({
parentBlock, // the parent @ethereumjs/block Block
headerData, // header values for the new block
blockOpts: { calcDifficultyFromHeader: parentBlock.header, freeze: false },
})

const tx = Transaction.fromTxData()
await blockBuilder.addTransaction(tx)

// Add more transactions

const block = await blockBuilder.build()
```

## Example

This projects contain the following examples:
Expand Down Expand Up @@ -170,6 +202,32 @@ const vm = new VM({ common })

For a list with supported EIPs see the [@ethereumjs/evm](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/evm) documentation.

### EIP-4844 Shard Blob Transactions Support (experimental)

This library supports an experimental version of the blob transaction type introduced with [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) as being specified in the [01d3209](https://github.com/ethereum/EIPs/commit/01d320998d1d53d95f347b5f43feaf606f230703) EIP version from February 8, 2023 and deployed along `eip4844-devnet-4` (January 2023) starting with `v1.3.0`.

#### Initialization

To run VM/EVM related EIP-4844 functionality you have to active the EIP in the associated `@ethereumjs/common` library:

```typescript
import { Common, Chain, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai, eips: [4844] })
```

EIP-4844 comes with a new opcode `DATAHASH` and adds a new point evaluation precompile at address `0x14` in the underlying `@ethereumjs/evm` package. This precompile needs to have a working `kzg` library installation in the global namespace adhering to the [Kzg](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/depInterfaces.ts) interface defined in the `@ethereumjs/tx` library.

The EthereumJS libraries have been tested with the [c-kzg](https://github.com/ethereum/c-kzg-4844) library which can be installed with `npm install c-kzg`.

This library then needs to be imported along the other library imports:

```typescript
import { Common, Hardfork } from '@ethereumjs/common'
import * as kzg from 'c-kzg'
import { VM } from '@ethereumjs/vm'
```

### Tracing Events

Our `TypeScript` VM is implemented as an [AsyncEventEmitter](https://github.com/ahultgren/async-eventemitter) and events are submitted along major execution steps which you can listen to.
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereumjs/vm",
"version": "6.3.0",
"version": "6.4.0",
"description": "An Ethereum VM implementation",
"keywords": [
"ethereum",
Expand Down

0 comments on commit 4b6179c

Please sign in to comment.