consensus: refactor build_header_template (#10442)

This commit is contained in:
Thomas Coratger
2024-08-22 00:01:23 -07:00
committed by GitHub
parent f4255216c7
commit 362c2380e7

View File

@ -287,25 +287,18 @@ impl StorageInner {
let mut header = Header {
parent_hash: self.best_hash,
ommers_hash: proofs::calculate_ommers_root(ommers),
beneficiary: Default::default(),
state_root: Default::default(),
transactions_root: proofs::calculate_transaction_root(transactions),
receipts_root: Default::default(),
withdrawals_root: withdrawals.map(|w| proofs::calculate_withdrawals_root(w)),
logs_bloom: Default::default(),
difficulty: U256::from(2),
number: self.best_block + 1,
gas_limit: chain_spec.max_gas_limit,
gas_used: 0,
timestamp,
mix_hash: Default::default(),
nonce: 0,
base_fee_per_gas,
blob_gas_used,
excess_blob_gas: None,
extra_data: Default::default(),
parent_beacon_block_root: None,
requests_root: requests.map(|r| proofs::calculate_requests_root(&r.0)),
..Default::default()
};
if chain_spec.is_cancun_active_at_timestamp(timestamp) {