-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reth-ethereum-forks crate #5621
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
65a1c23
Crated ethereum-forks crate
8c94aa4
Merge branch 'new' into new_crate
Arindam2407 8aab420
fmt changes
2335a05
doc changes
3de9adc
Merge pull request #17 from Arindam2407/new_crate
Arindam2407 9333344
Committed requested changes
93a2335
corrected test failures
8c5ebd4
Merge pull request #18 from Arindam2407/new_crate
Arindam2407 cd1bf86
import changes
f74a7a3
Merge pull request #19 from Arindam2407/new_crate
Arindam2407 8ba8286
Remove unnecessary dependencies
39efd72
Merge pull request #20 from Arindam2407/new_crate
Arindam2407 ccc68f5
touchups
mattsse 72036e3
enable arbitrary
mattsse 03693bd
chore: doc fixes
mattsse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
mattsse marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a cleanup, we probably need way less dependencies