Skip to content

Commit

Permalink
util, ethash, common, tx, block, blockchain, devp2p, vm: Client prepa…
Browse files Browse the repository at this point in the history
…ring Releases (#1491)

* ethash -> miner: made solution property public

* util: bumped version to v7.1.1, added CHANGELOG entry, updated upstream dependency versions

* monorepo: updated package-lock.json

* util -> release: rebuild documentation

* common -> release: bumped version to v2.5.0, added CHANGELOG entry, updated README, updated upstream dependency versions

* monorepo: updated package-lock.json, updated typedoc dev dependency from 0.21.5 to 0.22.4

* common -> release: rebuild documentation

* tx -> release: bumped version to v3.3.1, added CHANGELOG entry, updated upstream dependency versions

* tx -> release: rebuild documentation

* block -> release: bumped version to v3.5.0, added CHANGELOG entry, updated README, updated upstream dependency versions

* ethash -> release: bumped version to v1.1.0, added CHANGELOG entry, updated README, updated upstream dependency versions

* ethash -> release: build documentation, replaced manual API docs with auto-generated documentation

* monorepo: updated package-lock.json

* blockchain -> release: bumped version to v5.4.1, added CHANGELOG entry, updated upstream dependency versions

* blockchain -> release: rebuild documentation

* devp2p -> release: bumped version to v4.2.0, added CHANGELOG entry, updated upstream dependency versions

* vm -> release: bumped version to v5.5.3, added CHANGELOG entry, updated upstream dependency versions

* monorepo: updated package-lock.json

* Apply suggestions from code review

* add tiny fixes from #905

* Update packages/util/CHANGELOG.md

Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>

* from tiny fixes issue: add calcNextBaseFee() example to block README

* fix typos (preceeding -> preceding, analogue -> analog for american english variant)

* from tiny fixes: remove old reference to node-devp2p, update latest implementations to eth/66 and les/4

Co-authored-by: Ryan Ghods <ryan@ryanio.com>
Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 27, 2021
1 parent 36d4a06 commit cf95e04
Show file tree
Hide file tree
Showing 124 changed files with 10,157 additions and 12,049 deletions.
File renamed without changes.
23 changes: 0 additions & 23 deletions .github/labeler.yml

This file was deleted.

6,802 changes: 2,769 additions & 4,033 deletions package-lock.json

Large diffs are not rendered by default.

49 changes: 45 additions & 4 deletions packages/block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,40 @@ 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).

## 3.5.0 - 2021-09-24

### Experimental Merge/PoS Support

This release comes with experimental support for the Merge HF as defined in [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675) respectively support for creating PoS compatible `Block` objects (from an Eth 1.0 perspective).

#### PoS Block Instantiation

Proof-of-Stake compatible execution blocks come with its own set of header field simplifications and associated validation rules. The difficuly is set to `0` since not relevant any more, just to name an example. For a full list of changes see `EIP-3675`.

You can instantiate a Merge/PoS block like this:

```typescript
import { Block } from '@ethereumjs/block'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Merge, })
const block = Block.fromBlockData({
// Provide your block data here or use default values
}, { common })
```

