rtvm_primitives/
constants.rs

1use crate::Address;
2
3/// EIP-170: Contract code size limit
4/// By default limit is 0x6000 (~25kb)
5pub const MAX_CODE_SIZE: usize = 0x6000;
6
7/// Number of block hashes that EVM can access in the past
8pub const BLOCK_HASH_HISTORY: usize = 256;
9
10/// EIP-3860: Limit and meter initcode
11///
12/// Limit of maximum initcode size is 2 * MAX_CODE_SIZE
13pub const MAX_INITCODE_SIZE: usize = 2 * MAX_CODE_SIZE;
14
15/// Precompile 3 is special in few places
16pub const PRECOMPILE3: Address =
17    Address::new([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3]);
18// EIP-4844 constants
19/// Gas consumption of a single data blob (== blob byte size).
20pub const GAS_PER_BLOB: u64 = 1 << 17;
21/// Target number of the blob per block.
22pub const TARGET_BLOB_NUMBER_PER_BLOCK: u64 = 3;
23/// Max number of blobs per block
24pub const MAX_BLOB_NUMBER_PER_BLOCK: u64 = 2 * TARGET_BLOB_NUMBER_PER_BLOCK;
25/// Maximum consumable blob gas for data blobs per block.
26pub const MAX_BLOB_GAS_PER_BLOCK: u64 = MAX_BLOB_NUMBER_PER_BLOCK * GAS_PER_BLOB;
27/// Target consumable blob gas for data blobs per block (for 1559-like pricing).
28pub const TARGET_BLOB_GAS_PER_BLOCK: u64 = TARGET_BLOB_NUMBER_PER_BLOCK * GAS_PER_BLOB;
29/// Minimum gas price for data blobs.
30pub const MIN_BLOB_GASPRICE: u64 = 1;
31/// Controls the maximum rate of change for blob gas price.
32pub const BLOB_GASPRICE_UPDATE_FRACTION: u64 = 3338477;
33/// First version of the blob.
34pub const VERSIONED_HASH_VERSION_KZG: u8 = 0x01;