1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! [EIP-8141] constants.
//!
//! [EIP-8141]: https://eips.ethereum.org/EIPS/eip-8141
use ;
/// Identifier for EIP-8141 frame transactions.
pub const FRAME_TX_TYPE: u8 = 0x06;
/// Intrinsic gas cost for an EIP-8141 frame transaction.
pub const FRAME_TX_INTRINSIC_COST: u64 = 12_000;
/// Fixed gas cost charged per frame.
pub const FRAME_TX_PER_FRAME_COST: u64 = 475;
/// Cost of a nonzero-value frame with an explicit target other than the sender.
///
/// This is EIP-2780's `TX_VALUE_COST`, referenced by EIP-8141.
pub const TX_VALUE_COST: u64 = 6_000;
/// Standard gas charged per frame transaction calldata token.
///
/// This matches `GasCosts.TX_DATA_TOKEN_STANDARD` in the execution-specs EIP-8141 draft.
pub const FRAME_TX_DATA_TOKEN_STANDARD_COST: u64 = 4;
/// Total-cost floor charged per frame transaction calldata token.
///
/// EIP-7976 raises this from 10 to 16 and counts every calldata byte as four
/// floor tokens, producing a uniform 64 gas floor per byte.
pub const FRAME_TX_TOTAL_COST_FLOOR_PER_TOKEN: u64 = 16;
/// Protocol entry point caller used by `DEFAULT` and `VERIFY` frames.
pub const ENTRY_POINT: Address = new;
/// Address of the canonical expiry verifier.
pub const EXPIRY_VERIFIER: Address = new;
/// Calldata length, in bytes, for expiry verifier frames.
pub const EXPIRY_DATA_LENGTH: usize = 8;
/// Maximum number of frames in a frame transaction.
pub const MAX_FRAMES: usize = 64;
/// Order of the secp256k1 curve used by EIP-8141 signatures.
pub const SECP256K1N: U256 =
U256from_be_bytes;
/// Order of the NIST P-256 curve used by EIP-8141 signatures.
pub const SECP256R1N: U256 =
U256from_be_bytes;
/// Byte length of a secp256k1 signature entry: `v || r || s`.
pub const SECP256K1_SIGNATURE_LENGTH: usize = 65;
/// Byte length of a P-256 signature entry: `r || s || qx || qy`.
pub const P256_SIGNATURE_LENGTH: usize = 128;
/// Maximum validation work for public mempool admission.
pub const MAX_VERIFY_GAS: u64 = 100_000;
/// Maximum state gas budget across a public-mempool validation prefix.
pub const MAX_VERIFY_STATE_GAS: u64 = 500_000;
/// Maximum pending public-mempool transactions using any non-canonical paymaster.
pub const MAX_PENDING_TXS_USING_NON_CANONICAL_PAYMASTER: usize = 1;
/// Canonical expiry verifier runtime bytecode.
pub const EXPIRY_VERIFIER_RUNTIME: =
hex!;
/// Approval flag mask for extracting the allowed approval scope from frame flags.
pub const APPROVE_SCOPE_MASK: u8 = 0x03;
/// Atomic batch frame flag.
pub const ATOMIC_BATCH_FLAG: u8 = 0x04;
/// Mask of all currently defined frame flag bits.
pub const FRAME_FLAGS_MASK: u8 = APPROVE_SCOPE_MASK | ATOMIC_BATCH_FLAG;