@@ -8,10 +8,23 @@ use serde::{Deserialize, Serialize};
8
8
9
9
use crate :: { leadership:: Leader , Cryptarchia , CryptarchiaSettings , Error } ;
10
10
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.
11
17
pub struct GenesisRecoveryStrategy {
12
18
pub tip : HeaderId ,
13
19
}
14
20
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.
15
28
pub struct SecurityRecoveryStrategy {
16
29
pub tip : HeaderId ,
17
30
pub security_block_id : HeaderId ,
@@ -20,6 +33,8 @@ pub struct SecurityRecoveryStrategy {
20
33
}
21
34
22
35
pub enum CryptarchiaInitialisationStrategy {
36
+ /// Indicates that there's no stored data so [`Cryptarchia`] should be built
37
+ /// from genesis.
23
38
Genesis ,
24
39
RecoveryFromGenesis ( GenesisRecoveryStrategy ) ,
25
40
RecoveryFromSecurity ( Box < SecurityRecoveryStrategy > ) ,
0 commit comments