Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into eip4844-tx-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Oct 31, 2022
2 parents fa8e2bd + 5776107 commit 3fe8446
Show file tree
Hide file tree
Showing 83 changed files with 11,012 additions and 5,492 deletions.
13,376 changes: 8,703 additions & 4,673 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions packages/block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ 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.0.1 - 2022-10-18

### Support for Geth genesis.json Genesis Format

For lots of custom chains (for e.g. devnets and testnets), you might come across a [Geth genesis.json config](https://geth.ethereum.org/docs/interface/private-network) which has both config specification for the chain as well as the genesis state specification.

`Common` now has a new constructor `Common.fromGethGenesis()` - see PRs [#2300](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2300) and [#2319](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2319) - which can be used in following manner to instantiate for example a VM run or a tx with a `genesis.json` based Common:

```typescript
import { Common } from '@ethereumjs/common'
// Load geth genesis json file into lets say `genesisJson` and optional `chain` and `genesisHash`
const common = Common.fromGethGenesis(genesisJson, { chain: 'customChain', genesisHash })
// If you don't have `genesisHash` while initiating common, you can later configure common (for e.g.
// calculating it afterwards by using the `@ethereumjs/blockchain` package)
common.setForkHashes(genesisHash)
```

### New RPC and Ethers Static Constructors

Two new static constructos have been added to the library, see PR [#2315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2315) `Block.fromEthersProvider()` allows for an easy instantiation of a `Block` object using an [Ethers](https://ethers.io) provider connecting e.g. to a local node or a service provider like Infura. The `Block.fromRPC()` static constructor can be used for a straight-forward block instantiation if the block data is coming from an RPC request. This static constructor replaces the old standalong `blockFromRPC()` method which is now marked as `deprecated`.

### Other Changes and Fixes

- Adressed several typing issues in the `blockFromRPC()` method, PR [#2302](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2302)

## 4.0.0 - 2022-09-06

Final release - tada 🎉 - of a wider breaking release round on the [EthereumJS monorepo](https://github.com/ethereumjs/ethereumjs-monorepo) libraries, see the Beta 1 release notes for the main long change set description as well as the Beta 2, Beta 3 and Release Candidate (RC) 1 release notes for notes on some additional changes ([CHANGELOG](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/CHANGELOG.md)).
Expand Down
4 changes: 3 additions & 1 deletion packages/block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ npm install @ethereumjs/block

### Introduction

There are three static factories to instantiate a `Block`:
There are five static factories to instantiate a `Block`:

- `Block.fromBlockData(blockData: BlockData = {}, opts?: BlockOptions)`
- `Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)`
- `Block.fromValuesArray(values: BlockBuffer, opts?: BlockOptions)`
- `Block.fromRPC(blockData: JsonRpcBlock, uncles?: any[], opts?: BlockOptions)`
- `Block.fromEthersProvider(provider: ethers.providers.JsonRpcProvider | string, blockTag: string | bigint, opts: BlockOptions)`

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

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": "4.0.0",
"version": "4.0.1",
"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.0",
"@ethereumjs/common": "^3.0.1",
"@ethereumjs/rlp": "^4.0.0",
"@ethereumjs/trie": "^5.0.0",
"@ethereumjs/tx": "^4.0.0",
"@ethereumjs/util": "^8.0.0",
"@ethereumjs/trie": "^5.0.1",
"@ethereumjs/tx": "^4.0.1",
"@ethereumjs/util": "^8.0.2",
"ethereum-cryptography": "^1.1.2",
"ethers": "^5.7.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/block/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export interface JsonHeader {
}

/*
* Based on https://eth.wiki/json-rpc/API
* Based on https://ethereum.org/en/developers/docs/apis/json-rpc/
*/
export interface JsonRpcBlock {
number: string // the block number. null when pending block.
Expand Down
26 changes: 26 additions & 0 deletions packages/blockchain/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@ 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.0.2 - 2022-10-25

- Updated `@ethereumjs/util` minimal package version to `v8.0.2` to ensure functioning of the library (otherwise the newly exported `Lock` functionality might be missing)

## 6.0.1 - 2022-10-18

### Support for Geth genesis.json Genesis Format

For lots of custom chains (for e.g. devnets and testnets), you might come across a [Geth genesis.json config](https://geth.ethereum.org/docs/interface/private-network) which has both config specification for the chain as well as the genesis state specification.

`Common` now has a new constructor `Common.fromGethGenesis()` - see PRs [#2300](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2300) and [#2319](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2319) - which can be used in following manner to instantiate for example a VM run or a tx with a `genesis.json` based Common:

```typescript
import { Common } from '@ethereumjs/common'
// Load geth genesis json file into lets say `genesisJson` and optional `chain` and `genesisHash`
const common = Common.fromGethGenesis(genesisJson, { chain: 'customChain', genesisHash })
// If you don't have `genesisHash` while initiating common, you can later configure common (for e.g.
// calculating it afterwards by using the `@ethereumjs/blockchain` package)
common.setForkHashes(genesisHash)
```

### Other Changes and Fixes

- New `releaseLockOnCallback` parameter for blockchain iterator (`Blockchain.iterator()` to allow for not locking the blockchain for running the callback (default: `false`), PR [#2308](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2308)
- Fixed reorg handling for blockchain iterator (`Blockchain.iterator()`), PR [#2308](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2308)

## 6.0.0 - 2022-09-06

Final release - tada 🎉 - of a wider breaking release round on the [EthereumJS monorepo](https://github.com/ethereumjs/ethereumjs-monorepo) libraries, see the Beta 1 release notes for the main long change set description as well as the Beta 2, Beta 3 and Release Candidate (RC) 1 release notes for notes on some additional changes ([CHANGELOG](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/CHANGELOG.md)).
Expand Down
12 changes: 6 additions & 6 deletions packages/blockchain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereumjs/blockchain",
"version": "6.0.0",
"version": "6.0.2",
"description": "A module to store and interact with blocks",
"keywords": [
"ethereum",
Expand Down Expand Up @@ -38,12 +38,12 @@
"tsc": "../../config/cli/ts-compile.sh"
},
"dependencies": {
"@ethereumjs/block": "^4.0.0",
"@ethereumjs/common": "^3.0.0",
"@ethereumjs/ethash": "^2.0.0",
"@ethereumjs/block": "^4.0.1",
"@ethereumjs/common": "^3.0.1",
"@ethereumjs/ethash": "^2.0.1",
"@ethereumjs/rlp": "^4.0.0",
"@ethereumjs/trie": "^5.0.0",
"@ethereumjs/util": "^8.0.0",
"@ethereumjs/trie": "^5.0.1",
"@ethereumjs/util": "^8.0.2",
"abstract-level": "^1.0.3",
"debug": "^4.3.3",
"ethereum-cryptography": "^1.1.2",
Expand Down
1 change: 1 addition & 0 deletions packages/blockchain/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ export class Blockchain implements BlockchainInterface {
* @param name - Name of the state root head
* @param onBlock - Function called on each block with params (block, reorg)
* @param maxBlocks - How many blocks to run. By default, run all unprocessed blocks in the canonical chain.
* @param releaseLockOnCallback - Do not lock the blockchain for running the callback (default: `false`)
* @returns number of blocks actually iterated
*/
async iterator(
Expand Down
12 changes: 12 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ 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).

## 0.6.5 - 2022-10-19

- Fixes broken release v0.6.4 (wrong @ethereumjs/util dependency)

## 0.6.4 - 2022-10-18

[ BROKEN] (wrong @ethereumjs/util dependency)

- Fixed reorg handling in the underlying `@ethereumjs/blockchain` library `iterator()` function, PR [#2308](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2308)
- Fixed a bug leading to exclusion of subsequent transactions build on top of previous ones, PR [#2333](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2333)
- Fixed a bug in the `eth_estimateGas` RPC call where the parameter logic was being applied to an optional parameter when the optional parameter didn't exist, PR [#2358](https://github.com/ethereumjs/ethereumjs-monorepo/pull/2358)

## 0.6.3 - 2022-09-06

This is the official Merge-ready release for the EthereumJS client! 🎉 Note that it is not possible yet to run EthereumJS client on mainnet though. This release nevertheless implements all final Merge specifications and includes Merge-related configuration parameters and is ready for current (`Sepolia`) and future Merge related testnets and development networks.
Expand Down
6 changes: 3 additions & 3 deletions packages/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ See also this [diagram](./diagram/client.svg) for an overview of the client stru

### Overview

You can expose a [JSON-RPC](https://eth.wiki/json-rpc/API) interface along a client run with:
You can expose a [JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/) interface along a client run with:

```shell
ethereumjs --rpc
Expand All @@ -207,7 +207,7 @@ contribution on the project *hint\* _hint_. 😄
### API Examples

You can use `cURL` to request data from an API endpoint. Here is a simple example for
[web3_clientVersion](https://eth.wiki/json-rpc/API#web3_clientversion):
[web3_clientVersion](https://ethereum.org/en/developers/docs/apis/json-rpc/#web3_clientversion):

```shell
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","id":1,"method":"web3_clientVersion", "params": []}' http://localhost:8545
Expand Down Expand Up @@ -235,7 +235,7 @@ This will give you an output like the following:
```

Here's an example for a call on an endpoint with the need for parameters. The following call uses
the [eth_getBlockByNumer](https://eth.wiki/json-rpc/API#eth_getblockbynumber) endpoint
the [eth_getBlockByNumer](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) endpoint
to request data for block number 436 (you can use a tool like
[RapidTables](https://www.rapidtables.com/convert/number/decimal-to-hex.html) for conversion to `hex`):

Expand Down
8 changes: 8 additions & 0 deletions packages/client/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ export interface ConfigOptions {
*/
maxFetcherJobs?: number

/**
* Max outgoing multi-peer requests by the fetcher at any given time
*/
maxFetcherRequests?: number

/**
* Number of peers needed before syncing
*
Expand Down Expand Up @@ -262,6 +267,7 @@ export class Config {
public static readonly PORT_DEFAULT = 30303
public static readonly MAXPERREQUEST_DEFAULT = 50
public static readonly MAXFETCHERJOBS_DEFAULT = 100
public static readonly MAXFETCHERREQUESTS_DEFAULT = 5
public static readonly MINPEERS_DEFAULT = 1
public static readonly MAXPEERS_DEFAULT = 25
public static readonly DNSADDR_DEFAULT = '8.8.8.8'
Expand All @@ -285,6 +291,7 @@ export class Config {
public readonly txLookupLimit: number
public readonly maxPerRequest: number
public readonly maxFetcherJobs: number
public readonly maxFetcherRequests: number
public readonly minPeers: number
public readonly maxPeers: number
public readonly dnsAddr: string
Expand Down Expand Up @@ -330,6 +337,7 @@ export class Config {
this.txLookupLimit = options.txLookupLimit ?? 2350000
this.maxPerRequest = options.maxPerRequest ?? Config.MAXPERREQUEST_DEFAULT
this.maxFetcherJobs = options.maxFetcherJobs ?? Config.MAXFETCHERJOBS_DEFAULT
this.maxFetcherRequests = options.maxPerRequest ?? Config.MAXFETCHERREQUESTS_DEFAULT
this.minPeers = options.minPeers ?? Config.MINPEERS_DEFAULT
this.maxPeers = options.maxPeers ?? Config.MAXPEERS_DEFAULT
this.dnsAddr = options.dnsAddr ?? Config.DNSADDR_DEFAULT
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/execution/receipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class ReceiptsManager extends MetaDBManager {
logs = logs.filter((l) => addresses.some((a) => a.equals(l.log[0])))
}
if (topics.length > 0) {
// From https://eth.wiki/json-rpc/API:
// From https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter/:
// Topics are order-dependent. A transaction with a log with topics
// [A, B] will be matched by the following topic filters:
// * [] - anything
Expand Down
Loading

0 comments on commit 3fe8446

Please sign in to comment.