massa_consensus_exports/
block_graph_export.rs

1use massa_models::{
2    address::Address,
3    block_id::BlockId,
4    clique::Clique,
5    prehash::{PreHashMap, PreHashSet},
6    slot::Slot,
7};
8
9use crate::block_status::{DiscardReason, ExportCompiledBlock};
10
11/// Bootstrap compatible version of the block graph
12#[derive(Debug, Clone)]
13#[allow(clippy::type_complexity)]
14pub struct BlockGraphExport {
15    /// Genesis blocks.
16    pub genesis_blocks: Vec<BlockId>,
17    /// Map of active blocks, were blocks are in their exported version.
18    pub active_blocks: PreHashMap<BlockId, ExportCompiledBlock>,
19    /// Finite cache of discarded blocks, in exported version `(slot, creator_address, parents)`.
20    pub discarded_blocks: PreHashMap<BlockId, (DiscardReason, (Slot, Address, Vec<BlockId>))>,
21    /// Best parents hashes in each thread.
22    pub best_parents: Vec<(BlockId, u64)>,
23    /// Latest final period and block hash in each thread.
24    pub latest_final_blocks_periods: Vec<(BlockId, u64)>,
25    /// Head of the incompatibility graph.
26    pub gi_head: PreHashMap<BlockId, PreHashSet<BlockId>>,
27    /// List of maximal cliques of compatible blocks.
28    pub max_cliques: Vec<Clique>,
29}