Remove superflous parameter overseer_enable_anyways and make parachain node type more explicit (#7617)

* Remove superflous parameter `overseer_enable_anyways`

We don't need this flag, as we don't need the overseer enabled when the
node isn't a collator or validator.

* Rename `IsCollator` to `IsParachainNode`

`IsParachainNode` is more expressive and also encapsulates the state of
the parachain node being a full node. Some functionality like the
overseer needs to run always when the node runs alongside a parachain
node. The parachain node needs the overseer to e.g. recover PoVs. Other
things like candidate validation or pvf checking are only required for
when the node is running as validator.

* FMT

* Fix CI
This commit is contained in:
Bastian Köcher
2023-08-15 10:51:27 +02:00
committed by GitHub
parent e9c6c72f5a
commit cf3271fea2
16 changed files with 148 additions and 130 deletions
@@ -1244,28 +1244,27 @@ impl<T: Config> Pallet<T> {
) -> DispatchResult {
let mut pending_configs = <PendingConfigs<T>>::get();
// 1. pending_configs = []
// No pending configuration changes.
// 1. pending_configs = [] No pending configuration changes.
//
// That means we should use the active config as the base configuration. We will insert
// the new pending configuration as (cur+2, new_config) into the list.
//
// 2. pending_configs = [(cur+2, X)]
// There is a configuration that is pending for the scheduled session.
// 2. pending_configs = [(cur+2, X)] There is a configuration that is pending for the
// scheduled session.
//
// We will use X as the base configuration. We can update the pending configuration X
// directly.
//
// 3. pending_configs = [(cur+1, X)]
// There is a pending configuration scheduled and it will be applied in the next session.
// 3. pending_configs = [(cur+1, X)] There is a pending configuration scheduled and it will
// be applied in the next session.
//
// We will use X as the base configuration. We need to schedule a new configuration
// change for the `scheduled_session` and use X as the base for the new configuration.
//
// 4. pending_configs = [(cur+1, X), (cur+2, Y)]
// There is a pending configuration change in the next session and for the scheduled
// session. Due to case №3, we can be sure that Y is based on top of X. This means we
// can use Y as the base configuration and update Y directly.
// 4. pending_configs = [(cur+1, X), (cur+2, Y)] There is a pending configuration change in
// the next session and for the scheduled session. Due to case №3, we can be sure that Y
// is based on top of X. This means we can use Y as the base configuration and update Y
// directly.
//
// There cannot be (cur, X) because those are applied in the session change handler for the
// current session.
@@ -977,8 +977,8 @@ fn compute_entropy<T: Config>(parent_hash: T::Hash) -> [u8; 32] {
/// 2. If exceeded:
/// 1. Check validity of all dispute statements sequentially
/// 2. If not exceeded:
/// 1. If weight is exceeded by locals, pick the older ones (lower indices)
/// until the weight limit is reached.
/// 1. If weight is exceeded by locals, pick the older ones (lower indices) until the weight limit
/// is reached.
///
/// Returns the consumed weight amount, that is guaranteed to be less than the provided
/// `max_consumable_weight`.
@@ -23,8 +23,7 @@
//! will contain methods from `vstaging`.
//! The promotion consists of the following steps:
//! 1. Bump the version of the stable module (e.g. `v2` becomes `v3`)
//! 2. Move methods from `vstaging` to `v3`. The new stable version should include
//! all methods from `vstaging` tagged with the new version number (e.g. all
//! `v3` methods).
//! 2. Move methods from `vstaging` to `v3`. The new stable version should include all methods from
//! `vstaging` tagged with the new version number (e.g. all `v3` methods).
pub mod v5;
pub mod vstaging;