mirror of
https://github.com/tig-foundation/tig-monorepo.git
synced 2026-02-21 10:27:49 +08:00
Move some config to be common across tracks.
This commit is contained in:
parent
1d4417d004
commit
c19fcbc1ff
@ -61,27 +61,27 @@ pub async fn submit_precommit<T: Context>(
|
||||
}
|
||||
let track_config = &challenge_config.active_tracks[&settings.track_id];
|
||||
|
||||
if num_bundles < track_config.min_num_bundles {
|
||||
if num_bundles < challenge_config.min_num_bundles {
|
||||
return Err(anyhow!(
|
||||
"Invalid num_bundles '{}'. Must be at least {}",
|
||||
num_bundles,
|
||||
track_config.min_num_bundles,
|
||||
challenge_config.min_num_bundles,
|
||||
));
|
||||
}
|
||||
|
||||
if runtime_config.max_memory > track_config.runtime_config_limits.max_memory {
|
||||
if runtime_config.max_memory > challenge_config.runtime_config_limits.max_memory {
|
||||
return Err(anyhow!(
|
||||
"Invalid runtime_config.max_memory '{}'. Must be <= {}",
|
||||
runtime_config.max_memory,
|
||||
track_config.runtime_config_limits.max_memory
|
||||
challenge_config.runtime_config_limits.max_memory
|
||||
));
|
||||
}
|
||||
|
||||
if runtime_config.max_fuel > track_config.runtime_config_limits.max_fuel {
|
||||
if runtime_config.max_fuel > challenge_config.runtime_config_limits.max_fuel {
|
||||
return Err(anyhow!(
|
||||
"Invalid runtime_config.max_fuel '{}'. Must be <= {}",
|
||||
runtime_config.max_fuel,
|
||||
track_config.runtime_config_limits.max_fuel
|
||||
challenge_config.runtime_config_limits.max_fuel
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@ -78,8 +78,6 @@ pub enum QualityType {
|
||||
serializable_struct_with_getters! {
|
||||
TrackConfig {
|
||||
num_nonces_per_bundle: u64,
|
||||
min_num_bundles: u64,
|
||||
runtime_config_limits: RuntimeConfig,
|
||||
min_active_quality: i32,
|
||||
}
|
||||
}
|
||||
@ -95,7 +93,9 @@ serializable_struct_with_getters! {
|
||||
per_nonce_fee: PreciseNumber,
|
||||
base_fee: PreciseNumber,
|
||||
active_tracks: HashMap<String, TrackConfig>,
|
||||
runtime_config_limits: RuntimeConfig,
|
||||
max_qualifiers_per_track: u64,
|
||||
min_num_bundles: u64,
|
||||
}
|
||||
}
|
||||
serializable_struct_with_getters! {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user