mirror of
https://github.com/tig-foundation/tig-monorepo.git
synced 2026-02-21 10:27:49 +08:00
Allow each challenge to define its own min gap between frontiers.
This commit is contained in:
parent
430779c512
commit
b4ff12f4e0
@ -674,8 +674,9 @@ async fn update_frontiers<T: Context>(ctx: &mut T, block: &Block) {
|
||||
|
||||
let scaling_factor = *block_data.num_qualifiers() as f64
|
||||
/ config.qualifiers.total_qualifiers_threshold as f64;
|
||||
let (scaling_factor, base_frontier) = match config.difficulty.min_frontiers_gap {
|
||||
Some(min_gap) => {
|
||||
let (scaling_factor, base_frontier) = match &config.difficulty.min_frontiers_gaps {
|
||||
Some(min_gaps) => {
|
||||
let min_gap = min_gaps[&challenge.id];
|
||||
if scaling_factor >= 1.0 {
|
||||
(
|
||||
(scaling_factor / (1.0 - min_gap))
|
||||
|
||||
@ -75,7 +75,7 @@ impl MinMaxDifficulty for Vec<DifficultyParameter> {
|
||||
serializable_struct_with_getters! {
|
||||
DifficultyConfig {
|
||||
max_scaling_factor: f64,
|
||||
min_frontiers_gap: Option<f64>,
|
||||
min_frontiers_gaps: Option<HashMap<String, f64>>,
|
||||
parameters: HashMap<String, Vec<DifficultyParameter>>,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user