See: PR [#1393](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1393) and PR [#1408](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1393)

#### Set Hardfork by Total Difficulty

There is a new `hardforkByTD` option which expands the current `hardforkByBlockNumber` option and allows for setting the hardfork either by total difficulty or a `Common`-matching block number. The supportive functionality within the `Common` library has been introduced along the `v2.5.0` release.

See. PR [#1473](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1473)

### Other Changes

- The hash from the `block.hash()` method now gets cached for blocks created with the `freeze` option (activated by default), PR [#1445](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1445)


## 3.4.0 - 2021-07-08

### Finalized London HF Support
Expand All @@ -28,15 +62,22 @@ Source files from the `src` folder are now included in the distribution build, s
This `Block` release comes with full functional support for the `london` hardfork (all EIPs are finalized and integrated and `london` HF can be activated, there are no final block numbers for the HF integrated though yet). Please note that the default HF is still set to `istanbul`. You therefore need to explicitly set the `hardfork` parameter for instantiating a `Common` instance with a `london` HF activated:

```typescript
import { Block } from 'ethereumjs-block'
import { BN } from 'ethereumjs-util'
import { Block } from '@ethereumjs/block'
import Common from '@ethereumjs/common'
const common = new Common({ chain: 'mainnet', hardfork: 'london' })

const block = Block.fromBlockData({
header: {
//...,
baseFeePerGas: new BN(10),
gasLimit: new BN(100),
gasUsed: new BN(60)
}
}, { common })

// Base fee will increase for next block since the
// gas used is greater than half the gas limit
block.header.calcNextBaseFee().toNumber() // 11
```

#### EIP-1559: Fee market change for ETH 1.0 chain
Expand Down Expand Up @@ -204,7 +245,7 @@ Generally internal types representing block header values are now closer to thei

**Block Class**

There are analogue new static factories for the `Block` class:
There are analog new static factories for the `Block` class:

- `Block.fromBlockData(blockData: BlockData = {}, opts?: BlockOptions)`
- `Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)`
Expand Down Expand Up @@ -413,7 +454,7 @@ Generally internal types representing block header values are now closer to thei

**Block Class**

There are analogue new static factories for the `Block` class:
There are analog new static factories for the `Block` class:

- `Block.fromBlockData(blockData: BlockData = {}, opts?: BlockOptions)`
- `Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)`
Expand Down
32 changes: 28 additions & 4 deletions packages/block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| Implements schema and functions related to Ethereum's block. |
| --- |

Note: this `README` reflects the state of the library from `v3.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-block) for an introduction on the last preceeding release.
Note: this `README` reflects the state of the library from `v3.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-block) for an introduction on the last preceding release.

# INSTALL

Expand All @@ -25,7 +25,7 @@ There are three static factories to instantiate a `Block`:
- `Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)`
- `Block.fromValuesArray(values: BlockBuffer, opts?: BlockOptions)`

For `BlockHeader` instantiation analogue factory methods exists, see API docs linked below.
For `BlockHeader` instantiation analog factory methods exists, see API docs linked below.

Instantiation Example:

Expand Down Expand Up @@ -62,15 +62,22 @@ This library supports the creation of [EIP-1559](https://eips.ethereum.org/EIPS/
To instantiate an EIP-1559 block the hardfork parameter on the `Common` instance needs to be explicitly set to `london` (default is still `istanbul`):

```typescript
import { Block } from 'ethereumjs-block'
import { BN } from 'ethereumjs-util'
import { Block } from '@ethereumjs/block'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London })

const block = Block.fromBlockData({
header: {
//...,
baseFeePerGas: new BN(10),
gasLimit: new BN(100),
gasUsed: new BN(60)
}
}, { common })

// Base fee will increase for next block since the
// gas used is greater than half the gas limit
block.header.calcNextBaseFee().toNumber() // 11
```

EIP-1559 blocks have an extra `baseFeePerGas` field (default: `new BN(7)`) and can encompass `FeeMarketEIP1559Transaction` txs (type `2`) (supported by `@ethereumjs/tx` `v3.2.0` or higher) as well as `Transaction` legacy txs (internal type `0`) and `AccessListEIP2930Transaction` txs (type `1`).
Expand Down Expand Up @@ -131,6 +138,23 @@ Additionally there are the following utility methods for Clique/PoA related func

See the API docs for detailed documentation. Note that these methods will throw if called in a non-Clique/PoA context.

### Casper/PoS (since v3.5.0) (experimental)

Merge-friendly Casper/PoS blocks have been introduced along with the `v3.5.0` release. Proof-of-Stake compatible execution blocks come with their own set of header field simplifications and associated validation rules. The difficulty is set to `0` since not relevant anymore, just to name an example. For a full list of changes see [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675).

You can instantiate a Merge/PoS block like this:

```typescript
import { Block } from '@ethereumjs/block'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Merge, })
const block = Block.fromBlockData({
// Provide your block data here or use default values
}, { common })
```

Note that all `Merge` respectively `Casper/PoS` related functionality is still considered `experimental`.

# API

[Documentation](./docs/README.md)
Expand Down
10 changes: 5 additions & 5 deletions packages/block/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereumjs/block",
"version": "3.4.0",
"version": "3.5.0",
"description": "Provides Block serialization and help functions",
"license": "MPL-2.0",
"author": "mjbecze (mb@ethdev.com)",
Expand Down Expand Up @@ -35,10 +35,10 @@
"test:browser": "karma start karma.conf.js"
},
"dependencies": {
"@ethereumjs/common": "^2.4.0",
"@ethereumjs/common": "^2.5.0",
"merkle-patricia-tree": "^4.2.1",
"@ethereumjs/tx": "^3.3.0",
"ethereumjs-util": "^7.1.0"
"@ethereumjs/tx": "^3.3.1",
"ethereumjs-util": "^7.1.1"
},
"devDependencies": {
"@types/lru-cache": "^5.1.0",
Expand All @@ -53,7 +53,7 @@
"nyc": "^14.0.0",
"prettier": "^2.0.5",
"tape": "^5.3.1",
"typedoc": "^0.21.5",
"typedoc": "^0.22.4",
"ts-node": "^10.2.1",
"typescript": "^4.4.2"
},
Expand Down
21 changes: 17 additions & 4 deletions packages/blockchain/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,27 @@ 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).

## 5.4.1 - 2021-09-24

# 5.4.0 - 2021-07-08
### Experimental Casper/PoS and Merge Support

This release adds first experimental Casper/PoS respectively Merge HF support by allowing to build a blockchain which switches to Casper/PoS consensus validation at some point triggered by a merge HF occurred. The `Blockchain` library now allows for taking in the respective Casper/PoS conforming blocks (see `@ethereumjs/block` release v3.5.0), do the correct validations and set the HF accordingly (Merge HF-related logic and a new PoS consensus type have been added to the `Common` library along with the v2.5.0 release).

See: PR [#1408](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1408)

### Other Changes

- Added new `Blockchain.cliqueSignerInTurn()` method, PR [#1444](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1444)
- Added new `Blockchain.copy()` method, PR [#1444](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1444)
- Added browser tests, PR [#1380](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1380)

## 5.4.0 - 2021-07-08

### Finalized London HF Support

This release integrates a `Common` library version which provides the `london` HF blocks for all networks including `mainnet` and is therefore the first release with finalized London HF support.

# 5.3.1 - 2021-06-25
## 5.3.1 - 2021-06-25

### PoA Reorg Fix

Expand Down Expand Up @@ -104,7 +117,7 @@ npm i @ethereumjs/blockchain

### Library Promisification

The `Blockchain` library has been promisified and callbacks have been removed along PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceeding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779).
The `Blockchain` library has been promisified and callbacks have been removed along PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779).

Old API example:

Expand Down Expand Up @@ -236,7 +249,7 @@ npm i @ethereumjs/blockchain
### Library Promisification

The `Blockchain` library has been promisified and callbacks have been removed along
PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceeding PR
PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceding PR
[#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779).

Old API example:
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| A module to store and interact with blocks. |
| --- |

Note: this `README` reflects the state of the library from `v5.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-blockchain) for an introduction on the last preceeding release.
Note: this `README` reflects the state of the library from `v5.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-blockchain) for an introduction on the last preceding release.

# INSTALL

Expand Down
1 change: 1 addition & 0 deletions packages/blockchain/docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
4 changes: 2 additions & 2 deletions packages/blockchain/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

### Interfaces

- [BlockchainInterface](interfaces/blockchaininterface.md)
- [BlockchainOptions](interfaces/blockchainoptions.md)
- [BlockchainInterface](interfaces/BlockchainInterface.md)
- [BlockchainOptions](interfaces/BlockchainOptions.md)
Loading

0 comments on commit cf95e04

Please sign in to comment.