diff --git a/crates/consensus/src/block/any.rs b/crates/consensus/src/block/any.rs index 678f174e202..b73ad09abb1 100644 --- a/crates/consensus/src/block/any.rs +++ b/crates/consensus/src/block/any.rs @@ -15,7 +15,7 @@ pub struct AnyHeader { #[cfg_attr(feature = "serde", serde(rename = "sha3Uncles"))] pub ommers_hash: B256, /// Alias of `author` - #[serde(rename = "miner")] + #[cfg_attr(feature = "serde", serde(rename = "miner"))] pub beneficiary: Address, /// State root hash pub state_root: B256, diff --git a/crates/consensus/src/block/header.rs b/crates/consensus/src/block/header.rs index 58956d6e942..0a94dbdd1ac 100644 --- a/crates/consensus/src/block/header.rs +++ b/crates/consensus/src/block/header.rs @@ -21,11 +21,11 @@ pub struct Header { /// block’s header, in its entirety; formally Hp. pub parent_hash: B256, /// The Keccak 256-bit hash of the ommers list portion of this block; formally Ho. - #[serde(rename = "sha3Uncles")] + #[cfg_attr(feature = "serde", serde(rename = "sha3Uncles"))] pub ommers_hash: B256, /// The 160-bit address to which all fees collected from the successful mining of this block /// be transferred; formally Hc. - #[serde(rename = "miner")] + #[cfg_attr(feature = "serde", serde(rename = "miner"))] pub beneficiary: Address, /// The Keccak 256-bit hash of the root node of the state trie, after all transactions are /// executed and finalisations applied; formally Hr.