ethrex_common/
constants.rs1use crate::{H160, H256};
2use ethrex_crypto::keccak::keccak_hash;
3use ethrex_rlp::constants::RLP_NULL;
4use std::{str::FromStr, sync::LazyLock};
5
6pub const SYSTEM_ADDRESS: H160 = H160([
9 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
10 0xFF, 0xFF, 0xFF, 0xFE,
11]);
12
13pub const MAINNET_DEPOSIT_CONTRACT_ADDRESS: H160 = H160([
21 0x00, 0x00, 0x00, 0x00, 0x21, 0x9A, 0xB5, 0x40, 0x35, 0x6C, 0xBB, 0x83, 0x9C, 0xBE, 0x05, 0x30,
22 0x3D, 0x77, 0x05, 0xFA,
23]);
24
25pub static DEFAULT_OMMERS_HASH: LazyLock<H256> = LazyLock::new(|| {
27 H256::from_slice(
28 &hex::decode("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")
29 .expect("Failed to decode hex from string"),
30 )
31});
32
33pub static DEFAULT_REQUESTS_HASH: LazyLock<H256> = LazyLock::new(|| {
35 H256::from_slice(
36 &hex::decode("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
37 .expect("Failed to decode hex from string"),
38 )
39});
40
41pub static EMPTY_WITHDRAWALS_HASH: LazyLock<H256> = LazyLock::new(|| {
43 H256::from_slice(
44 &hex::decode("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
45 .expect("Failed to decode hex from string"),
46 )
47});
48
49pub static EMPTY_KECCAK_HASH: LazyLock<H256> = LazyLock::new(|| {
51 H256::from_slice(
52 &hex::decode("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")
53 .expect("Failed to decode hex from string"),
54 )
55});
56
57pub static EMPTY_TRIE_HASH: LazyLock<H256> = LazyLock::new(|| H256(keccak_hash([RLP_NULL])));
58
59pub static DEPOSIT_TOPIC: LazyLock<H256> = LazyLock::new(|| {
61 H256::from_str("649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5")
62 .expect("Failed to decode hex from string")
63});
64
65pub static EMPTY_BLOCK_ACCESS_LIST_HASH: LazyLock<H256> = LazyLock::new(|| {
67 H256::from_slice(
68 &hex::decode("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")
69 .expect("Failed to decode hex from string"),
70 )
71});
72
73pub const GAS_PER_BLOB: u32 = 1 << 17;
77
78pub const MIN_BASE_FEE_PER_BLOB_GAS: u64 = 1;
80
81pub const MAX_BLOCK_SIZE: u64 = 10_485_760;
84pub const RLP_BLOCK_SIZE_SAFETY_MARGIN: u64 = 2_097_152;
85pub const MAX_RLP_BLOCK_SIZE: u64 = MAX_BLOCK_SIZE - RLP_BLOCK_SIZE_SAFETY_MARGIN;
86pub const BLOB_BASE_COST: u64 = 8192;
88
89pub const POST_OSAKA_GAS_LIMIT_CAP: u64 = 16777216;
92pub const TX_MAX_GAS_LIMIT_AMSTERDAM: u64 = 1 << 24; pub const AMSTERDAM_MAX_CODE_SIZE: u64 = 0x10000;
96
97pub const TX_MAX_TOTAL_GAS_LIMIT_AMSTERDAM: u64 = u32::MAX as u64; pub const BAL_ITEM_COST: u64 = 2000;