alloy_eip7928/constants.rs
1//! Constants for eip-7928. Chosen to support a 630 million gas limit.
2
3use alloy_primitives::{B256, b256};
4
5/// Maximum number of transactions per block.
6pub const MAX_TXS_PER_BLOCK: usize = 30_000;
7
8/// Maximum number of unique storage slots modified in a block.
9pub const MAX_SLOTS: usize = 300_000;
10
11/// Maximum number of unique accounts accessed in a block.
12pub const MAX_ACCOUNTS: usize = 300_000;
13
14/// Maximum contract bytecode size in bytes.
15pub const MAX_CODE_SIZE: usize = 24_576;
16
17/// Item cost for block access list.
18pub const ITEM_COST: usize = 2000;
19
20const ETHEREUM_MAINNET_SLOTS_PER_EPOCH: u64 = 32;
21
22/// Number of epochs the execution layer must retain block access lists for.
23pub const BAL_RETENTION_PERIOD_EPOCHS: u64 = 3_533;
24
25/// Number of slots corresponding to [`BAL_RETENTION_PERIOD_EPOCHS`].
26pub const BAL_RETENTION_PERIOD_SLOTS: u64 =
27 BAL_RETENTION_PERIOD_EPOCHS * ETHEREUM_MAINNET_SLOTS_PER_EPOCH;
28
29/// The empty block access list hash.
30pub const EMPTY_BLOCK_ACCESS_LIST_HASH: B256 =
31 b256!("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347");