forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reth-ethereum-forks crate (paradigmxyz#5621)
Co-authored-by: root <root@Arindam> Co-authored-by: Matthias Seitz <[email protected]>
- Loading branch information
1 parent
1067bb3
commit 2144b97
Showing
16 changed files
with
357 additions
and
198 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[package] | ||
name = "reth-ethereum-forks" | ||
version.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
license.workspace = true | ||
homepage.workspace = true | ||
repository.workspace = true | ||
description = "Ethereum fork types used in reth." | ||
|
||
[dependencies] | ||
# reth | ||
reth-codecs.workspace = true | ||
|
||
# ethereum | ||
alloy-primitives = { workspace = true, features = ["rand", "rlp"] } | ||
alloy-rlp = { workspace = true, features = ["arrayvec"] } | ||
|
||
# used for forkid | ||
crc = "3" | ||
|
||
# misc | ||
serde.workspace = true | ||
thiserror.workspace = true | ||
|
||
|
||
# arbitrary utils | ||
arbitrary = { workspace = true, features = ["derive"], optional = true } | ||
proptest = { workspace = true, optional = true } | ||
proptest-derive = { workspace = true, optional = true } | ||
|
||
[dev-dependencies] | ||
rand.workspace = true | ||
arbitrary = { workspace = true, features = ["derive"] } | ||
proptest.workspace = true | ||
proptest-derive.workspace = true | ||
|
||
|
||
[features] | ||
arbitrary = ["dep:arbitrary", "dep:proptest", "dep:proptest-derive"] | ||
optimism = ["reth-codecs/optimism"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use alloy_primitives::{BlockNumber, B256, U256}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Describes the current head block. | ||
/// | ||
/// The head block is the highest fully synced block. | ||
/// | ||
/// Note: This is a slimmed down version of Header, primarily for communicating the highest block | ||
/// with the P2P network and the RPC. | ||
#[derive( | ||
Debug, Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize, | ||
)] | ||
pub struct Head { | ||
/// The number of the head block. | ||
pub number: BlockNumber, | ||
/// The hash of the head block. | ||
pub hash: B256, | ||
/// The difficulty of the head block. | ||
pub difficulty: U256, | ||
/// The total difficulty at the head block. | ||
pub total_difficulty: U256, | ||
/// The timestamp of the head block. | ||
pub timestamp: u64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Ethereum fork types used in reth. | ||
//! | ||
//! This crate contains Ethereum fork types and helper functions. | ||
//! | ||
//! ## Feature Flags | ||
//! | ||
//! - `arbitrary`: Adds `proptest` and `arbitrary` support for primitive types. | ||
#![doc( | ||
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png", | ||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256", | ||
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" | ||
)] | ||
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)] | ||
#![deny(unused_must_use, rust_2018_idioms, unused_crate_dependencies)] | ||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] | ||
#![allow(clippy::non_canonical_clone_impl)] | ||
|
||
mod forkid; | ||
mod hardfork; | ||
mod head; | ||
|
||
pub use forkid::{ForkFilter, ForkFilterKey, ForkHash, ForkId, ForkTransition, ValidationError}; | ||
pub use hardfork::Hardfork; | ||
pub use head::Head; | ||
|
||
#[cfg(any(test, feature = "arbitrary"))] | ||
pub use arbitrary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.