primitives: use alloy DEV_GENESIS_HASH constant (#11849)

This commit is contained in:
Thomas Coratger
2024-10-17 22:29:31 +02:00
committed by GitHub
parent 8eb5d4f047
commit b57cbfd21b
6 changed files with 6 additions and 8 deletions

1
Cargo.lock generated
View File

@ -8032,6 +8032,7 @@ name = "reth-optimism-chainspec"
version = "1.1.0" version = "1.1.0"
dependencies = [ dependencies = [
"alloy-chains", "alloy-chains",
"alloy-consensus",
"alloy-genesis", "alloy-genesis",
"alloy-primitives", "alloy-primitives",
"derive_more 1.0.0", "derive_more 1.0.0",

View File

@ -7,7 +7,7 @@ use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
use alloy_trie::EMPTY_ROOT_HASH; use alloy_trie::EMPTY_ROOT_HASH;
use derive_more::From; use derive_more::From;
use alloy_consensus::constants::MAINNET_GENESIS_HASH; use alloy_consensus::constants::{DEV_GENESIS_HASH, MAINNET_GENESIS_HASH};
use reth_ethereum_forks::{ use reth_ethereum_forks::{
ChainHardforks, DisplayHardforks, EthereumHardfork, EthereumHardforks, ForkCondition, ChainHardforks, DisplayHardforks, EthereumHardfork, EthereumHardforks, ForkCondition,
ForkFilter, ForkFilterKey, ForkHash, ForkId, Hardfork, Hardforks, Head, DEV_HARDFORKS, ForkFilter, ForkFilterKey, ForkHash, ForkId, Hardfork, Hardforks, Head, DEV_HARDFORKS,
@ -18,7 +18,7 @@ use reth_network_peers::{
}; };
use reth_primitives_traits::{ use reth_primitives_traits::{
constants::{ constants::{
DEV_GENESIS_HASH, EIP1559_INITIAL_BASE_FEE, EMPTY_WITHDRAWALS, ETHEREUM_BLOCK_GAS_LIMIT, EIP1559_INITIAL_BASE_FEE, EMPTY_WITHDRAWALS, ETHEREUM_BLOCK_GAS_LIMIT,
HOLESKY_GENESIS_HASH, SEPOLIA_GENESIS_HASH, HOLESKY_GENESIS_HASH, SEPOLIA_GENESIS_HASH,
}, },
Header, SealedHeader, Header, SealedHeader,

View File

@ -25,6 +25,7 @@ reth-optimism-forks.workspace = true
alloy-chains.workspace = true alloy-chains.workspace = true
alloy-genesis.workspace = true alloy-genesis.workspace = true
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-consensus.workspace = true
# op # op
op-alloy-rpc-types.workspace = true op-alloy-rpc-types.workspace = true

View File

@ -3,10 +3,10 @@
use alloc::sync::Arc; use alloc::sync::Arc;
use alloy_chains::Chain; use alloy_chains::Chain;
use alloy_consensus::constants::DEV_GENESIS_HASH;
use alloy_primitives::U256; use alloy_primitives::U256;
use reth_chainspec::{once_cell_set, BaseFeeParams, BaseFeeParamsKind, ChainSpec}; use reth_chainspec::{once_cell_set, BaseFeeParams, BaseFeeParamsKind, ChainSpec};
use reth_optimism_forks::DEV_HARDFORKS; use reth_optimism_forks::DEV_HARDFORKS;
use reth_primitives_traits::constants::DEV_GENESIS_HASH;
use crate::{LazyLock, OpChainSpec}; use crate::{LazyLock, OpChainSpec};

View File

@ -106,10 +106,6 @@ pub const SEPOLIA_GENESIS_HASH: B256 =
pub const HOLESKY_GENESIS_HASH: B256 = pub const HOLESKY_GENESIS_HASH: B256 =
b256!("b5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4"); b256!("b5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4");
/// Testnet genesis hash: `0x2f980576711e3617a5e4d83dd539548ec0f7792007d505a3d2e9674833af2d7c`
pub const DEV_GENESIS_HASH: B256 =
b256!("2f980576711e3617a5e4d83dd539548ec0f7792007d505a3d2e9674833af2d7c");
/// Keccak256 over empty array: `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470` /// Keccak256 over empty array: `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470`
pub const KECCAK_EMPTY: B256 = pub const KECCAK_EMPTY: B256 =
b256!("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"); b256!("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");

View File

@ -39,7 +39,7 @@ pub use block::{
}; };
#[cfg(feature = "reth-codec")] #[cfg(feature = "reth-codec")]
pub use compression::*; pub use compression::*;
pub use constants::{DEV_GENESIS_HASH, HOLESKY_GENESIS_HASH, KECCAK_EMPTY, SEPOLIA_GENESIS_HASH}; pub use constants::{HOLESKY_GENESIS_HASH, KECCAK_EMPTY, SEPOLIA_GENESIS_HASH};
pub use receipt::{ pub use receipt::{
gas_spent_by_transactions, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Receipts, gas_spent_by_transactions, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Receipts,
}; };