revm_primitives/
eip4844.rs

1//! EIP-4844: Shard Blob Transactions
2//!
3//! Constants for blob transaction support in Cancun and Prague hard forks.
4
5/// First version of the blob
6pub const VERSIONED_HASH_VERSION_KZG: u8 = 0x01;
7
8/// Gas consumption of a single data blob (== blob byte size)
9pub const GAS_PER_BLOB: u64 = 1 << 17;
10
11/// Min blob gas price
12pub const MIN_BLOB_GASPRICE: u64 = 1;
13
14/// Target number of the blob per block
15pub const TARGET_BLOB_NUMBER_PER_BLOCK_CANCUN: u64 = 3;
16
17/// Max number of blobs per block
18pub const MAX_BLOB_NUMBER_PER_BLOCK_CANCUN: u64 = 2 * TARGET_BLOB_NUMBER_PER_BLOCK_CANCUN;
19
20/// Maximum consumable blob gas for data blobs per block
21pub const MAX_BLOB_GAS_PER_BLOCK_CANCUN: u64 = MAX_BLOB_NUMBER_PER_BLOCK_CANCUN * GAS_PER_BLOB;
22
23/// Target consumable blob gas for data blobs per block (for 1559-like pricing)
24pub const TARGET_BLOB_GAS_PER_BLOCK_CANCUN: u64 =
25    TARGET_BLOB_NUMBER_PER_BLOCK_CANCUN * GAS_PER_BLOB;
26
27/// Controls the maximum rate of change for blob gas price
28pub const BLOB_BASE_FEE_UPDATE_FRACTION_CANCUN: u64 = 3_338_477;
29
30/// Target number of the blob per block
31pub const TARGET_BLOB_NUMBER_PER_BLOCK_PRAGUE: u64 = 6;
32
33/// Max number of blobs per block
34pub const MAX_BLOB_NUMBER_PER_BLOCK_PRAGUE: u64 = 9;
35
36/// Maximum consumable blob gas for data blobs per block
37pub const MAX_BLOB_GAS_PER_BLOCK_PRAGUE: u64 = MAX_BLOB_NUMBER_PER_BLOCK_PRAGUE * GAS_PER_BLOB;
38
39/// Target consumable blob gas for data blobs per block (for 1559-like pricing)
40pub const TARGET_BLOB_GAS_PER_BLOCK_PRAGUE: u64 =
41    TARGET_BLOB_NUMBER_PER_BLOCK_PRAGUE * GAS_PER_BLOB;
42
43/// Controls the maximum rate of change for blob gas price
44pub const BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE: u64 = 5_007_716;