Skip to content

Commit

Permalink
New Releases (Shanghai Support, EIP-4844 (experimental), Client Impro…
Browse files Browse the repository at this point in the history
…vements) (#2521)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (RLP v4.0.1)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/util v8.0.4)

* Rebuild documentation (@ethereumjs/util)

* Added withdrawal module to README (@ethereumjs/util)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/trie v5.0.3)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/common v3.0.3)

* Rebuild documentation (@ethereumjs/common)

* Added missing EIPs to README, general updates (@ethereumjs/common)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/statemanager v1.0.3)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/devp2p v5.1.0)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/tx v4.1.0)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/ethash v2.0.3)

* Tx README/CHANGELOG fixes

* Additional fixes

* Even more fixes

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/blockchain v6.2.0)

* Rebuild blockchain documentation

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/evm v1.3.0)

* Rebuild EVM documentation

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/vm v6.4.0)

* Added CHANGELOG entry, version bump, updated upstream dependency versions (@ethereumjs/block v4.2.0)

* Tx libray KZG setup instruction generalization

* Create and consolidate KZG setup instructions within a single source of truth, add references

* Added 4844 and KZG setup instructions and refernces to the Blockchain library

* Fixes

* Bumped client version to v0.7.0, added CHANGELOG entry

* Rebuild package-lock.json

* Update packages/client/CHANGELOG.md

Co-authored-by: acolytec3 <[email protected]>

* Completed CHANGELOG files

* Update packages/util/CHANGELOG.md

* Update packages/client/CHANGELOG.md

---------

Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Gabriel Rocheleau <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2023
1 parent 4aa9753 commit 1a7094d
Show file tree
Hide file tree
Showing 66 changed files with 1,263 additions and 478 deletions.
258 changes: 129 additions & 129 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions packages/block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,42 @@ 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.2.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 })
```

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

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).

#### Initialization

To create blocks which include blob transactions you have to active EIP-4844 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] })
```

**Note:** Working with blob transactions needs a manual KZG library installation and global initialization, see [KZG Setup](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx/README.md#kzg-setup) for instructions.

### Other Changes

- Handle hardfork defaults consistently, PR [#2467](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2467)
- New `generateWithdrawalsSSZRoot()` method, PR [#2488](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2488)
- Allow genesis to be post merge, PR [#2530](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2530)

## 4.1.0 - 2022-12-09

### Experimental EIP-4895 Beacon Chain Withdrawals Support
Expand Down
18 changes: 18 additions & 0 deletions packages/block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ To obtain the latest version, simply require the project using `npm`:
npm install @ethereumjs/block
```

**Note:** If you want to work with `EIP-4844` related functionality, you will have additional manual installation steps for the **KZG setup**, see related section below.

## Usage

### Introduction
Expand Down Expand Up @@ -139,6 +141,22 @@ const block = Block.fromBlockData(

Validation of the withdrawals trie can be manually triggered with the newly introduced async `Block.validateWithdrawalsTrie()` method.

### EIP-4844 Shard Blob Transaction Blocks (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 `v4.2.0`.

#### Initialization

To create blocks which include blob transactions you have to active EIP-4844 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] })
```

**Note:** Working with blob transactions needs a manual KZG library installation and global initialization, see [KZG Setup](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx/README.md#kzg-setup) for instructions.

### Consensus Types

The block library supports the creation as well as consensus format validation of PoW `ethash` and PoA `clique` blocks (so e.g. do specific `extraData` checks on Clique/PoA blocks).
Expand Down
12 changes: 6 additions & 6 deletions packages/block/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereumjs/block",
"version": "4.1.0",
"version": "4.2.0",
"description": "Provides Block serialization and help functions",
"keywords": [
"ethereum",
Expand Down Expand Up @@ -38,11 +38,11 @@
"tsc": "../../config/cli/ts-compile.sh"
},
"dependencies": {
"@ethereumjs/common": "^3.0.2",
"@ethereumjs/rlp": "^4.0.0",
"@ethereumjs/trie": "^5.0.2",
"@ethereumjs/tx": "^4.0.2",
"@ethereumjs/util": "^8.0.3",
"@ethereumjs/common": "^3.1.0",
"@ethereumjs/rlp": "^4.0.1",
"@ethereumjs/trie": "^5.0.3",
"@ethereumjs/tx": "^4.1.0",
"@ethereumjs/util": "^8.0.4",
"ethereum-cryptography": "^1.1.2",
"ethers": "^5.7.1"
},
Expand Down
41 changes: 41 additions & 0 deletions packages/blockchain/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,47 @@ 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.2.0 - 2023-02-21

### 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 })
```

### 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).

The blockchain library now allows for blob transactions to be validated and included in a chain where EIP-4844 activated either by hardfork or standalone EIP (see latest tx library release for additional details).

### Block Interface getBlock() Signature Fix

Always a bit tricky, but we felt that we needed to do this. We had a misalignment of our blockchain implementation of the `Blockchain.getBlock()` method and the definition of the associated interface:

- Blockchain class: `async getBlock(blockId: Buffer | number | bigint): Promise<Block>`
- Blockchain interface: `getBlock(blockId: Buffer | number | bigint): Promise<Block | null>`

So the Blockchain interface was - falsely - claiming that there would be the possibility of a `null` value returned in the case of a block not being found while the actual implementation was throwing an error in such a case.

We now fixed this by removing the `null` from the interface return values - see PR [#2524](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2524), after exploring the other way around as well (and the reverting), see PR [#2516](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2516).

While this might lead to breaking code constallations on the TypeScript level if this `null` value is picked up we felt this is the right thing to do since this divergence would otherwise continue to "trick" people into assuming and dealing with `null` values for non-existing-block assumptions in their code and continue to produce eventual bugs (we actually fell over this ourselves).

A bit on the verge of breaking vs. bug fixing, sorry if you are eventually affected, but we just can't do a single breaking release update for a fix on that level.

### Other Changes

- Timestamp-related `Blockchain.createGenesisBlock()` fix, PR [#2529](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2529)
- Allow genesis to be post merge, PR [#2530](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2530)
- Add extra validations for assuming nil bodies in `getBlock()`, PR [#2534](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2534)

## 6.1.0 - 2022-12-09

### Experimental EIP-4895 Beacon Chain Withdrawals Support
Expand Down
8 changes: 8 additions & 0 deletions packages/blockchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ To obtain the latest version, simply require the project using `npm`:
npm install @ethereumjs/blockchain
```

**Note:** If you want to work with `EIP-4844` related functionality, you will have additional manual installation steps for the **KZG setup**, see related section below.

## Usage

### Introduction
Expand Down Expand Up @@ -104,6 +106,12 @@ The genesis block from the initialized `Blockchain` can be retrieved via the `Bl

This library supports the handling of `EIP-1559` blocks and transactions starting with the `v5.3.0` release.

### 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 `v6.2.0`.

The blockchain library now allows for blob transactions to be validated and included in a chain where EIP-4844 activated either by hardfork or standalone EIP (see latest tx library release for additional details).

## API

### Docs
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Parses the geth genesis state into Blockchain GenesisState

#### Defined in

[utils.ts:8](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/utils.ts#L8)
[utils.ts:9](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/utils.ts#L9)
Loading

0 comments on commit 1a7094d

Please sign in to comment.