Skip to content

Commit c151fbc

Browse files
Add documentation and PR suggestions.
1 parent b6568e3 commit c151fbc

File tree

1 file changed

+15
-0
lines changed
  • nomos-services/cryptarchia-consensus/src

1 file changed

+15
-0
lines changed

nomos-services/cryptarchia-consensus/src/states.rs

+15
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,23 @@ use serde::{Deserialize, Serialize};
88

99
use crate::{leadership::Leader, Cryptarchia, CryptarchiaSettings, Error};
1010

11+
/// Indicates that there's stored data so [`Cryptarchia`] should be recovered.
12+
/// However, the number of stored epochs is fewer than
13+
/// [`Config::security_param`](cryptarchia_engine::config::Config).
14+
///
15+
/// As a result, a [`Cryptarchia`](cryptarchia_engine::Cryptarchia) instance
16+
/// must first be built from genesis and then recovered up to the `tip` epoch.
1117
pub struct GenesisRecoveryStrategy {
1218
pub tip: HeaderId,
1319
}
1420

21+
/// Indicates that there's stored data so [`Cryptarchia`] should be recovered,
22+
/// and the number of stored epochs is larger than
23+
/// [`Config::security_param`](cryptarchia_engine::config::Config).
24+
///
25+
/// As a result, a [`Cryptarchia`](cryptarchia_engine::Cryptarchia) instance
26+
/// must first be built from the security state and then recovered up to the
27+
/// `tip` epoch.
1528
pub struct SecurityRecoveryStrategy {
1629
pub tip: HeaderId,
1730
pub security_block_id: HeaderId,
@@ -20,6 +33,8 @@ pub struct SecurityRecoveryStrategy {
2033
}
2134

2235
pub enum CryptarchiaInitialisationStrategy {
36+
/// Indicates that there's no stored data so [`Cryptarchia`] should be built
37+
/// from genesis.
2338
Genesis,
2439
RecoveryFromGenesis(GenesisRecoveryStrategy),
2540
RecoveryFromSecurity(Box<SecurityRecoveryStrategy>),

0 commit comments

Comments
 (0)