feat: update el requests for devnet 4 (#11865)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Oliver
2024-10-19 14:48:35 +02:00
committed by GitHub
parent 2ae93682b4
commit 3bd695ee63
106 changed files with 799 additions and 1328 deletions

View File

@ -22,7 +22,6 @@ alloy-chains = { workspace = true, features = ["serde", "rlp"] }
alloy-eips = { workspace = true, features = ["serde"] }
alloy-genesis.workspace = true
alloy-primitives = { workspace = true, features = ["rand", "rlp"] }
alloy-trie.workspace = true
alloy-consensus.workspace = true
# misc

View File

@ -3,9 +3,9 @@ pub use alloy_eips::eip1559::BaseFeeParams;
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloy_chains::{Chain, NamedChain};
use alloy_consensus::constants::EMPTY_WITHDRAWALS;
use alloy_eips::eip7685::EMPTY_REQUESTS_HASH;
use alloy_genesis::Genesis;
use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
use alloy_trie::EMPTY_ROOT_HASH;
use derive_more::From;
use alloy_consensus::constants::{DEV_GENESIS_HASH, MAINNET_GENESIS_HASH};
@ -284,8 +284,9 @@ impl ChainSpec {
};
// If Prague is activated at genesis we set requests root to an empty trie root.
let requests_root =
self.is_prague_active_at_timestamp(self.genesis.timestamp).then_some(EMPTY_ROOT_HASH);
let requests_hash = self
.is_prague_active_at_timestamp(self.genesis.timestamp)
.then_some(EMPTY_REQUESTS_HASH);
Header {
gas_limit: self.genesis.gas_limit,
@ -301,7 +302,7 @@ impl ChainSpec {
parent_beacon_block_root,
blob_gas_used: blob_gas_used.map(Into::into),
excess_blob_gas: excess_blob_gas.map(Into::into),
requests_root,
requests_hash,
..Default::default()
}
}
@ -940,6 +941,7 @@ mod tests {
use alloy_chains::Chain;
use alloy_genesis::{ChainConfig, GenesisAccount};
use alloy_primitives::{b256, hex};
use alloy_trie::EMPTY_ROOT_HASH;
use reth_ethereum_forks::{ForkCondition, ForkHash, ForkId, Head};
use reth_trie_common::TrieAccount;