Skip to main content

tempo_chainspec/
constants.rs

1//! Tempo constants shared by both the published surface and the reth-backed spec implementation.
2//!
3//! Gas-accounting constants are grouped under [`gas`].
4//! Hardfork activation schedules live in [`mainnet`] and [`moderato`].
5
6pub mod gas {
7    //! Gas-accounting constants shared with `spec.rs`.
8
9    use alloy_evm::revm::interpreter::gas::{
10        COLD_SLOAD_COST as COLD_SLOAD, SSTORE_SET, WARM_SSTORE_RESET,
11        WARM_STORAGE_READ_COST as WARM_SLOAD,
12    };
13
14    /// T0 base fee: 10 billion attodollars (1×10^10).
15    ///
16    /// Attodollars are the atomic gas accounting units at 10^-18 USD precision.
17    /// Basefee is denominated in attodollars.
18    pub const TEMPO_T0_BASE_FEE: u64 = 10_000_000_000;
19
20    /// T1 base fee: 20 billion attodollars (2×10^10).
21    ///
22    /// Attodollars are the atomic gas accounting units at 10^-18 USD precision.
23    /// Basefee is denominated in attodollars.
24    ///
25    /// At this basefee, a standard TIP-20 transfer (~50,000 gas) costs:
26    /// - Gas: 50,000 × 20 billion attodollars/gas = 1 quadrillion attodollars
27    /// - Tokens: 1 quadrillion attodollars / 10^12 = 1,000 microdollars
28    /// - Economic: 1,000 microdollars = 0.001 USD = 0.1 cents
29    pub const TEMPO_T1_BASE_FEE: u64 = 20_000_000_000;
30
31    /// [TIP-1010] general (non-payment) gas limit: 30 million gas per block.
32    /// Cap for non-payment transactions.
33    ///
34    /// [TIP-1010]: <https://docs.tempo.xyz/protocol/tips/tip-1010>
35    pub const TEMPO_T1_GENERAL_GAS_LIMIT: u64 = 30_000_000;
36
37    /// TIP-1010 per-transaction gas limit cap: 30 million gas.
38    /// Allows maximum-sized contract deployments under [TIP-1000] state creation costs.
39    ///
40    /// [TIP-1000]: <https://docs.tempo.xyz/protocol/tips/tip-1000>
41    pub const TEMPO_T1_TX_GAS_LIMIT_CAP: u64 = 30_000_000;
42
43    /// Gas cost for using an existing 2D nonce key (cold SLOAD + warm SSTORE reset).
44    pub const TEMPO_T1_EXISTING_NONCE_KEY_GAS: u64 = COLD_SLOAD + WARM_SSTORE_RESET;
45    /// T2 adds 2 warm SLOADs for the extended nonce key lookup.
46    pub const TEMPO_T2_EXISTING_NONCE_KEY_GAS: u64 =
47        TEMPO_T1_EXISTING_NONCE_KEY_GAS + 2 * WARM_SLOAD;
48
49    /// Gas cost for using a new 2D nonce key (cold SLOAD + SSTORE set for 0 -> non-zero).
50    pub const TEMPO_T1_NEW_NONCE_KEY_GAS: u64 = COLD_SLOAD + SSTORE_SET;
51    /// T2 adds 2 warm SLOADs for the extended nonce key lookup.
52    pub const TEMPO_T2_NEW_NONCE_KEY_GAS: u64 = TEMPO_T1_NEW_NONCE_KEY_GAS + 2 * WARM_SLOAD;
53}
54
55pub mod mainnet {
56    //! Tempo mainnet (Presto) hardfork activation constants.
57
58    /// Genesis activation block.
59    pub const MAINNET_GENESIS_BLOCK: u64 = 0;
60    /// Genesis activation timestamp.
61    pub const MAINNET_GENESIS_TIMESTAMP: u64 = 0;
62
63    /// T0 activation block (active from genesis).
64    pub const MAINNET_T0_BLOCK: u64 = 0;
65    /// T0 activation timestamp (active from genesis).
66    pub const MAINNET_T0_TIMESTAMP: u64 = 0;
67
68    /// T1 activation block.
69    pub const MAINNET_T1_BLOCK: u64 = 4_494_230;
70    /// T1 activation timestamp (Feb 12th 2026 15:00 UTC).
71    pub const MAINNET_T1_TIMESTAMP: u64 = 1_770_908_400;
72
73    /// T1A activation block (same as T1 on mainnet).
74    pub const MAINNET_T1A_BLOCK: u64 = MAINNET_T1_BLOCK;
75    /// T1A activation timestamp (same as T1 on mainnet).
76    pub const MAINNET_T1A_TIMESTAMP: u64 = MAINNET_T1_TIMESTAMP;
77
78    /// T1B activation block.
79    pub const MAINNET_T1B_BLOCK: u64 = 6_253_936;
80    /// T1B activation timestamp (Feb 23rd 2026 15:00 UTC).
81    pub const MAINNET_T1B_TIMESTAMP: u64 = 1_771_858_800;
82
83    /// T1C activation block.
84    pub const MAINNET_T1C_BLOCK: u64 = 8_967_991;
85    /// T1C activation timestamp (Mar 12th 2026 15:00 UTC).
86    pub const MAINNET_T1C_TIMESTAMP: u64 = 1_773_327_600;
87
88    /// T2 activation block.
89    pub const MAINNET_T2_BLOCK: u64 = 12_286_033;
90    /// T2 activation timestamp (Mar 31st 2026 14:00 UTC).
91    pub const MAINNET_T2_TIMESTAMP: u64 = 1_774_965_600;
92
93    /// T3 activation timestamp (Apr 27th 2026 14:00 UTC).
94    pub const MAINNET_T3_TIMESTAMP: u64 = 1_777_298_400;
95
96    /// T4 activation timestamp (May 18th 2026 14:00 UTC).
97    pub const MAINNET_T4_TIMESTAMP: u64 = 1_779_112_800;
98}
99
100pub mod moderato {
101    //! Moderato testnet hardfork activation constants.
102
103    /// Genesis activation block.
104    pub const MODERATO_GENESIS_BLOCK: u64 = 0;
105    /// Genesis activation timestamp.
106    pub const MODERATO_GENESIS_TIMESTAMP: u64 = 0;
107
108    /// T0 activation block (same as T1 on moderato).
109    pub const MODERATO_T0_BLOCK: u64 = 3_767_359;
110    /// T0 activation timestamp (Feb 5th 2026 15:00 UTC).
111    pub const MODERATO_T0_TIMESTAMP: u64 = 1_770_303_600;
112
113    /// T1 activation block (same as T0 on moderato).
114    pub const MODERATO_T1_BLOCK: u64 = MODERATO_T0_BLOCK;
115    /// T1 activation timestamp (same as T0 on moderato).
116    pub const MODERATO_T1_TIMESTAMP: u64 = MODERATO_T0_TIMESTAMP;
117
118    /// T1A activation block (same as T1B on moderato).
119    pub const MODERATO_T1A_BLOCK: u64 = 6_033_587;
120    /// T1A activation timestamp (Feb 23rd 2026 15:00 UTC).
121    pub const MODERATO_T1A_TIMESTAMP: u64 = 1_771_858_800;
122
123    /// T1B activation block (same as T1A on moderato).
124    pub const MODERATO_T1B_BLOCK: u64 = MODERATO_T1A_BLOCK;
125    /// T1B activation timestamp (same as T1A on moderato).
126    pub const MODERATO_T1B_TIMESTAMP: u64 = MODERATO_T1A_TIMESTAMP;
127
128    /// T1C activation block.
129    pub const MODERATO_T1C_BLOCK: u64 = 7_768_256;
130    /// T1C activation timestamp (Mar 9th 2026 15:00 UTC).
131    pub const MODERATO_T1C_TIMESTAMP: u64 = 1_773_068_400;
132
133    /// T2 activation block.
134    pub const MODERATO_T2_BLOCK: u64 = 10_072_242;
135    /// T2 activation timestamp (Mar 26th 2026 14:00 UTC).
136    pub const MODERATO_T2_TIMESTAMP: u64 = 1_774_537_200;
137
138    /// T3 activation timestamp (Apr 21st 2026 14:00 UTC).
139    pub const MODERATO_T3_TIMESTAMP: u64 = 1_776_780_000;
140
141    /// T4 activation timestamp (May 14th 2026 14:00 UTC).
142    pub const MODERATO_T4_TIMESTAMP: u64 = 1_778_767_200;
143}