Move gamma magic numbers to config.
Some checks are pending
Test Workspace / Test Workspace (push) Waiting to run

This commit is contained in:
FiveMovesAhead 2025-10-09 11:53:01 +01:00
parent 381d5f5b15
commit a5ca085d6e
2 changed files with 12 additions and 2 deletions

View File

@ -26,8 +26,10 @@ pub(crate) async fn update(cache: &mut AddBlockCache) {
let active_challenge_ids = &block_data.active_ids[&ActiveType::Challenge];
let zero = PreciseNumber::from(0);
block_details.gamma_value =
1.0258 * (1.0 - 0.8730 * (-0.0354 * active_challenge_ids.len() as f64).exp());
block_details.gamma_value = config.rewards.gamma.a
* (1.0
- config.rewards.gamma.b
* (-config.rewards.gamma.c * active_challenge_ids.len() as f64).exp());
let block_reward = PreciseNumber::from_f64(
config
.rewards

View File

@ -120,10 +120,18 @@ serializable_struct_with_getters! {
}
serializable_struct_with_getters! {
RewardsConfig {
gamma: GammaConfig,
distribution: DistributionConfig,
schedule: Vec<EmissionsConfig>,
}
}
serializable_struct_with_getters! {
GammaConfig {
a: f64,
b: f64,
c: f64,
}
}
serializable_struct_with_getters! {
DistributionConfig {
opow: f64,