revm_primitives/
constants.rs

1//! Global constants for the EVM
2//!
3//! Here you can find constants that dont belong to any EIP and are there for the genesis.
4
5use crate::eip170;
6use alloy_primitives::{b256, Address, B256};
7
8/// Number of block hashes that EVM can access in the past (pre-Prague)
9pub const BLOCK_HASH_HISTORY: u64 = 256;
10
11/// The address of precompile 3, which is handled specially in a few places
12pub const PRECOMPILE3: Address =
13    Address::new([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3]);
14
15/// EVM interpreter stack limit
16pub const STACK_LIMIT: usize = 1024;
17
18/// EIP-3860: Limit and meter initcode
19///
20/// Limit of maximum initcode size is `2 * MAX_CODE_SIZE`.
21pub const MAX_INITCODE_SIZE: usize = 2 * eip170::MAX_CODE_SIZE;
22
23/// EVM call stack limit
24pub const CALL_STACK_LIMIT: u64 = 1024;
25
26/// The Keccak-256 hash of the empty string `""`.
27pub const KECCAK_EMPTY: B256 =
28    b256!("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");