Skip to content

Commit

Permalink
consensus: rm redundant root hash definitions (#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Oct 16, 2024
1 parent 8857646 commit 091309e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 2 additions & 9 deletions crates/consensus/src/header.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::constants::{EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
use alloc::vec::Vec;
use alloy_eips::{
eip1559::{calc_next_block_base_fee, BaseFeeParams},
Expand All @@ -6,21 +7,13 @@ use alloy_eips::{
BlockNumHash,
};
use alloy_primitives::{
b256, keccak256, Address, BlockNumber, Bloom, Bytes, Sealable, Sealed, B256, B64, U256,
keccak256, Address, BlockNumber, Bloom, Bytes, Sealable, Sealed, B256, B64, U256,
};
use alloy_rlp::{
length_of_length, Buf, BufMut, Decodable, Encodable, EMPTY_LIST_CODE, EMPTY_STRING_CODE,
};
use core::mem;

/// Ommer root of empty list.
pub const EMPTY_OMMER_ROOT_HASH: B256 =
b256!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347");

/// Root hash of an empty trie.
pub const EMPTY_ROOT_HASH: B256 =
b256!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421");

/// Ethereum Block header
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ mod block;
pub use block::{Block, BlockBody};

pub mod constants;
pub use constants::{EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};

mod encodable_signature;
pub use encodable_signature::EncodableSignature;

mod header;
pub use header::{BlockHeader, Header, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
pub use header::{BlockHeader, Header};

mod receipt;
pub use receipt::{
Expand Down

0 comments on commit 091309e

Please sign in to comment.