Skip to content
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

Derive rlp en-/decoding for Sealed<T> #754

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ map-fxhash = ["map", "dep:rustc-hash"]
getrandom = ["dep:getrandom"]
k256 = ["dep:k256"]
rand = ["dep:rand", "getrandom", "ruint/rand", "rustc-hash?/rand"]
rlp = ["dep:alloy-rlp", "ruint/alloy-rlp"]
rlp = ["alloy-rlp/derive", "ruint/alloy-rlp"]
serde = [
"dep:serde",
"bytes/serde",
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/sealed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::B256;
/// We do not implement any specific hashing algorithm here. Instead types
/// implement the [`Sealable`] trait to provide define their own hash.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "rlp", derive(alloy_rlp::RlpEncodable, alloy_rlp::RlpDecodable))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is useful because the hash is usually never included in any rlp payload if it can be computed from the sealed element

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid, pls open an issue in reth then to remove it from SealedBlock and SealedHeader

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, I can see this being useful for decodeable where T: Sealable

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Sealed<T> {
/// The inner item
Expand Down
Loading