mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41: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:
@@ -190,8 +190,16 @@ struct AttestingData {
|
||||
backing: Vec<ValidatorIndex>,
|
||||
}
|
||||
|
||||
const fn group_quorum(n_validators: usize) -> usize {
|
||||
(n_validators / 2) + 1
|
||||
/// How many votes we need to consider a candidate backed.
|
||||
fn minimum_votes(n_validators: usize) -> usize {
|
||||
// Runtime change going live, see: https://github.com/paritytech/polkadot/pull/4437
|
||||
let old_runtime_value = n_validators / 2 + 1;
|
||||
let new_runtime_value = std::cmp::min(2, n_validators);
|
||||
|
||||
// Until new runtime is live everywhere and we don't yet have
|
||||
// https://github.com/paritytech/polkadot/issues/4576, we want to err on the higher value for
|
||||
// secured block production:
|
||||
std::cmp::max(old_runtime_value, new_runtime_value)
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
@@ -223,7 +231,7 @@ impl TableContextTrait for TableContext {
|
||||
}
|
||||
|
||||
fn requisite_votes(&self, group: &ParaId) -> usize {
|
||||
self.groups.get(group).map_or(usize::MAX, |g| group_quorum(g.len()))
|
||||
self.groups.get(group).map_or(usize::MAX, |g| minimum_votes(g.len()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user