diff --git a/packages/block/CHANGELOG.md b/packages/block/CHANGELOG.md index a60f6c4da1a..1e44228151b 100644 --- a/packages/block/CHANGELOG.md +++ b/packages/block/CHANGELOG.md @@ -6,6 +6,51 @@ 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 block tx including blocks 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] }) +``` + +The underlying `@ethereumjs/tx` library 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' +``` + +### 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) + ## 4.1.0 - 2022-12-09 ### Experimental EIP-4895 Beacon Chain Withdrawals Support diff --git a/packages/block/README.md b/packages/block/README.md index f12f43747d3..24c9ab3ec9c 100644 --- a/packages/block/README.md +++ b/packages/block/README.md @@ -139,6 +139,32 @@ 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 block tx including blocks 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] }) +``` + +The underlying `@ethereumjs/tx` library 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' +``` + ### 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). diff --git a/packages/block/package.json b/packages/block/package.json index f498cdba974..328155a4b59 100644 --- a/packages/block/package.json +++ b/packages/block/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/block", - "version": "4.1.0", + "version": "4.2.0", "description": "Provides Block serialization and help functions", "keywords": [ "ethereum", diff --git a/packages/blockchain/package.json b/packages/blockchain/package.json index 6219c3e3b04..769c819120e 100644 --- a/packages/blockchain/package.json +++ b/packages/blockchain/package.json @@ -38,7 +38,7 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^4.1.0", + "@ethereumjs/block": "^4.2.0", "@ethereumjs/common": "^3.1.0", "@ethereumjs/ethash": "^2.0.3", "@ethereumjs/rlp": "^4.0.1", diff --git a/packages/client/package.json b/packages/client/package.json index 4d0d5baf970..d20a9df3998 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -56,7 +56,7 @@ }, "dependencies": { "@chainsafe/libp2p-noise": "^4.1.1", - "@ethereumjs/block": "4.1.0", + "@ethereumjs/block": "4.2.0", "@ethereumjs/blockchain": "6.2.0", "@ethereumjs/common": "3.1.0", "@ethereumjs/devp2p": "5.1.0", diff --git a/packages/devp2p/package.json b/packages/devp2p/package.json index fe572cbffb4..a16d1775e29 100644 --- a/packages/devp2p/package.json +++ b/packages/devp2p/package.json @@ -68,7 +68,7 @@ "snappyjs": "^0.6.1" }, "devDependencies": { - "@ethereumjs/block": "^4.1.0", + "@ethereumjs/block": "^4.2.0", "@ethereumjs/tx": "^4.1.0", "@types/chalk": "^2.2.0", "@types/debug": "^4.1.4", diff --git a/packages/ethash/package.json b/packages/ethash/package.json index 7b76beb5ddd..bf9c739d8f2 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -36,7 +36,7 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^4.1.0", + "@ethereumjs/block": "^4.2.0", "@ethereumjs/rlp": "^4.0.1", "@ethereumjs/util": "^8.0.4", "abstract-level": "^1.0.3", diff --git a/packages/statemanager/package.json b/packages/statemanager/package.json index 876b2478aae..fc720931a25 100644 --- a/packages/statemanager/package.json +++ b/packages/statemanager/package.json @@ -49,7 +49,7 @@ "js-sdsl": "^4.1.4" }, "devDependencies": { - "@ethereumjs/block": "^4.1.0", + "@ethereumjs/block": "^4.2.0", "@ethereumjs/trie": "^5.0.3", "@ethereumjs/util": "^8.0.4", "@types/node": "^16.11.7", diff --git a/packages/vm/CHANGELOG.md b/packages/vm/CHANGELOG.md index 0652a148cb3..03b9dfbefdc 100644 --- a/packages/vm/CHANGELOG.md +++ b/packages/vm/CHANGELOG.md @@ -36,6 +36,18 @@ 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' +``` + #### 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. diff --git a/packages/vm/package.json b/packages/vm/package.json index b6b6ac14159..5bac5f23f7e 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -56,7 +56,7 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^4.1.0", + "@ethereumjs/block": "^4.2.0", "@ethereumjs/blockchain": "^6.2.0", "@ethereumjs/common": "^3.1.0", "@ethereumjs/evm": "^1.3.0",