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
//! Genesis types.

use crate::BlockID;
use crate::SystemConfig;
use alloy_primitives::Bytes;
use hashbrown::HashMap;

/// Map of chain IDs to their chain's genesis system configurations.
pub type GenesisSystemConfigs = HashMap<u64, SystemConfig>;

/// Chain genesis information.
#[derive(Debug, Clone, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ChainGenesis {
    /// L1 genesis block
    pub l1: BlockID,
    /// L2 genesis block
    pub l2: BlockID,
    /// Timestamp of the L2 genesis block
    pub l2_time: u64,
    /// Extra data for the genesis block
    pub extra_data: Option<Bytes>,
    /// Optional System configuration
    pub system_config: Option<SystemConfig>,
}