mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 05:11:02 +00:00
backing: move the min votes threshold to the runtime (#1200)
* move min backing votes const to runtime also cache it per-session in the backing subsystem Signed-off-by: alindima <alin@parity.io> * add runtime migration * introduce api versioning for min_backing votes also enable it for rococo/versi for testing * also add min_backing_votes runtime calls to statement-distribution this dependency has been recently introduced by async backing * remove explicit version runtime API call this is not needed, as the RuntimeAPISubsystem already takes care of versioning and will return NotSupported if the version is not right. * address review comments - parametrise backing votes runtime API with session index - remove RuntimeInfo usage in backing subsystem, as runtime API caches the min backing votes by session index anyway. - move the logic for adjusting the configured needed backing votes with the size of the backing group to a primitives helper. - move the legacy min backing votes value to a primitives helper. - mark JoinMultiple error as fatal, since the Canceled (non-multiple) counterpart is also fatal. - make backing subsystem handle fatal errors for new leaves update. - add HostConfiguration consistency check for zeroed backing votes threshold - add cumulus accompanying change * fix cumulus test compilation * fix tests * more small fixes * fix merge * bump runtime api version for westend and rollback version for rococo --------- Signed-off-by: alindima <alin@parity.io> Co-authored-by: Javier Viola <javier@parity.io>
This commit is contained in:
@@ -317,6 +317,7 @@ fn setting_pending_config_members() {
|
||||
on_demand_fee_variability: Perbill::from_percent(3),
|
||||
on_demand_target_queue_utilization: Perbill::from_percent(25),
|
||||
on_demand_ttl: 5u32,
|
||||
minimum_backing_votes: 5,
|
||||
};
|
||||
|
||||
Configuration::set_validation_upgrade_cooldown(
|
||||
@@ -467,6 +468,11 @@ fn setting_pending_config_members() {
|
||||
.unwrap();
|
||||
Configuration::set_pvf_voting_ttl(RuntimeOrigin::root(), new_config.pvf_voting_ttl)
|
||||
.unwrap();
|
||||
Configuration::set_minimum_backing_votes(
|
||||
RuntimeOrigin::root(),
|
||||
new_config.minimum_backing_votes,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(PendingConfigs::<Test>::get(), vec![(shared::SESSION_DELAY, new_config)],);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user