s/foundry-rs/paradigmxyz

This commit is contained in:
Georgios Konstantopoulos
2022-12-07 00:00:45 -08:00
parent dbd7375a1c
commit 4d718bbf33
37 changed files with 76 additions and 76 deletions

View File

@ -11,4 +11,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
Initial release.
<!-- next-url !-->
[Unreleased]: https://github.com/foundry-rs/reth/compare/978527367f159ff3d9f90723e73cf2560c8f54b8...HEAD
[Unreleased]: https://github.com/paradigmxyz/reth/compare/978527367f159ff3d9f90723e73cf2560c8f54b8...HEAD

View File

@ -6,9 +6,9 @@
*The project is still work in progress, see the [disclaimer below](#-warning-under-construction-).*
[![CI status](https://github.com/foundry-rs/reth/workflows/ci/badge.svg)][gh-ci]
[![cargo-deny status](https://github.com/foundry-rs/reth/workflows/deny/badge.svg)][gh-deny]
[![Codecov](https://img.shields.io/codecov/c/github/foundry-rs/reth?token=c24SDcMImE)][codecov]
[![CI status](https://github.com/paradigmxyz/reth/workflows/ci/badge.svg)][gh-ci]
[![cargo-deny status](https://github.com/paradigmxyz/reth/workflows/deny/badge.svg)][gh-deny]
[![Codecov](https://img.shields.io/codecov/c/github/paradigmxyz/reth?token=c24SDcMImE)][codecov]
[![Telegram Chat][tg-badge]][tg-url]
[tg-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=chat&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fparadigm%5Freth
@ -22,7 +22,7 @@ As an full Ethereum node, Reth allows users to connect to the Ethereum network a
More concretely, our goals are:
1. **Modularity**: Every component of Reth is built to be used as a library: well-tested, heavily documented and benchmarked. We envision that developers will import the node's crates, mix and match, and innovate on top of them. Examples of such usage include but are not limited to spinning up standalone P2P networks, talking directly to a node's database, or "unbundling" the node into the components you need. To achieve that, we are licensing Reth under the Apache/MIT permissive license. You can learn more about the project's components [here](./docs/repo/layout.md).
2. **Performance**: Reth aims to be fast, so we used Rust and the [Erigon staged-sync](https://erigon.substack.com/p/erigon-stage-sync-and-control-flows) node architecture. We also use our Ethereum libraries (including [ethers-rs](https://github.com/gakonst/ethers-rs/) and [revm](https://github.com/bluealloy/revm/)) which weve battle-tested and optimized via [Foundry](https://github.com/foundry-rs/foundry/).
2. **Performance**: Reth aims to be fast, so we used Rust and the [Erigon staged-sync](https://erigon.substack.com/p/erigon-stage-sync-and-control-flows) node architecture. We also use our Ethereum libraries (including [ethers-rs](https://github.com/gakonst/ethers-rs/) and [revm](https://github.com/bluealloy/revm/)) which weve battle-tested and optimized via [Foundry](https://github.com/paradigmxyz/foundry/).
3. **Free for anyone to use any way they want**: Reth is free open source software, built for the community, by the community. By licensing the software under the Apache/MIT license, we want developers to use it without being bound by business licenses, or having to think about the implications of GPL-like licenses.
4. **Client Diversity**: The Ethereum protocol becomes more antifragile when no node implementation dominates. This ensures that if there's a software bug, the network does not finalize a bad block. By building a new client, we hope to contribute to Ethereum's antifragility.
5. **Support as many EVM chains as possible**: We aspire that Reth can full-sync not only Ethereum, but also other chains like Optimism, Polygon, Binance Smart Chain, and more. If you're working on any of these projects, please reach out.
@ -42,7 +42,7 @@ The project is not ready for use. We hope to have full sync implemented sometime
Rust minimum required version to build this project is 1.65.0 published 02.11.2022
```sh
git clone https://github.com/foundry-rs/reth
git clone https://github.com/paradigmxyz/reth
cd reth
cargo test --all
```
@ -58,8 +58,8 @@ If you have any questions, first see if the answer to your question can be found
If the answer is not there:
- Join the [Telegram][tg-url] to get help, or
- Open a [discussion](https://github.com/foundry-rs/reth/discussions/new) with your question, or
- Open an issue with [the bug](https://github.com/foundry-rs/reth/issues/new)
- Open a [discussion](https://github.com/paradigmxyz/reth/discussions/new) with your question, or
- Open an issue with [the bug](https://github.com/paradigmxyz/reth/issues/new)
Guidelines on how to contribute can be found in our [`CONTRIBUTING.md`](./CONTRIBUTING.md). Get started with contributing in our [contributor docs](./docs)
@ -74,12 +74,12 @@ Reth is a new implementation of the Ethereum protocol. In the process of develop
None of this would have been possible without them, so big shoutout to the teams below:
* [Geth](https://github.com/ethereum/go-ethereum/): We would like to express our heartfelt gratitude to the go-ethereum team for their outstanding contributions to Ethereum over the years. Their tireless efforts and dedication have helped to shape the Ethereum ecosystem and make it the vibrant and innovative community it is today. Thank you for your hard work and commitment to the project.
* [Erigon](https://github.com/ledgerwatch/erigon) (fka Turbo-Geth): Erigon pioneered the ["Staged Sync" architecture](https://erigon.substack.com/p/erigon-stage-sync-and-control-flows) that Reth is using, as well as [introduced MDBX](https://github.com/ledgerwatch/erigon/wiki/Choice-of-storage-engine) as the database of choice. We thank Erigon for pushing the state of the art research on the performance limits of Ethereum nodes.
* [Akula](https://github.com/akula-bft/akula/): Reth uses forks of the Apache versions of Akula's [MDBX Bindings](https://github.com/foundry-rs/reth/pull/132), [FastRLP](https://github.com/foundry-rs/reth/pull/63) and [ECIES](https://github.com/foundry-rs/reth/pull/80) . Given that these packages were already released under the Apache License, and they implement standardized solutions, we decided not to reimplement them to iterate faster. We thank the Akula team for their contributions to the Rust Ethereum ecosystem and for publishing these packages.
* [Akula](https://github.com/akula-bft/akula/): Reth uses forks of the Apache versions of Akula's [MDBX Bindings](https://github.com/paradigmxyz/reth/pull/132), [FastRLP](https://github.com/paradigmxyz/reth/pull/63) and [ECIES](https://github.com/paradigmxyz/reth/pull/80) . Given that these packages were already released under the Apache License, and they implement standardized solutions, we decided not to reimplement them to iterate faster. We thank the Akula team for their contributions to the Rust Ethereum ecosystem and for publishing these packages.
[codecov]: https://app.codecov.io/gh/foundry-rs/reth
[gh-ci]: https://github.com/foundry-rs/reth/actions/workflows/ci.yml
[gh-deny]: https://github.com/foundry-rs/reth/actions/workflows/deny.yml
[book]: https://foundry-rs.github.io/reth/
[codecov]: https://app.codecov.io/gh/paradigmxyz/reth
[gh-ci]: https://github.com/paradigmxyz/reth/actions/workflows/ci.yml
[gh-deny]: https://github.com/paradigmxyz/reth/actions/workflows/deny.yml
[book]: https://paradigmxyz.github.io/reth/
# 🚧 WARNING: UNDER CONSTRUCTION 🚧

View File

@ -3,7 +3,7 @@ name = "reth"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[dependencies]

View File

@ -7,7 +7,7 @@ title = "Reth Book"
description = "A book on all things Reth"
[output.html]
git-repository-url = "https://github.com/foundry-rs/reth"
git-repository-url = "https://github.com/paradigmxyz/reth"
edit-url-template = ""
default-theme = "ayu"
cname = ""

View File

@ -3,7 +3,7 @@ name = "reth-crate-template"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[dependencies]

View File

@ -3,7 +3,7 @@ name = "reth-codecs"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[features]

View File

@ -3,7 +3,7 @@ name = "codecs-derive"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "../README.md"
[lib]

View File

@ -4,7 +4,7 @@ version = "0.1.1"
license = "Apache-2.0"
edition = "2021"
description = "Procedural macros for reth-rlp"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
[lib]
proc-macro = true

View File

@ -4,7 +4,7 @@ version = "0.1.2"
edition = "2021"
license = "Apache-2.0"
description = "Fast RLP serialization library"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
[dependencies]
arrayvec = { version = "0.7", default-features = false }

View File

@ -3,7 +3,7 @@ name = "reth-consensus"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[dependencies]

View File

@ -3,7 +3,7 @@ name = "reth-db"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Staged syncing primitives used in reth."

View File

@ -3,7 +3,7 @@ name = "reth-executor"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[dependencies]

View File

@ -315,7 +315,7 @@ pub fn execute<DB: StateProvider>(
}
// TODO add validator block reward. Currently not added.
// https://github.com/foundry-rs/reth/issues/237
// https://github.com/paradigmxyz/reth/issues/237
Ok(transaction_patch)
}

View File

@ -3,7 +3,7 @@ name = "reth-interfaces"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[dependencies]

View File

@ -4,7 +4,7 @@ version = "0.1.6"
edition = "2021"
license = "Apache-2.0"
description = "Idiomatic and safe MDBX wrapper with good licence"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[lib]

View File

@ -4,7 +4,7 @@ version = "0.12.1-0"
edition = "2021"
license = "Apache-2.0"
description = "Rust bindings for libmdbx with good licence."
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[lib]

View File

@ -3,7 +3,7 @@ name = "reth-bodies-downloaders"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Implementations of various block body downloaders"

View File

@ -3,7 +3,7 @@ name = "reth-discv4"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = """
Ethereum network support

View File

@ -3,7 +3,7 @@ name = "reth-ecies"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[dependencies]

View File

@ -4,7 +4,7 @@ description = "Impements the eth/64 and eth/65 P2P protocols"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
[dependencies]

View File

@ -3,7 +3,7 @@ name = "reth-headers-downloaders"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Implementations of various header downloader"

View File

@ -3,7 +3,7 @@ name = "reth-ipc"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = """
IPC support for reth

View File

@ -3,7 +3,7 @@ name = "reth-network"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = """
Ethereum network support

View File

@ -3,7 +3,7 @@ name = "reth-p2p"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Utilities for interacting with ethereum's peer to peer network."

View File

@ -3,7 +3,7 @@ name = "reth-rpc-api"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = """
Reth RPC interfaces

View File

@ -3,7 +3,7 @@ name = "reth-rpc-types"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = """
Reth RPC types

View File

@ -3,7 +3,7 @@ name = "reth-rpc"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = """
Reth RPC implementation

View File

@ -3,7 +3,7 @@ name = "reth-primitives"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Commonly used types in reth."
@ -56,5 +56,5 @@ hex-literal = "0.3"
test-fuzz = "3.0.4"
# necessary so we don't hit a "undeclared 'std'":
# https://github.com/foundry-rs/reth/pull/177#discussion_r1021172198
# https://github.com/paradigmxyz/reth/pull/177#discussion_r1021172198
secp256k1 = "0.24.0"

View File

@ -3,7 +3,7 @@ name = "reth-stages"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Staged syncing primitives used in reth."

View File

@ -427,7 +427,7 @@ mod tests {
#[tokio::test]
async fn sanity_execution_of_block() {
// TODO cleanup the setup after https://github.com/foundry-rs/reth/issues/332
// TODO cleanup the setup after https://github.com/paradigmxyz/reth/issues/332
// is merged as it has similar framework
let state_db = create_test_db::<WriteMap>(EnvKind::RW);
let mut db = StageDB::new(state_db.as_ref()).unwrap();
@ -511,7 +511,7 @@ mod tests {
#[tokio::test]
async fn sanity_execute_unwind() {
// TODO cleanup the setup after https://github.com/foundry-rs/reth/issues/332
// TODO cleanup the setup after https://github.com/paradigmxyz/reth/issues/332
// is merged as it has similar framework
let state_db = create_test_db::<WriteMap>(EnvKind::RW);

View File

@ -3,7 +3,7 @@ name = "reth-tracing"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "tracing helpers"

View File

@ -3,7 +3,7 @@ name = "reth-transaction-pool"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = """
Transaction pool implementation

View File

@ -2,21 +2,21 @@
## Abstractions
* We created a [Database trait abstraction](https://github.com/foundry-rs/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/interfaces/src/db/mod.rs) using Rust Stable GATs which frees us from being bound to a single database implementation. We currently use MDBX, but are exploring [redb](https://github.com/cberner/redb) as an alternative.
* We then iterated on [`StageDB`](https://github.com/foundry-rs/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/stages/src/db.rs#L14-L19) as a non-leaky abstraction with helpers for strictly-typed and unit-tested higher-level database abstractions.
* We created a [Database trait abstraction](https://github.com/paradigmxyz/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/interfaces/src/db/mod.rs) using Rust Stable GATs which frees us from being bound to a single database implementation. We currently use MDBX, but are exploring [redb](https://github.com/cberner/redb) as an alternative.
* We then iterated on [`StageDB`](https://github.com/paradigmxyz/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/stages/src/db.rs#L14-L19) as a non-leaky abstraction with helpers for strictly-typed and unit-tested higher-level database abstractions.
## Codecs
* We want Reth's serialized format to be able to trade off read/write speed for size, depending on who the user is.
* To achieve that, we created the [Encode/Decode/Compress/Decompress trais](https://github.com/foundry-rs/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/interfaces/src/db/table.rs#L9-L36) to make the (de)serialization of database `Table::Key` and `Table::Values` generic.
* This allows for [out-of-the-box benchmarking](https://github.com/foundry-rs/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/db/benches/encoding_iai.rs#L5) (using [Criterion](https://github.com/bheisler/criterion.rs) and [Iai](https://github.com/bheisler/iai))
* It also enables [out-of-the-box fuzzing](https://github.com/foundry-rs/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/interfaces/src/db/codecs/fuzz/mod.rs) using [trailofbits/test-fuzz](https://github.com/trailofbits/test-fuzz).
* To achieve that, we created the [Encode/Decode/Compress/Decompress trais](https://github.com/paradigmxyz/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/interfaces/src/db/table.rs#L9-L36) to make the (de)serialization of database `Table::Key` and `Table::Values` generic.
* This allows for [out-of-the-box benchmarking](https://github.com/paradigmxyz/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/db/benches/encoding_iai.rs#L5) (using [Criterion](https://github.com/bheisler/criterion.rs) and [Iai](https://github.com/bheisler/iai))
* It also enables [out-of-the-box fuzzing](https://github.com/paradigmxyz/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/interfaces/src/db/codecs/fuzz/mod.rs) using [trailofbits/test-fuzz](https://github.com/trailofbits/test-fuzz).
* We implemented that trait for the following encoding formats:
* [Ethereum-specific Compact Encoding](https://github.com/foundry-rs/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/codecs/derive/src/compact/mod.rs): A lot of Ethereum datatypes have unnecessary zeros when serialized, or optional (e.g. on empty hashes) which would be nice not to pay in storage costs.
* [Ethereum-specific Compact Encoding](https://github.com/paradigmxyz/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/codecs/derive/src/compact/mod.rs): A lot of Ethereum datatypes have unnecessary zeros when serialized, or optional (e.g. on empty hashes) which would be nice not to pay in storage costs.
* [Erigon](https://github.com/ledgerwatch/erigon/blob/12ee33a492f5d240458822d052820d9998653a63/docs/programmers_guide/db_walkthrough.MD) achieves that by having a `bitfield` set on Table "PlainState which adds a bitfield to Accounts.
* Akula expanded it for other tables and datatypes manually. It also saved some more space by storing the length of certain types (U256, u64) using the modular_bitfield crate, which compacts this information.
* We generalized it for all types, by writing a derive macro that autogenerates code for implementing the trait. It, also generates the interfaces required for fuzzing using ToB/test-fuzz:
* [Scale Encoding](https://github.com/paritytech/parity-scale-codec)
* [Postcard Encoding](https://github.com/jamesmunns/postcard)
* Passthrough (called `no_codec` in the codebase)
* We made implementation of these traits easy via a derive macro called [`main_codec`](https://github.com/foundry-rs/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/codecs/derive/src/lib.rs#L15) that delegates to one of Compact (default), Scale, Postcard or Passthrough encoding. This is [derived on every struct we need](https://github.com/search?q=repo%3Afoundry-rs%2Freth%20%22%23%5Bmain_codec%5D%22&type=code), and lets us experiment with different encoding formats without having to modify the entire codebase each time.
* We made implementation of these traits easy via a derive macro called [`main_codec`](https://github.com/paradigmxyz/reth/blob/0d9b9a392d4196793736522f3fc2ac804991b45d/crates/codecs/derive/src/lib.rs#L15) that delegates to one of Compact (default), Scale, Postcard or Passthrough encoding. This is [derived on every struct we need](https://github.com/search?q=repo%3Aparadigmxyz%2Freth%20%22%23%5Bmain_codec%5D%22&type=code), and lets us experiment with different encoding formats without having to modify the entire codebase each time.

View File

@ -2,10 +2,10 @@
> Explanation of how the Reth Headers Downloader and Stage works
* We started off with sketching out a generic header downloader interface, so that we can support multiple downloading strategies implementing the interface. See [`reth#58`](https://github.com/foundry-rs/reth/pull/58) and [`reth#118`](https://github.com/foundry-rs/reth/pull/118).
* First, we implemented the reverse linear download. It received the current chain tip and local head as arguments and requested blocks in batches starting from the tip, and retried on request failure. See [`reth#58`](https://github.com/foundry-rs/reth/pull/58) and [`reth#119`](https://github.com/foundry-rs/reth/pull/119).
* The first complete implementation of the headers stage was introduced in [`reth#126`](https://github.com/foundry-rs/reth/pull/126). The stage looked up the local head & queried the consensus for the chain tip and queried the downloader passing them as arguments. After the download finished, the stage would proceed to insert headers in the ascending order by appending the entries to the corresponding tables.
* The original downloader was refactored in [`reth#249`](https://github.com/foundry-rs/reth/pull/249) to return a `Future` which would resolve when either the download is completed or the error occurred during polling. This future kept a pointer to a current request at any time, allowing to retry the request in case of failure. The insert logic of the headers stage remained unchanged.
* We started off with sketching out a generic header downloader interface, so that we can support multiple downloading strategies implementing the interface. See [`reth#58`](https://github.com/paradigmxyz/reth/pull/58) and [`reth#118`](https://github.com/paradigmxyz/reth/pull/118).
* First, we implemented the reverse linear download. It received the current chain tip and local head as arguments and requested blocks in batches starting from the tip, and retried on request failure. See [`reth#58`](https://github.com/paradigmxyz/reth/pull/58) and [`reth#119`](https://github.com/paradigmxyz/reth/pull/119).
* The first complete implementation of the headers stage was introduced in [`reth#126`](https://github.com/paradigmxyz/reth/pull/126). The stage looked up the local head & queried the consensus for the chain tip and queried the downloader passing them as arguments. After the download finished, the stage would proceed to insert headers in the ascending order by appending the entries to the corresponding tables.
* The original downloader was refactored in [`reth#249`](https://github.com/paradigmxyz/reth/pull/249) to return a `Future` which would resolve when either the download is completed or the error occurred during polling. This future kept a pointer to a current request at any time, allowing to retry the request in case of failure. The insert logic of the headers stage remained unchanged.
* NOTE: Up to this point the headers stage awaited full range of blocks (from local head to tip) to be downloaded before proceeding to insert.
* [`reth#296`](https://github.com/foundry-rs/reth/pull/296) introduced the `Stream` implementation of the download as well as the commit threshold for the headers stage. The `Stream` implementation yields headers as soon as they are received and validated. It dispatches the request for the next header batch until the head is reached. The headers stage now has a configurable commit threshold which allows configure the insert batch size. With this change, the headers stage no longer waits for the download to be complete, but rather collects the headers from the stream up to the commit threshold parameter. After collecting, the stage proceeds to insert the batch. The process is repeated until the stream is drained. At this point, we populated all tables except for HeadersTD since it has to be computed in a linear ascending order. The stage starts walking the populated headers table and computes & inserts new total difficulty values.
* [`reth#296`](https://github.com/paradigmxyz/reth/pull/296) introduced the `Stream` implementation of the download as well as the commit threshold for the headers stage. The `Stream` implementation yields headers as soon as they are received and validated. It dispatches the request for the next header batch until the head is reached. The headers stage now has a configurable commit threshold which allows configure the insert batch size. With this change, the headers stage no longer waits for the download to be complete, but rather collects the headers from the stream up to the commit threshold parameter. After collecting, the stage proceeds to insert the batch. The process is repeated until the stream is drained. At this point, we populated all tables except for HeadersTD since it has to be computed in a linear ascending order. The stage starts walking the populated headers table and computes & inserts new total difficulty values.
* This header implementation is unique because it is implemented as a Stream, it yields headers as soon as they become available (contrary to waiting for download to complete) and it keeps only one header in buffer (required to form the next header request) .

View File

@ -2,6 +2,6 @@
> Explanation of the [Reth P2P Stack](../../crates/net/p2p) design process
* Our initial design exploration started in [#64](https://github.com/foundry-rs/reth/issues/64), which focused on layering dependent subprotocols as generic async streams, then using those streams to construct higher level network abstractions.
* Our initial design exploration started in [#64](https://github.com/paradigmxyz/reth/issues/64), which focused on layering dependent subprotocols as generic async streams, then using those streams to construct higher level network abstractions.
* Following the above design, we then implemented `P2PStream` and `EthStream`, corresponding to the `p2p` and `eth` subprotocol respectively.
* The wire protocol used to decode messages in `EthStream` came from ethp2p, making it easy to get the full stack to work.

View File

@ -5,7 +5,7 @@ Each label in the repository has a description attached that describes what the
There are 7 label categories in the repository:
- **Area labels**: These labels denote the general area of the project an issue or PR affects. These start with [`A-`][area].
- **Category labels**: These labels denote the type of issue or change being made, for example https://github.com/foundry-rs/reth/labels/C-bug or https://github.com/foundry-rs/reth/labels/C-enhancement. These start with [`C-`][category].
- **Category labels**: These labels denote the type of issue or change being made, for example https://github.com/paradigmxyz/reth/labels/C-bug or https://github.com/paradigmxyz/reth/labels/C-enhancement. These start with [`C-`][category].
- **Difficulty labels**: These are reserved for the very easy or very hard issues. Any issue without one of these labels can be considered to be of "average difficulty". They start with [`D-`][difficulty].
- **Meta labels**: These start with [`M-`][meta] and convey meaning to the core contributors, usually about the release process.
- **Platform labels**: These describe the platform an issue is present on. They start with [`O-`][platform].
@ -18,26 +18,26 @@ For easier at-a-glance communication of the status of issues and PRs the followi
**Needs work**
- https://github.com/foundry-rs/reth/labels/S-blocked
- https://github.com/foundry-rs/reth/labels/S-needs-benchmark
- https://github.com/foundry-rs/reth/labels/S-needs-design
- https://github.com/foundry-rs/reth/labels/S-needs-investigation
- https://github.com/foundry-rs/reth/labels/S-needs-rebase
- https://github.com/paradigmxyz/reth/labels/S-blocked
- https://github.com/paradigmxyz/reth/labels/S-needs-benchmark
- https://github.com/paradigmxyz/reth/labels/S-needs-design
- https://github.com/paradigmxyz/reth/labels/S-needs-investigation
- https://github.com/paradigmxyz/reth/labels/S-needs-rebase
**Closure reasons**
- https://github.com/foundry-rs/reth/labels/S-duplicate
- https://github.com/foundry-rs/reth/labels/S-wontfix
- https://github.com/paradigmxyz/reth/labels/S-duplicate
- https://github.com/paradigmxyz/reth/labels/S-wontfix
**Misc.**
- https://github.com/foundry-rs/reth/labels/S-needs-triage
- https://github.com/foundry-rs/reth/labels/S-controversial
- https://github.com/paradigmxyz/reth/labels/S-needs-triage
- https://github.com/paradigmxyz/reth/labels/S-controversial
[area]: https://github.com/foundry-rs/reth/labels?q=a-
[category]: https://github.com/foundry-rs/reth/labels?q=c-
[difficulty]: https://github.com/foundry-rs/reth/labels?q=d-
[meta]: https://github.com/foundry-rs/reth/labels?q=m-
[platform]: https://github.com/foundry-rs/reth/labels?q=o-
[priority]: https://github.com/foundry-rs/reth/labels?q=p-
[status]: https://github.com/foundry-rs/reth/labels?q=s-
[area]: https://github.com/paradigmxyz/reth/labels?q=a-
[category]: https://github.com/paradigmxyz/reth/labels?q=c-
[difficulty]: https://github.com/paradigmxyz/reth/labels?q=d-
[meta]: https://github.com/paradigmxyz/reth/labels?q=m-
[platform]: https://github.com/paradigmxyz/reth/labels?q=o-
[priority]: https://github.com/paradigmxyz/reth/labels?q=p-
[status]: https://github.com/paradigmxyz/reth/labels?q=s-

View File

@ -2,7 +2,7 @@
1. Update the version in `Cargo.toml`
2. Update the changelog[^1]
- Check that all issues marked https://github.com/foundry-rs/reth/labels/M-changelog have been added to the changelog
- Check that all issues marked https://github.com/paradigmxyz/reth/labels/M-changelog have been added to the changelog
- Move the "Unreleased" section in the changelog under a new header with the new version, and fix up the links in the bottom of the file
3. Ensure tests and lints pass
4. Commit the new changelog and version bump