Skip to content

Commit

Permalink
Merge branch '2.0' into timelock-expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoralf-M committed Dec 6, 2023
2 parents 2c772a2 + 9cd9121 commit 0526617
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions sdk/src/types/block/mana/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ use crate::types::block::{
pub struct ManaParameters {
/// The number of bits used to represent Mana.
pub(crate) bits_count: u8,
/// The amount of potential Mana generated by 1 IOTA in 1 slot.
/// The amount of potential Mana generated by 1 microIOTA in 1 slot multiplied by 2^generation_rate_exponent.
pub(crate) generation_rate: u8,
/// The scaling of `mana_generation_rate` expressed as an exponent of 2.
/// The scaling of `generation_rate` expressed as an exponent of 2.
/// The actual generation rate of Mana is given by generation_rate * 2^(-generation_rate_exponent).
pub(crate) generation_rate_exponent: u8,
/// A lookup table of epoch index diff to mana decay factor.
/// The actual decay factor is given by decay_factors[epoch_diff] * 2^(-decay_factors_exponent).
#[packable(unpack_error_with = |_| Error::InvalidManaDecayFactors)]
#[cfg_attr(feature = "serde", serde(with = "crate::utils::serde::boxed_slice_prefix"))]
#[getset(skip)]
Expand All @@ -34,8 +36,10 @@ pub struct ManaParameters {
pub(crate) decay_factors_exponent: u8,
/// An integer approximation of the sum of decay over epochs.
pub(crate) decay_factor_epochs_sum: u32,
/// The scaling of `mana_decay_factor_epochs_sum` expressed as an exponent of 2.
/// The scaling of `decay_factor_epochs_sum` expressed as an exponent of 2.
pub(crate) decay_factor_epochs_sum_exponent: u8,
// Decay factor for 1 year.
pub(crate) annual_decay_factor_percentage: u8,
}

impl ManaParameters {
Expand Down Expand Up @@ -99,6 +103,7 @@ impl Default for ManaParameters {
decay_factors_exponent: Default::default(),
decay_factor_epochs_sum: Default::default(),
decay_factor_epochs_sum_exponent: Default::default(),
annual_decay_factor_percentage: Default::default(),
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion sdk/src/types/block/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ pub struct ProtocolParameters {
/// Defines the target size of the committee. If there's fewer candidates the actual committee size could be
/// smaller in a given epoch.
pub(crate) target_committee_size: u8,
/// Defines the number of heavier slots that a chain needs to be ahead of the current chain to be considered for switching.
/// Defines the number of heavier slots that a chain needs to be ahead of the current chain to be considered for
/// switching.
pub(crate) chain_switching_threshold: u8,
}

Expand Down

0 comments on commit 0526617

Please sign in to comment.