@@ -50,12 +50,13 @@ pub enum SignedEntityType {
50
50
///
51
51
#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
52
52
pub struct CardanoTransactionsSigningConfig {
53
- /// Number of blocks to wait before taking in account a transaction .
53
+ /// Number of blocks to discard from the tip of the chain when importing transactions .
54
54
pub security_parameter : BlockNumber ,
55
55
56
- /// The frequency at which the transactions are signed .
56
+ /// The number of blocks between signature of the transactions .
57
57
///
58
- /// *Note: The step is adjusted to be a multiple of the block range length in order.*
58
+ /// *Note: The step is adjusted to be a multiple of the block range length in order
59
+ /// to guarantee that the block number signed in a certificate is effectively signed.*
59
60
pub step : BlockNumber ,
60
61
}
61
62
@@ -70,12 +71,16 @@ impl CardanoTransactionsSigningConfig {
70
71
}
71
72
}
72
73
73
- /// Compute the block number to be signed based on che chain tip block number.
74
+ /// Compute the block number to be signed based on the chain tip block number.
75
+ ///
76
+ /// The latest block number to be signed is the highest multiple of the step less or equal than the
77
+ /// block number minus the security parameter.
78
+ ///
79
+ /// The formula is as follows:
74
80
///
75
- /// Given k' = `security_parameter` and n = `step`,
76
- /// the latest block number to be signed is computed as *(this use a integer division)*:
81
+ /// `block_number = ⌊(tip.block_number - security_parameter) / step⌋ × step`
77
82
///
78
- /// **block_number = ((tip.block_number - k') / n) × n**
83
+ /// where `⌊x⌋` is the floor function which rounds to the greatest integer less than or equal to `x`.
79
84
///
80
85
/// *Note: The step is adjusted to be a multiple of the block range length in order
81
86
/// to guarantee that the block number signed in a certificate is effectively signed.*
0 commit comments