mirror of
https://github.com/tig-foundation/tig-monorepo.git
synced 2026-02-21 10:27:49 +08:00
Move gamma magic numbers to config.
Some checks are pending
Test Workspace / Test Workspace (push) Waiting to run
Some checks are pending
Test Workspace / Test Workspace (push) Waiting to run
This commit is contained in:
parent
381d5f5b15
commit
a5ca085d6e
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user