mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 09:51:02 +00:00
* First step in implementing https://github.com/paritytech/polkadot/issues/4386 This PR: - Reduces MAX_UNSHARED_UPLOAD_TIME to 150ms - Increases timeout on collation fetching to 1200ms - Reduces limit on needed backing votes in the runtime This PR does not yet reduce the number of needed backing votes on the node as this can only be meaningfully enacted once the changed limit in the runtime is live. * Fix tests. * Guide updates. * Review remarks. * Bump minimum required backing votes to 2 in runtime. * Make sure node side code won't make runtime vomit. * cargo +nightly fmt
This commit is contained in:
@@ -169,6 +169,15 @@ impl<H> Default for ProcessedCandidates<H> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Number of backing votes we need for a valid backing.
|
||||
pub fn minimum_backing_votes(n_validators: usize) -> usize {
|
||||
// For considerations on this value see:
|
||||
// https://github.com/paritytech/polkadot/pull/1656#issuecomment-999734650
|
||||
// and
|
||||
// https://github.com/paritytech/polkadot/issues/4386
|
||||
sp_std::cmp::min(n_validators, 2)
|
||||
}
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
@@ -578,7 +587,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
match maybe_amount_validated {
|
||||
Ok(amount_validated) => ensure!(
|
||||
amount_validated * 2 > group_vals.len(),
|
||||
amount_validated >= minimum_backing_votes(group_vals.len()),
|
||||
Error::<T>::InsufficientBacking,
|
||||
),
|
||||
Err(()) => {
|
||||
|
||||
Reference in New Issue
Block a user