1. Mar 13, 2024
  2. Mar 07, 2024
  3. Mar 04, 2024
    • Gavin Wood's avatar
      FRAME: Create `TransactionExtension` as a replacement for `SignedExtension` (#2280) · fd5f9292
      Gavin Wood authored
      Closes #2160
      
      First part of [Extrinsic
      Horizon](https://github.com/paritytech/polkadot-sdk/issues/2415
      
      )
      
      Introduces a new trait `TransactionExtension` to replace
      `SignedExtension`. Introduce the idea of transactions which obey the
      runtime's extensions and have according Extension data (né Extra data)
      yet do not have hard-coded signatures.
      
      Deprecate the terminology of "Unsigned" when used for
      transactions/extrinsics owing to there now being "proper" unsigned
      transactions which obey the extension framework and "old-style" unsigned
      which do not. Instead we have __*General*__ for the former and
      __*Bare*__ for the latter. (Ultimately, the latter will be phased out as
      a type of transaction, and Bare will only be used for Inherents.)
      
      Types of extrinsic are now therefore:
      - Bare (no hardcoded signature, no Extra data; used to be known as
      "Unsigned")
      - Bare transactions (deprecated): Gossiped, validated with
      `ValidateUnsigned` (deprecated) and the `_bare_compat` bits of
      `TransactionExtension` (deprecated).
        - Inherents: Not gossiped, validated with `ProvideInherent`.
      - Extended (Extra data): Gossiped, validated via `TransactionExtension`.
        - Signed transactions (with a hardcoded signature).
        - General transactions (without a hardcoded signature).
      
      `TransactionExtension` differs from `SignedExtension` because:
      - A signature on the underlying transaction may validly not be present.
      - It may alter the origin during validation.
      - `pre_dispatch` is renamed to `prepare` and need not contain the checks
      present in `validate`.
      - `validate` and `prepare` is passed an `Origin` rather than a
      `AccountId`.
      - `validate` may pass arbitrary information into `prepare` via a new
      user-specifiable type `Val`.
      - `AdditionalSigned`/`additional_signed` is renamed to
      `Implicit`/`implicit`. It is encoded *for the entire transaction* and
      passed in to each extension as a new argument to `validate`. This
      facilitates the ability of extensions to acts as underlying crypto.
      
      There is a new `DispatchTransaction` trait which contains only default
      function impls and is impl'ed for any `TransactionExtension` impler. It
      provides several utility functions which reduce some of the tedium from
      using `TransactionExtension` (indeed, none of its regular functions
      should now need to be called directly).
      
      Three transaction version discriminator ("versions") are now
      permissible:
      - 0b000000100: Bare (used to be called "Unsigned"): contains Signature
      or Extra (extension data). After bare transactions are no longer
      supported, this will strictly identify an Inherents only.
      - 0b100000100: Old-school "Signed" Transaction: contains Signature and
      Extra (extension data).
      - 0b010000100: New-school "General" Transaction: contains Extra
      (extension data), but no Signature.
      
      For the New-school General Transaction, it becomes trivial for authors
      to publish extensions to the mechanism for authorizing an Origin, e.g.
      through new kinds of key-signing schemes, ZK proofs, pallet state,
      mutations over pre-authenticated origins or any combination of the
      above.
      
      ## Code Migration
      
      ### NOW: Getting it to build
      
      Wrap your `SignedExtension`s in `AsTransactionExtension`. This should be
      accompanied by renaming your aggregate type in line with the new
      terminology. E.g. Before:
      
      ```rust
      /// The SignedExtension to the basic transaction logic.
      pub type SignedExtra = (
      	/* snip */
      	MySpecialSignedExtension,
      );
      /// Unchecked extrinsic type as expected by this runtime.
      pub type UncheckedExtrinsic =
      	generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
      ```
      
      After:
      
      ```rust
      /// The extension to the basic transaction logic.
      pub type TxExtension = (
      	/* snip */
      	AsTransactionExtension<MySpecialSignedExtension>,
      );
      /// Unchecked extrinsic type as expected by this runtime.
      pub type UncheckedExtrinsic =
      	generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
      ```
      
      You'll also need to alter any transaction building logic to add a
      `.into()` to make the conversion happen. E.g. Before:
      
      ```rust
      fn construct_extrinsic(
      		/* snip */
      ) -> UncheckedExtrinsic {
      	let extra: SignedExtra = (
      		/* snip */
      		MySpecialSignedExtension::new(/* snip */),
      	);
      	let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
      	let signature = payload.using_encoded(|e| sender.sign(e));
      	UncheckedExtrinsic::new_signed(
      		/* snip */
      		Signature::Sr25519(signature),
      		extra,
      	)
      }
      ```
      
      After:
      
      ```rust
      fn construct_extrinsic(
      		/* snip */
      ) -> UncheckedExtrinsic {
      	let tx_ext: TxExtension = (
      		/* snip */
      		MySpecialSignedExtension::new(/* snip */).into(),
      	);
      	let payload = SignedPayload::new(call.clone(), tx_ext.clone()).unwrap();
      	let signature = payload.using_encoded(|e| sender.sign(e));
      	UncheckedExtrinsic::new_signed(
      		/* snip */
      		Signature::Sr25519(signature),
      		tx_ext,
      	)
      }
      ```
      
      ### SOON: Migrating to `TransactionExtension`
      
      Most `SignedExtension`s can be trivially converted to become a
      `TransactionExtension`. There are a few things to know.
      
      - Instead of a single trait like `SignedExtension`, you should now
      implement two traits individually: `TransactionExtensionBase` and
      `TransactionExtension`.
      - Weights are now a thing and must be provided via the new function `fn
      weight`.
      
      #### `TransactionExtensionBase`
      
      This trait takes care of anything which is not dependent on types
      specific to your runtime, most notably `Call`.
      
      - `AdditionalSigned`/`additional_signed` is renamed to
      `Implicit`/`implicit`.
      - Weight must be returned by implementing the `weight` function. If your
      extension is associated with a pallet, you'll probably want to do this
      via the pallet's existing benchmarking infrastructure.
      
      #### `TransactionExtension`
      
      Generally:
      - `pre_dispatch` is now `prepare` and you *should not reexecute the
      `validate` functionality in there*!
      - You don't get an account ID any more; you get an origin instead. If
      you need to presume an account ID, then you can use the trait function
      `AsSystemOriginSigner::as_system_origin_signer`.
      - You get an additional ticket, similar to `Pre`, called `Val`. This
      defines data which is passed from `validate` into `prepare`. This is
      important since you should not be duplicating logic from `validate` to
      `prepare`, you need a way of passing your working from the former into
      the latter. This is it.
      - This trait takes two type parameters: `Call` and `Context`. `Call` is
      the runtime call type which used to be an associated type; you can just
      move it to become a type parameter for your trait impl. `Context` is not
      currently used and you can safely implement over it as an unbounded
      type.
      - There's no `AccountId` associated type any more. Just remove it.
      
      Regarding `validate`:
      - You get three new parameters in `validate`; all can be ignored when
      migrating from `SignedExtension`.
      - `validate` returns a tuple on success; the second item in the tuple is
      the new ticket type `Self::Val` which gets passed in to `prepare`. If
      you use any information extracted during `validate` (off-chain and
      on-chain, non-mutating) in `prepare` (on-chain, mutating) then you can
      pass it through with this. For the tuple's last item, just return the
      `origin` argument.
      
      Regarding `prepare`:
      - This is renamed from `pre_dispatch`, but there is one change:
      - FUNCTIONALITY TO VALIDATE THE TRANSACTION NEED NOT BE DUPLICATED FROM
      `validate`!!
      - (This is different to `SignedExtension` which was required to run the
      same checks in `pre_dispatch` as in `validate`.)
      
      Regarding `post_dispatch`:
      - Since there are no unsigned transactions handled by
      `TransactionExtension`, `Pre` is always defined, so the first parameter
      is `Self::Pre` rather than `Option<Self::Pre>`.
      
      If you make use of `SignedExtension::validate_unsigned` or
      `SignedExtension::pre_dispatch_unsigned`, then:
      - Just use the regular versions of these functions instead.
      - Have your logic execute in the case that the `origin` is `None`.
      - Ensure your transaction creation logic creates a General Transaction
      rather than a Bare Transaction; this means having to include all
      `TransactionExtension`s' data.
      - `ValidateUnsigned` can still be used (for now) if you need to be able
      to construct transactions which contain none of the extension data,
      however these will be phased out in stage 2 of the Transactions Horizon,
      so you should consider moving to an extension-centric design.
      
      ## TODO
      
      - [x] Introduce `CheckSignature` impl of `TransactionExtension` to
      ensure it's possible to have crypto be done wholly in a
      `TransactionExtension`.
      - [x] Deprecate `SignedExtension` and move all uses in codebase to
      `TransactionExtension`.
        - [x] `ChargeTransactionPayment`
        - [x] `DummyExtension`
        - [x] `ChargeAssetTxPayment` (asset-tx-payment)
        - [x] `ChargeAssetTxPayment` (asset-conversion-tx-payment)
        - [x] `CheckWeight`
        - [x] `CheckTxVersion`
        - [x] `CheckSpecVersion`
        - [x] `CheckNonce`
        - [x] `CheckNonZeroSender`
        - [x] `CheckMortality`
        - [x] `CheckGenesis`
        - [x] `CheckOnlySudoAccount`
        - [x] `WatchDummy`
        - [x] `PrevalidateAttests`
        - [x] `GenericSignedExtension`
        - [x] `SignedExtension` (chain-polkadot-bulletin)
        - [x] `RefundSignedExtensionAdapter`
      - [x] Implement `fn weight` across the board.
      - [ ] Go through all pre-existing extensions which assume an account
      signer and explicitly handle the possibility of another kind of origin.
      - [x] `CheckNonce` should probably succeed in the case of a non-account
      origin.
      - [x] `CheckNonZeroSender` should succeed in the case of a non-account
      origin.
      - [x] `ChargeTransactionPayment` and family should fail in the case of a
      non-account origin.
        - [ ] 
      - [x] Fix any broken tests.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarNikhil Gupta <[email protected]>
      Co-authored-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: default avatarChevdor <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarMaciej <[email protected]>
      Co-authored-by: default avatarJavier Viola <[email protected]>
      Co-authored-by: default avatarMarcin S. <[email protected]>
      Co-authored-by: default avatarTsvetomir Dimitrov <[email protected]>
      Co-authored-by: default avatarJavier Bullrich <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: Vladimir Istyufeev's avatarVladimir Istyufeev <[email protected]>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarSvyatoslav Nikolsky <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarAlexander Samusev <[email protected]>
      Co-authored-by: default avatarJulian Eager <[email protected]>
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      Co-authored-by: default avataryjh <[email protected]>
      Co-authored-by: default avatarTom Mi <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      Co-authored-by: default avatarWill | Paradox | ParaNodes.io <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarPG Herveou <[email protected]>
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarJuan Girini <[email protected]>
      Co-authored-by: default avatarbader y <[email protected]>
      Co-authored-by: default avatarJames Wilson <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarasynchronous rob <[email protected]>
      Co-authored-by: default avatarParth <[email protected]>
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      Co-authored-by: default avatarJonathan Udd <[email protected]>
      Co-authored-by: default avatarSerban Iorga <[email protected]>
      Co-authored-by: default avatarEgor_P <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarEvgeny Snitko <[email protected]>
      Co-authored-by: default avatarJust van Stam <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatargupnik <[email protected]>
      Co-authored-by: default avatardzmitry-lahoda <[email protected]>
      Co-authored-by: default avatarzhiqiangxu <[email protected]>
      Co-authored-by: default avatarNazar Mokrynskyi <[email protected]>
      Co-authored-by: default avatarAnwesh <[email protected]>
      Co-authored-by: default avatarcheme <[email protected]>
      Co-authored-by: default avatarSam Johnson <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarJegor Sidorenko <[email protected]>
      Co-authored-by: default avatarMuharem <[email protected]>
      Co-authored-by: default avatarjoepetrowski <[email protected]>
      Co-authored-by: default avatarAlexandru Gheorghe <[email protected]>
      Co-authored-by: default avatarGabriel Facco de Arruda <[email protected]>
      Co-authored-by: default avatarSquirrel <[email protected]>
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: command-bot <>
      fd5f9292
  4. Feb 28, 2024
    • Oliver Tale-Yazdi's avatar
      Multi-Block-Migrations, `poll` hook and new System callbacks (#1781) · eefd5fe4
      Oliver Tale-Yazdi authored
      This MR is the merge of
      https://github.com/paritytech/substrate/pull/14414 and
      https://github.com/paritytech/substrate/pull/14275. It implements
      [RFC#13](https://github.com/polkadot-fellows/RFCs/pull/13), closes
      https://github.com/paritytech/polkadot-sdk/issues/198.
      
      ----- 
      
      This Merge request introduces three major topicals:
      
      1. Multi-Block-Migrations
      1. New pallet `poll` hook for periodic service work
      1. Replacement hooks for `on_initialize` and `on_finalize` in cases
      where `poll` cannot be used
      
      and some more general changes to FRAME.  
      The changes for each topical span over multiple crates. They are listed
      in topical order below.
      
      # 1.) Multi-Block-Migrations
      
      Multi-Block-Migrations are facilitated by creating `pallet_migrations`
      and configuring `System::Config::MultiBlockMigrator` to point to it.
      Executive picks this up and triggers one step of the migrations pallet
      per block.
      The chain is in lockdown mode for as long as an MBM is ongoing.
      Executive does this by polling `MultiBlockMigrator::ongoing` and not
      allowing any transaction in a block, if true.
      
      A MBM is defined through trait `SteppedMigration`. A condensed version
      looks like this:
      ```rust
      /// A migration that can proceed in multiple steps.
      pub trait SteppedMigration {
      	type Cursor: FullCodec + MaxEncodedLen;
      	type Identifier: FullCodec + MaxEncodedLen;
      
      	fn id() -> Self::Identifier;
      
      	fn max_steps() -> Option<u32>;
      
      	fn step(
      		cursor: Option<Self::Cursor>,
      		meter: &mut WeightMeter,
      	) -> Result<Option<Self::Cursor>, SteppedMigrationError>;
      }
      ```
      
      `pallet_migrations` can be configured with an aggregated tuple of these
      migrations. It then starts to migrate them one-by-one on the next
      runtime upgrade.
      Two things are important here:
      - 1. Doing another runtime upgrade while MBMs are ongoing is not a good
      idea and can lead to messed up state.
      - 2. **Pallet Migrations MUST BE CONFIGURED IN `System::Config`,
      otherwise it is not used.**
      
      The pallet supports an `UpgradeStatusHandler` that can be used to notify
      external logic of upgrade start/finish (for example to pause XCM
      dispatch).
      
      Error recovery is very limited in the case that a migration errors or
      times out (exceeds its `max_steps`). Currently the runtime dev can
      decide in `FailedMigrationHandler::failed` how to handle this. One
      follow-up would be to pair this with the `SafeMode` pallet and enact
      safe mode when an upgrade fails, to allow governance to rescue the
      chain. This is currently not possible, since governance is not
      `Mandatory`.
      
      ## Runtime API
      
      - `Core`: `initialize_block` now returns `ExtrinsicInclusionMode` to
      inform the Block Author whether they can push transactions.
      
      ### Integration
      
      Add it to your runtime implementation of `Core` and `BlockBuilder`:
      ```patch
      diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs
      @@ impl_runtime_apis! {
      	impl sp_block_builder::Core<Block> for Runtime {
      -		fn initialize_block(header: &<Block as BlockT>::Header) {
      +		fn initialize_block(header: &<Block as BlockT>::Header) -> RuntimeExecutiveMode {
      			Executive::initialize_block(header)
      		}
      
      		...
      	}
      ```
      
      # 2.) `poll` hook
      
      A new pallet hook is introduced: `poll`. `Poll` is intended to replace
      mostly all usage of `on_initialize`.
      The reason for this is that any code that can be called from
      `on_initialize` cannot be migrated through an MBM. Currently there is no
      way to statically check this; the implication is to use `on_initialize`
      as rarely as possible.
      Failing to do so can result in broken storage invariants.
      
      The implementation of the poll hook depends on the `Runtime API` changes
      that are explained above.
      
      # 3.) Hard-Deadline callbacks
      
      Three new callbacks are introduced and configured on `System::Config`:
      `PreInherents`, `PostInherents` and `PostTransactions`.
      These hooks are meant as replacement for `on_initialize` and
      `on_finalize` in cases where the code that runs cannot be moved to
      `poll`.
      The reason for this is to make the usage of HD-code (hard deadline) more
      explicit - again to prevent broken invariants by MBMs.
      
      # 4.) FRAME (general changes)
      
      ## `frame_system` pallet
      
      A new memorize storage item `InherentsApplied` is added. It is used by
      executive to track whether inherents have already been applied.
      Executive and can then execute the MBMs directly between inherents and
      transactions.
      
      The `Config` gets five new items:
      - `SingleBlockMigrations` this is the new way of configuring migrations
      that run in a single block. Previously they were defined as last generic
      argument of `Executive`. This shift is brings all central configuration
      about migrations closer into view of the developer (migrations that are
      configured in `Executive` will still work for now but is deprecated).
      - `MultiBlockMigrator` this can be configured to an engine that drives
      MBMs. One example would be the `pallet_migrations`. Note that this is
      only the engine; the exact MBMs are injected into the engine.
      - `PreInherents` a callback that executes after `on_initialize` but
      before inherents.
      - `PostInherents` a callback that executes after all inherents ran
      (including MBMs and `poll`).
      - `PostTransactions` in symmetry to `PreInherents`, this one is called
      before `on_finalize` but after all transactions.
      
      A sane default is to set all of these to `()`. Example diff suitable for
      any chain:
      ```patch
      @@ impl frame_system::Config for Test {
       	type MaxConsumers = ConstU32<16>;
      +	type SingleBlockMigrations = ();
      +	type MultiBlockMigrator = ();
      +	type PreInherents = ();
      +	type PostInherents = ();
      +	type PostTransactions = ();
       }
      ```
      
      An overview of how the block execution now looks like is here. The same
      graph is also in the rust doc.
      
      <details><summary>Block Execution Flow</summary>
      <p>
      
      ![Screenshot 2023-12-04 at 19 11
      29](https://github.com/paritytech/polkadot-sdk/assets/10380170/e88a80c4-ef11-4faa-8df5-8b33a724c054)
      
      </p>
      </details> 
      
      ## Inherent Order
      
      Moved to https://github.com/paritytech/polkadot-sdk/pull/2154
      
      
      
      ---------------
      
      
      ## TODO
      
      - [ ] Check that `try-runtime` still works
      - [ ] Ensure backwards compatibility with old Runtime APIs
      - [x] Consume weight correctly
      - [x] Cleanup
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarJuan Girini <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      eefd5fe4
    • Liam Aharon's avatar
      Runtime Upgrade ref docs and Single Block Migration example pallet (#1554) · 12ce4f7d
      Liam Aharon authored
      Closes https://github.com/paritytech/polkadot-sdk-docs/issues/55
      
      - Changes 'current storage version' terminology to less ambiguous
      'in-code storage version' (suggestion by @ggwpez)
      - Adds a new example pallet `pallet-example-single-block-migrations`
      - Adds a new reference doc to replace
      https://docs.substrate.io/maintain/runtime-upgrades/ (temporarily living
      in the pallet while we wait for developer hub PR to merge)
      - Adds documentation for the `storage_alias` macro
      - Improves `trait Hooks` docs 
      - Improves `trait GetStorageVersion` docs
      - Update the suggested patterns for using `VersionedMigration`, so that
      version unchecked migrations are never exported
      - Prevents accidental usage of version unchecked migrations in runtimes
      
      https://github.com/paritytech/substrate/pull/14421#discussion_r1255467895
      - Unversioned migration code is kept inside `mod version_unchecked`,
      versioned code is kept in `pub mod versioned`
      - It is necessary to use modules to limit visibility because the inner
      migration must be `pub`. See
      https://github.com/rust-lang/rust/issues/30905 and
      
      https://internals.rust-lang.org/t/lang-team-minutes-private-in-public-rules/4504/40
      for more.
      
      ### todo
      
      - [x] move to reference docs to proper place within sdk-docs (now that
      https://github.com/paritytech/polkadot-sdk/pull/2102
      
       is merged)
      - [x] prdoc
      
      ---------
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarJuan <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatargupnik <[email protected]>
      12ce4f7d
  5. Feb 26, 2024
  6. Feb 20, 2024
  7. Feb 14, 2024
  8. Jan 31, 2024
    • Branislav Kontur's avatar
      [frame] `#[pallet::composite_enum]` improved variant count handling + removed... · bb8ddc46
      Branislav Kontur authored
      [frame] `#[pallet::composite_enum]` improved variant count handling + removed `pallet_balances`'s `MaxHolds` config (#2657)
      
      I started this investigation/issue based on @liamaharon question
      [here](https://github.com/paritytech/polkadot-sdk/pull/1801#discussion_r1410452499).
      
      ## Problem
      
      The `pallet_balances` integrity test should correctly detect that the
      runtime has correct distinct `HoldReasons` variant count. I assume the
      same situation exists for RuntimeFreezeReason.
      
      It is not a critical problem, if we set `MaxHolds` with a sufficiently
      large value, everything should be ok. However, in this case, the
      integrity_test check becomes less useful.
      
      **Situation for "any" runtime:**
      - `HoldReason` enums from different pallets:
      ```rust
              /// from pallet_nis
              #[pallet::composite_enum]
      	pub enum HoldReason {
      		NftReceipt,
      	}
      
              /// from pallet_preimage
              #[pallet::composite_enum]
      	pub enum HoldReason {
      		Preimage,
      	}
      
              // from pallet_state-trie-migration
              #[pallet::composite_enum]
      	pub enum HoldReason {
      		SlashForContinueMigrate,
      		SlashForMigrateCustomTop,
      		SlashForMigrateCustomChild,
      	}
      ```
      
      - generated `RuntimeHoldReason` enum looks like:
      ```rust
      pub enum RuntimeHoldReason {
      
          #[codec(index = 32u8)]
          Preimage(pallet_preimage::HoldReason),
      
          #[codec(index = 38u8)]
          Nis(pallet_nis::HoldReason),
      
          #[codec(index = 42u8)]
          StateTrieMigration(pallet_state_trie_migration::HoldReason),
      }
      ```
      
      - composite enum `RuntimeHoldReason` variant count is detected as `3`
      - we set `type MaxHolds = ConstU32<3>`
      - `pallet_balances::integrity_test` is ok with `3`(at least 3)
      
      However, the real problem can occur in a live runtime where some
      functionality might stop working. This is due to a total of 5 distinct
      hold reasons (for pallets with multi-instance support, it is even more),
      and not all of them can be used because of an incorrect `MaxHolds`,
      which is deemed acceptable according to the `integrity_test`:
        ```
        // pseudo-code - if we try to call all of these:
      
      T::Currency::hold(&pallet_nis::HoldReason::NftReceipt.into(),
      &nft_owner, deposit)?;
      T::Currency::hold(&pallet_preimage::HoldReason::Preimage.into(),
      &nft_owner, deposit)?;
      
      T::Currency::hold(&pallet_state_trie_migration::HoldReason::SlashForContinueMigrate.into(),
      &nft_owner, deposit)?;
      
        // With `type MaxHolds = ConstU32<3>` these two will fail
      
      T::Currency::hold(&pallet_state_trie_migration::HoldReason::SlashForMigrateCustomTop.into(),
      &nft_owner, deposit)?;
      
      T::Currency::hold(&pallet_state_trie_migration::HoldReason::SlashForMigrateCustomChild.into(),
      &nft_owner, deposit)?;
        ```  
      
      
      ## Solutions
      
      A macro `#[pallet::*]` expansion is extended of `VariantCount`
      implementation for the `#[pallet::composite_enum]` enum type. This
      expansion generates the `VariantCount` implementation for pallets'
      `HoldReason`, `FreezeReason`, `LockId`, and `SlashReason`. Enum variants
      must be plain enum values without fields to ensure a deterministic
      count.
      
      The composite runtime enum, `RuntimeHoldReason` and
      `RuntimeFreezeReason`, now sets `VariantCount::VARIANT_COUNT` as the sum
      of pallets' enum `VariantCount::VARIANT_COUNT`:
      ```rust
      #[frame_support::pallet(dev_mode)]
      mod module_single_instance {
      
      	#[pallet::composite_enum]
      	pub enum HoldReason {
      		ModuleSingleInstanceReason1,
      		ModuleSingleInstanceReason2,
      	}
      ...
      }
      
      #[frame_support::pallet(dev_mode)]
      mod module_multi_instance {
      
      	#[pallet::composite_enum]
      	pub enum HoldReason<I: 'static = ()> {
      		ModuleMultiInstanceReason1,
      		ModuleMultiInstanceReason2,
      		ModuleMultiInstanceReason3,
      	}
      ...
      }
      
      
      impl self::sp_api_hidden_includes_construct_runtime::hidden_include::traits::VariantCount
          for RuntimeHoldReason
      {
          const VARIANT_COUNT: u32 = 0
              + module_single_instance::HoldReason::VARIANT_COUNT
              + module_multi_instance::HoldReason::<module_multi_instance::Instance1>::VARIANT_COUNT
              + module_multi_instance::HoldReason::<module_multi_instance::Instance2>::VARIANT_COUNT
              + module_multi_instance::HoldReason::<module_multi_instance::Instance3>::VARIANT_COUNT;
      }
      ```
      
      In addition, `MaxHolds` is removed (as suggested
      [here](https://github.com/paritytech/polkadot-sdk/pull/2657#discussion_r1443324573))
      from `pallet_balances`, and its `Holds` are now bounded to
      `RuntimeHoldReason::VARIANT_COUNT`. Therefore, there is no need to let
      the runtime specify `MaxHolds`.
      
      
      ## For reviewers
      
      Relevant changes can be found here:
      - `substrate/frame/support/procedural/src/lib.rs` 
      -  `substrate/frame/support/procedural/src/pallet/parse/composite.rs`
      -  `substrate/frame/support/procedural/src/pallet/expand/composite.rs`
      -
      `substrate/frame/support/procedural/src/construct_runtime/expand/composite_helper.rs`
      -
      `substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs`
      -
      `substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs`
      - `substrate/frame/support/src/traits/misc.rs`
      
      And the rest of the files is just about removed `MaxHolds` from
      `pallet_balances`
      
      ## Next steps
      
      Do the same for `MaxFreezes`
      https://github.com/paritytech/polkadot-sdk/issues/2997
      
      .
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      Co-authored-by: default avatargupnik <[email protected]>
      bb8ddc46
  9. Jan 24, 2024
  10. Jan 22, 2024
  11. Jan 18, 2024
  12. Jan 16, 2024
    • Francisco Aguirre's avatar
      XCMv4 (#1230) · 8428f678
      Francisco Aguirre authored
      
      
      # Note for reviewer
      
      Most changes are just syntax changes necessary for the new version.
      Most important files should be the ones under the `xcm` folder.
      
      # Description 
      
      Added XCMv4.
      
      ## Removed `Multi` prefix
      The following types have been renamed:
      - MultiLocation -> Location
      - MultiAsset -> Asset
      - MultiAssets -> Assets
      - InteriorMultiLocation -> InteriorLocation
      - MultiAssetFilter -> AssetFilter
      - VersionedMultiAsset -> VersionedAsset
      - WildMultiAsset -> WildAsset
      - VersionedMultiLocation -> VersionedLocation
      
      In order to fix a name conflict, the `Assets` in `xcm-executor` were
      renamed to `HoldingAssets`, as they represent assets in holding.
      
      ## Removed `Abstract` asset id
      
      It was not being used anywhere and this simplifies the code.
      
      Now assets are just constructed as follows:
      
      ```rust
      let asset: Asset = (AssetId(Location::new(1, Here)), 100u128).into();
      ```
      
      No need for specifying `Concrete` anymore.
      
      ## Outcome is now a named fields struct
      
      Instead of
      
      ```rust
      pub enum Outcome {
        Complete(Weight),
        Incomplete(Weight, Error),
        Error(Error),
      }
      ```
      
      we now have
      
      ```rust
      pub enum Outcome {
        Complete { used: Weight },
        Incomplete { used: Weight, error: Error },
        Error { error: Error },
      }
      ```
      
      ## Added Reanchorable trait
      
      Now both locations and assets implement this trait, making it easier to
      reanchor both.
      
      ## New syntax for building locations and junctions
      
      Now junctions are built using the following methods:
      
      ```rust
      let location = Location {
          parents: 1,
          interior: [Parachain(1000), PalletInstance(50), GeneralIndex(1984)].into()
      };
      ```
      
      or
      
      ```rust
      let location = Location::new(1, [Parachain(1000), PalletInstance(50), GeneralIndex(1984)]);
      ```
      
      And they are matched like so:
      
      ```rust
      match location.unpack() {
        (1, [Parachain(id)]) => ...
        (0, Here) => ...,
        (1, [_]) => ...,
      }
      ```
      
      This syntax is mandatory in v4, and has been also implemented for v2 and
      v3 for easier migration.
      
      This was needed to make all sizes smaller.
      
      # TODO
      - [x] Scaffold v4
      - [x] Port github.com/paritytech/polkadot/pull/7236
      - [x] Remove `Multi` prefix
      - [x] Remove `Abstract` asset id
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      8428f678
  13. Jan 10, 2024
    • joe petrowski's avatar
      Unique Usernames in Identity Pallet (#2651) · d1f678c0
      joe petrowski authored
      
      
      This PR allows _username authorities_ to issue unique usernames that
      correspond with an account. It also provides two-way lookup, that is
      from `AccountId` to a single, "primary" `Username` (alongside
      `Registration`) and multiple unique `Username`s to an `AccountId`.
      
      Key features:
      
      - Username Authorities added (and removed) via privileged origin.
      - Authorities have a `suffix` and an `allocation`. They can grant up to
      `allocation` usernames. Their `suffix` will be appended to the usernames
      that they issue. A suffix may be up to 7 characters long.
      - Users can ask an authority to grant them a username. This will take
      the form `myusername.suffix`. The entire name (including suffix) must be
      less than or equal to 32 alphanumeric characters.
      - Users can approve a username for themselves in one of two ways (that
      is, authorities cannot grant them arbitrarily):
      - Pre-sign the entire username (including suffix) with a secret key that
      corresponds to their `AccountId` (for keyed accounts, obviously); or
      - Accept the username after it has been granted by an authority (it will
      be queued until accepted) (for non-keyed accounts like pure proxies or
      multisigs).
      - The system does not require any funds or deposits. Users without an
      identity will be given a default one (presumably all fields set to
      `None`). If they update this info, they will need to place the normal
      storage deposit.
      - If a user does not have any username, their first one will be set as
      `Primary`, and their `AccountId` will map to that one. If they get
      subsequent usernames, they can choose which one to be their primary via
      `set_primary_username`.
      - There are some state cleanup functions to remove expired usernames
      that have not been accepted and dangling usernames whose owners have
      called `clear_identity`.
      
      TODO:
      
      - [x] Add migration to runtimes
      - [x] Probably do off-chain migration into People Chain genesis
      - [x] Address a few TODO questions in code (please review)
      
      ---------
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      d1f678c0
  14. Jan 09, 2024
  15. Dec 27, 2023
  16. Dec 22, 2023
  17. Dec 21, 2023
  18. Dec 18, 2023
  19. Dec 11, 2023
  20. Dec 08, 2023
    • Muharem Ismailov's avatar
      Westend: Fellowship Treasury (#2532) · da40d97a
      Muharem Ismailov authored
      
      
      Treasury Pallet Instance for the Fellowship in Westend Collectives.
      
      In this update, we present a Treasury Pallet Instance that is under the
      control of the Fellowship body, with oversight from the Root and
      Treasurer origins. Here's how it is governed:
      - the Root origin have the authority to reject or approve spend
      proposals, with no amount limit for approvals.
      - the Treasurer origin have the authority to reject or approve spend
      proposals, with approval limits of up to 10,000,000 DOT.
      - Voice of all Fellows ranked at 3 or above can reject or approve spend
      proposals, with a maximum approval limit of 10,000 DOT.
      - Voice of Fellows ranked at 4 or above can also reject or approve spend
      proposals, with a maximum approval limit of 10,000,000 DOT.
      
      Additionally, we introduce the Asset Rate Pallet Instance to establish
      conversion rates from asset A to B. This is used to determine if a
      proposed spend amount involving a non-native asset is permissible by the
      commanding origin. The rates can be set up by the Root, Treasurer
      origins, or Voice of all Fellows.
      
      ---------
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarjoepetrowski <[email protected]>
      da40d97a
  21. Nov 28, 2023
  22. Nov 15, 2023
    • joe petrowski's avatar
      Identity Deposits Relay to Parachain Migration (#1814) · c79b234b
      joe petrowski authored
      The goal of this PR is to migrate Identity deposits from the Relay Chain
      to a system parachain.
      
      The problem I want to solve is that `IdentityOf` and `SubsOf` both store
      an amount that's held in reserve as a storage deposit. When migrating to
      a parachain, we can take a snapshot of the actual `IdentityInfo` and
      sub-account mappings, but should migrate (off chain) the `deposit`s to
      zero, since the chain (and by extension, accounts) won't have any funds
      at genesis.
      
      The good news is that we expect parachain deposits to be significantly
      lower (possibly 100x) on the parachain. That is, a deposit of 21 DOT on
      the Relay Chain would need 0.21 DOT on a parachain. This PR proposes to
      migrate the deposits in the following way:
      
      1. Introduces a new pallet with two extrinsics: 
      - `reap_identity`: Has a configurable `ReapOrigin`, which would be set
      to `EnsureSigned` on the Relay Chain (i.e. callable by anyone) and
      `EnsureRoot` on the parachain (we don't want identities reaped from
      there).
      - `poke_deposit`: Checks what deposit the pallet holds (at genesis,
      zero) and attempts to update the amount based on the calculated deposit
      for storage data.
      2. `reap_identity` clears all storage data for a `target` account and
      unreserves their deposit.
      3. A `ReapIdentityHandler` teleports the necessary DOT to the parachain
      and calls `poke_deposit`. Since the parachain deposit is much lower, and
      was just unreserved, we know we have enough.
      
      One awkwardness I ran into was that the XCMv3 instruction set does not
      provide a way for the system to teleport assets without a fee being
      deducted on reception. Users shouldn't have to pay a fee for the system
      to migrate their info to a more efficient location. So I wrote my own
      program and did the `InitiateTeleport` accounting on my own to send a
      program with `UnpaidExecution`. Have discussed an
      `InitiateUnpaidTeleport` instruction with @franciscoaguirre . Obviously
      any chain executing this would have to pass a `Barrier` for free
      execution.
      
      TODO:
      
      - [x] Confirm People Chain ParaId
      - [x] Confirm People Chain deposit rates (determined in
      https://github.com/paritytech/polkadot-sdk/pull/2281
      
      )
      - [x] Add pallet to Westend
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      c79b234b
  23. Nov 10, 2023
  24. Nov 05, 2023
  25. Oct 24, 2023
  26. Oct 18, 2023
    • Keith Yeung's avatar
      Introduce XcmFeesToAccount fee manager (#1234) · 3dece311
      Keith Yeung authored
      
      
      Combination of paritytech/polkadot#7005, its addon PR
      paritytech/polkadot#7585 and its companion paritytech/cumulus#2433.
      
      This PR introduces a new XcmFeesToAccount struct which implements the
      `FeeManager` trait, and assigns this struct as the `FeeManager` in the
      XCM config for all runtimes.
      
      The struct simply deposits all fees handled by the XCM executor to a
      specified account. In all runtimes, the specified account is configured
      as the treasury account.
      
      XCM __delivery__ fees are now being introduced (unless the root origin
      is sending a message to a system parachain on behalf of the originating
      chain).
      
      # Note for reviewers
      
      Most file changes are tests that had to be modified to account for the
      new fees.
      Main changes are in:
      - cumulus/pallets/xcmp-queue/src/lib.rs <- To make it track the delivery
      fees exponential factor
      - polkadot/xcm/xcm-builder/src/fee_handling.rs <- Added. Has the
      FeeManager implementation
      - All runtime xcm_config files <- To add the FeeManager to the XCM
      configuration
      
      # Important note
      
      After this change, instructions that create and send a new XCM (Query*,
      Report*, ExportMessage, InitiateReserveWithdraw, InitiateTeleport,
      DepositReserveAsset, TransferReserveAsset, LockAsset and RequestUnlock)
      will require the corresponding origin account in the origin register to
      pay for transport delivery fees, and the onward message will fail to be
      sent if the origin account does not have the required amount. This
      delivery fee is on top of what we already collect as tx fees in
      pallet-xcm and XCM BuyExecution fees!
      
      Wallet UIs that want to expose the new delivery fee can do so using the
      formula:
      
      ```
      delivery_fee_factor * (base_fee + encoded_msg_len * per_byte_fee)
      ```
      
      where the delivery fee factor can be obtained from the corresponding
      pallet based on which transport you are using (UMP, HRMP or bridges),
      the base fee is a constant, the encoded message length from the message
      itself and the per byte fee is the same as the configured per byte fee
      for txs (i.e. `TransactionByteFee`).
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarGiles Cope <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      3dece311
  27. Oct 15, 2023
  28. Oct 07, 2023
    • Muharem Ismailov's avatar
      Treasury spends various asset kinds (#1333) · cb944dc5
      Muharem Ismailov authored
      
      
      ### Summary 
      
      This PR introduces new dispatchables to the treasury pallet, allowing
      spends of various asset types. The enhanced features of the treasury
      pallet, in conjunction with the asset-rate pallet, are set up and
      enabled for Westend and Rococo.
      
      ### Westend and Rococo runtimes.
      
      Polkadot/Kusams/Rococo Treasury can accept proposals for `spends` of
      various asset kinds by specifying the asset's location and ID.
      
      #### Treasury Instance New Dispatchables:
      - `spend(AssetKind, AssetBalance, Beneficiary, Option<ValidFrom>)` -
      propose and approve a spend;
      - `payout(SpendIndex)` - payout an approved spend or retry a failed
      payout
      - `check_payment(SpendIndex)` - check the status of a payout;
      - `void_spend(SpendIndex)` - void previously approved spend;
      > existing spend dispatchable renamed to spend_local
      
      in this context, the `AssetKind` parameter contains the asset's location
      and it's corresponding `asset_id`, for example:
      `USDT` on `AssetHub`,
      ``` rust
      location = MultiLocation(0, X1(Parachain(1000)))
      asset_id = MultiLocation(0, X2(PalletInstance(50), GeneralIndex(1984)))
      ```
      
      the `Beneficiary` parameter is a `MultiLocation` in the context of the
      asset's location, for example
      ``` rust
      // the Fellowship salary pallet's location / account
      FellowshipSalaryPallet = MultiLocation(1, X2(Parachain(1001), PalletInstance(64)))
      // or custom `AccountId`
      Alice = MultiLocation(0, AccountId32(network: None, id: [1,...]))
      ```
      
      the `AssetBalance` represents the amount of the `AssetKind` to be
      transferred to the `Beneficiary`. For permission checks, the asset
      amount is converted to the native amount and compared against the
      maximum spendable amount determined by the commanding spend origin.
      
      the `spend` dispatchable allows for batching spends with different
      `ValidFrom` arguments, enabling milestone-based spending. If the
      expectations tied to an approved spend are not met, it is possible to
      void the spend later using the `void_spend` dispatchable.
      
      Asset Rate Pallet provides the conversion rate from the `AssetKind` to
      the native balance.
      
      #### Asset Rate Instance Dispatchables:
      - `create(AssetKind, Rate)` - initialize a conversion rate to the native
      balance for the given asset
      - `update(AssetKind, Rate)` - update the conversion rate to the native
      balance for the given asset
      - `remove(AssetKind)` - remove an existing conversion rate to the native
      balance for the given asset
      
      the pallet's dispatchables can be executed by the Root or Treasurer
      origins.
      
      ### Treasury Pallet
      
      Treasury Pallet can accept proposals for `spends` of various asset kinds
      and pay them out through the implementation of the `Pay` trait.
      
      New Dispatchables:
      - `spend(Config::AssetKind, AssetBalance, Config::Beneficiary,
      Option<ValidFrom>)` - propose and approve a spend;
      - `payout(SpendIndex)` - payout an approved spend or retry a failed
      payout;
      - `check_payment(SpendIndex)` - check the status of a payout;
      - `void_spend(SpendIndex)` - void previously approved spend;
      > existing spend dispatchable renamed to spend_local
      
      The parameters' types of the `spend` dispatchable exposed via the
      pallet's `Config` and allows to propose and accept a spend of a certain
      amount.
      
      An approved spend can be claimed via the `payout` within the
      `Config::SpendPeriod`. Clients provide an implementation of the `Pay`
      trait which can pay an asset of the `AssetKind` to the `Beneficiary` in
      `AssetBalance` units.
      
      The implementation of the Pay trait might not have an immediate final
      payment status, for example if implemented over `XCM` and the actual
      transfer happens on a remote chain.
      
      The `check_status` dispatchable can be executed to update the spend's
      payment state and retry the `payout` if the payment has failed.
      
      ---------
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: command-bot <>
      cb944dc5
  29. Sep 13, 2023
    • Liam Aharon's avatar
      Stabilize `VersionedMigration` (#1503) · 72de70c7
      Liam Aharon authored
      `VersionedMigration` has become somewhat widely used for handling
      version bumps in migrations the last few months.
      
      It is currently behind the `experimental` feature flag, requiring every
      pallet that writes a new migration with version bumps to set up the
      `experimental` flag in their own Cargo.tomls, and also for every runtime
      using these pallets to explicitly enable the `experimental` flag for
      each pallet.
      
      This is becoming quite verbose, and I can only see the number of pallets
      requiring the experimental flag increasing for no other reason than
      using what has become a commonly used feature.
      
      Additionally, I'm writing migration docs and would like to avoid
      stepping through how to use the `experimental` feature to get
      `VersionedMigration` working.
      
      Since the feature has been used in production for some time now without
      any reported issues, is becoming commonly used and ready to advertise in
      docs, I feel this is a good time to make it non-experimental.
      72de70c7
  30. Sep 06, 2023
  31. Aug 31, 2023
  32. Aug 30, 2023
  33. Aug 29, 2023
  34. Aug 18, 2023
    • asynchronous rob's avatar
      Asynchronous Backing MegaPR (#5022) · 5174b9d2
      asynchronous rob authored
      
      
      * inclusion emulator logic for asynchronous backing (#4790)
      
      * initial stab at candidate_context
      
      * fmt
      
      * docs & more TODOs
      
      * some cleanups
      
      * reframe as inclusion_emulator
      
      * documentations yes
      
      * update types
      
      * add constraint modifications
      
      * watermark
      
      * produce modifications
      
      * v2 primitives: re-export all v1 for consistency
      
      * vstaging primitives
      
      * emulator constraints: handle code upgrades
      
      * produce outbound HRMP modifications
      
      * stack.
      
      * method for applying modifications
      
      * method just for sanity-checking modifications
      
      * fragments produce modifications, not prospectives
      
      * make linear
      
      * add some TODOs
      
      * remove stacking; handle code upgrades
      
      * take `fragment` private
      
      * reintroduce stacking.
      
      * fragment constructor
      
      * add TODO
      
      * allow validating fragments against future constraints
      
      * docs
      
      * relay-parent number and min code size checks
      
      * check code upgrade restriction
      
      * check max hrmp per candidate
      
      * fmt
      
      * remove GoAhead logic because it wasn't helpful
      
      * docs on code upgrade failure
      
      * test stacking
      
      * test modifications against constraints
      
      * fmt
      
      * test fragments
      
      * descending or duplicate test
      
      * fmt
      
      * remove unused imports in vstaging
      
      * wrong primitives
      
      * spellcheck
      
      * Runtime changes for Asynchronous Backing (#4786)
      
      * inclusion: utility for allowed relay-parents
      
      * inclusion: use prev number instead of prev hash
      
      * track most recent context of paras
      
      * inclusion: accept previous relay-parents
      
      * update dmp  advancement rule for async backing
      
      * fmt
      
      * add a comment about validation outputs
      
      * clean up a couple of TODOs
      
      * weights
      
      * fix weights
      
      * fmt
      
      * Resolve dmp todo
      
      * Restore inclusion tests
      
      * Restore paras_inherent tests
      
      * MostRecentContext test
      
      * Benchmark for new paras dispatchable
      
      * Prepare check_validation_outputs for upgrade
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs
      
      * Implementers guide changes
      
      * More tests for allowed relay parents
      
      * Add a github issue link
      
      * Compute group index based on relay parent
      
      * Storage migration
      
      * Move allowed parents tracker to shared
      
      * Compile error
      
      * Get group assigned to core at the next block
      
      * Test group assignment
      
      * fmt
      
      * Error instead of panic
      
      * Update guide
      
      * Extend doc-comment
      
      * Update runtime/parachains/src/shared.rs
      
      Co-authored-by: default avatarRobert Habermeier <[email protected]>
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Prospective Parachains Subsystem (#4913)
      
      * docs and skeleton
      
      * subsystem skeleton
      
      * main loop
      
      * fragment tree basics & fmt
      
      * begin fragment trees & view
      
      * flesh out more of view update logic
      
      * further flesh out update logic
      
      * some refcount functions for fragment trees
      
      * add fatal/non-fatal errors
      
      * use non-fatal results
      
      * clear up some TODOs
      
      * ideal format for scheduling info
      
      * add a bunch of TODOs
      
      * some more fluff
      
      * extract fragment graph to submodule
      
      * begin fragment graph API
      
      * trees, not graphs
      
      * improve docs
      
      * scope and constructor for trees
      
      * add some test TODOs
      
      * limit max ancestors and store constraints
      
      * constructor
      
      * constraints: fix bug in HRMP watermarks
      
      * fragment tree population logic
      
      * set::retain
      
      * extract population logic
      
      * implement add_and_populate
      
      * fmt
      
      * add some TODOs in tests
      
      * implement child-selection
      
      * strip out old stuff based on wrong assumptions
      
      * use fatality
      
      * implement pruning
      
      * remove unused ancestor constraints
      
      * fragment tree instantiation
      
      * remove outdated comment
      
      * add message/request types and skeleton for handling
      
      * fmt
      
      * implement handle_candidate_seconded
      
      * candidate storage: handle backed
      
      * implement handle_candidate_backed
      
      * implement answer_get_backable_candidate
      
      * remove async where not needed
      
      * implement fetch_ancestry
      
      * add logic for run_iteration
      
      * add some docs
      
      * remove global allow(unused), fix warnings
      
      * make spellcheck happy (despite English)
      
      * fmt
      
      * bump Cargo.lock
      
      * replace tracing with gum
      
      * introduce PopulateFrom trait
      
      * implement GetHypotheticalDepths
      
      * revise docs slightly
      
      * first fragment tree scope test
      
      * more scope tests
      
      * test add_candidate
      
      * fmt
      
      * test retain
      
      * refactor test code
      
      * test populate is recursive
      
      * test contiguity of depth 0 is maintained
      
      * add_and_populate tests
      
      * cycle tests
      
      * remove PopulateFrom trait
      
      * fmt
      
      * test hypothetical depths (non-recursive)
      
      * have CandidateSeconded return membership
      
      * tree membership requests
      
      * Add a ProspectiveParachainsSubsystem struct
      
      * add a staging API for base constraints
      
      * add a `From` impl
      
      * add runtime API for staging_validity_constraints
      
      * implement fetch_base_constraints
      
      * implement `fetch_upcoming_paras`
      
      * remove reconstruction of candidate receipt; no obvious usecase
      
      * fmt
      
      * export message to broader module
      
      * remove last TODO
      
      * correctly export
      
      * fix compilation and add GetMinimumRelayParent request
      
      * make provisioner into a real subsystem with proper mesage bounds
      
      * fmt
      
      * fix ChannelsOut in overseer test
      
      * fix overseer tests
      
      * fix again
      
      * fmt
      
      * Integrate prospective parachains subsystem into backing: Part 1 (#5557)
      
      * BEGIN ASYNC candidate-backing CHANGES
      
      * rename & document modes
      
      * answer prospective validation data requests
      
      * GetMinimumRelayParents request is now plural
      
      * implement an implicit view utility for backing subsystems
      
      * implicit-view: get allowed relay parents
      
      * refactorings and improvements to implicit view
      
      * add some TODOs for tests
      
      * split implicit view updates into 2 functions
      
      * backing: define State to prepare for functional refactor
      
      * add some docs
      
      * backing: implement bones of new leaf activation logic
      
      * backing: create per-relay-parent-states
      
      * use new handle_active_leaves_update
      
      * begin extracting logic from CandidateBackingJob
      
      * mostly extract statement import from job logic
      
      * handle statement imports outside of job logic
      
      * do some TODO planning for prospective parachains integration
      
      * finish rewriting backing subsystem in functional style
      
      * add prospective parachains mode to relay parent entries
      
      * fmt
      
      * add a RejectedByProspectiveParachains error
      
      * notify prospective parachains of seconded and backed candidates
      
      * always validate candidates exhaustively in backing.
      
      * return persisted_validation_data from validation
      
      * handle rejections by prospective parachains
      
      * implement seconding sanity check
      
      * invoke validate_and_second
      
      * Alter statement table to allow multiple seconded messages per validator
      
      * refactor backing to have statements carry PVD
      
      * clean up all warnings
      
      * Add tests for implicit view
      
      * Improve doc comments
      
      * Prospective parachains mode based on Runtime API version
      
      * Add a TODO
      
      * Rework seconding_sanity_check
      
      * Iterate over responses
      
      * Update backing tests
      
      * collator-protocol: load PVD from runtime
      
      * Fix validator side tests
      
      * Update statement-distribution to fetch PVD
      
      * Fix statement-distribution tests
      
      * Backing tests with prospective paras #1
      
      * fix per_relay_parent pruning in backing
      
      * Test multiple leaves
      
      * Test seconding sanity check
      
      * Import statement order
      
      Before creating an entry in `PerCandidateState` map
      wait for the approval from the prospective parachains
      
      * Add a test for correct state updates
      
      * Second multiple candidates per relay parent test
      
      * Add backing tests with prospective paras
      
      * Second more than one test without prospective paras
      
      * Add a test for prospective para blocks
      
      * Update malus
      
      * typos
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Track occupied depth in backing per parachain (#5778)
      
      * provisioner: async backing changes (#5711)
      
      * Provisioner changes for async backing
      
      * Select candidates based on prospective paras mode
      
      * Revert naming
      
      * Update tests
      
      * Update TODO comment
      
      * review
      
      * provisioner: async backing changes (#5711)
      
      * Provisioner changes for async backing
      
      * Select candidates based on prospective paras mode
      
      * Revert naming
      
      * Update tests
      
      * Update TODO comment
      
      * review
      
      * fmt
      
      * Network bridge changes for asynchronous backing + update subsystems to handle versioned packets (#5991)
      
      * BEGIN STATEMENT DISTRIBUTION WORK
      
      create a vstaging network protocol which is the same as v1
      
      * mostly make network bridge amenable to vstaging
      
      * network-bridge: fully adapt to vstaging
      
      * add some TODOs for tests
      
      * fix fallout in bitfield-distribution
      
      * bitfield distribution tests + TODOs
      
      * fix fallout in gossip-support
      
      * collator-protocol: fix message fallout
      
      * collator-protocol: load PVD from runtime
      
      * add TODO for vstaging tests
      
      * make things compile
      
      * set used network protocol version using a feature
      
      * fmt
      
      * get approval-distribution building
      
      * fix approval-distribution tests
      
      * spellcheck
      
      * nits
      
      * approval distribution net protocol test
      
      * bitfield distribution net protocol test
      
      * Revert "collator-protocol: fix message fallout"
      
      This reverts commit 07cc887303e16c6b3843ecb25cdc7cc2080e2ed1.
      
      * Network bridge tests
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * remove max_pov_size requirement from prospective pvd request (#6014)
      
      * remove max_pov_size requirement from prospective pvd request
      
      * fmt
      
      * Extract legacy statement distribution to its own module (#6026)
      
      * add compatibility type to v2 statement distribution message
      
      * warning cleanup
      
      * handle compatibility layer for v2
      
      * clean up an unimplemented!() block
      
      * circulate statements based on version
      
      * extract legacy v1 code into separate module
      
      * remove unimplemented
      
      * clean up naming of from_requester/responder
      
      * remove TODOs
      
      * have backing share seconded statements with PVD
      
      * fmt
      
      * fix warning
      
      * Quick fix unused warning for not yet implemented/used staging messages.
      
      * Fix network bridge test
      
      * Fix wrong merge.
      
      We now have 23 subsystems (network bridge split + prospective
      parachains)
      
      Co-authored-by: default avatarRobert Klotzner <[email protected]>
      
      * Version 3 is already live.
      
      * Fix tests (#6055)
      
      * Fix backing tests
      
      * Fix warnings.
      
      * fmt
      
      * collator-protocol: asynchronous backing changes (#5740)
      
      * Draft collator side changes
      
      * Start working on collations management
      
      * Handle peer's view change
      
      * Versioning on advertising
      
      * Versioned collation fetching request
      
      * Handle versioned messages
      
      * Improve docs for collation requests
      
      * Add spans
      
      * Add request receiver to overseer
      
      * Fix collator side tests
      
      * Extract relay parent mode to lib
      
      * Validator side draft
      
      * Add more checks for advertisement
      
      * Request pvd based on async backing mode
      
      * review
      
      * Validator side improvements
      
      * Make old tests green
      
      * More fixes
      
      * Collator side tests draft
      
      * Send collation test
      
      * fmt
      
      * Collator side network protocol versioning
      
      * cleanup
      
      * merge artifacts
      
      * Validator side net protocol versioning
      
      * Remove fragment tree membership request
      
      * Resolve todo
      
      * Collator side core state test
      
      * Improve net protocol compatibility
      
      * Validator side tests
      
      * more improvements
      
      * style fixes
      
      * downgrade log
      
      * Track implicit assignments
      
      * Limit the number of seconded candidates per para
      
      * Add a sanity check
      
      * Handle fetched candidate
      
      * fix tests
      
      * Retry fetch
      
      * Guard against dequeueing while already fetching
      
      * Reintegrate connection management
      
      * Timeout on advertisements
      
      * fmt
      
      * spellcheck
      
      * update tests after merge
      
      * validator assignment fixes for backing and collator protocol (#6158)
      
      * Rename depth->ancestry len in tests
      
      * Refactor group assignments
      
      * Remove implicit assignments
      
      * backing: consider occupied core assignments
      
      * Track a single para on validator side
      
      * Refactor prospective parachains mode request (#6179)
      
      * Extract prospective parachains mode into util
      
      * Skip activations depending on the mode
      
      * backing: don't send backed candidate to provisioner (#6185)
      
      * backing: introduce `CanSecond` request for advertisements filtering (#6225)
      
      * Drop BoundToRelayParent
      
      * draft changes
      
      * fix backing tests
      
      * Fix genesis ancestry
      
      * Fix validator side tests
      
      * more tests
      
      * cargo generate-lockfile
      
      * Implement `StagingValidityConstraints` Runtime API method (#6258)
      
      * Implement StagingValidityConstraints
      
      * spellcheck
      
      * fix ump params
      
      * Update hrmp comment
      
      * Introduce ump per candidate limit
      
      * hypothetical earliest block
      
      * refactor primitives usage
      
      * hypothetical earliest block number test
      
      * fix build
      
      * Prepare the Runtime for asynchronous backing upgrade (#6287)
      
      * Introduce async backing params to runtime config
      
      * fix cumulus config
      
      * use config
      
      * finish runtimes
      
      * Introduce new staging API
      
      * Update collator protocol
      
      * Update provisioner
      
      * Update prospective parachains
      
      * Update backing
      
      * Move async backing params lower in the config
      
      * make naming consistent
      
      * misc
      
      * Use real prospective parachains subsystem (#6407)
      
      * Backport `HypotheticalFrontier` into the feature branch (#6605)
      
      * implement more general HypotheticalFrontier
      
      * fmt
      
      * drop unneeded request
      
      Co-authored-by: default avatarRobert Habermeier <[email protected]>
      
      * Resolve todo about legacy leaf activation (#6447)
      
      * fix bug/warning in handling membership answers
      
      * Remove `HypotheticalDepthRequest` in favor of `HypotheticalFrontierRequest` (#6521)
      
      * Remove `HypotheticalDepthRequest` for `HypotheticalFrontierRequest`
      
      * Update tests
      
      * Fix (removed wrong docstring)
      
      * Fix can_second request
      
      * Patch some dead_code errors
      
      ---------
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Async Backing: Send Statement Distribution "Backed" messages (#6634)
      
      * Backing: Send Statement Distribution "Backed" messages
      
      Closes #6590.
      
      **TODO:**
      
      - [ ] Adjust tests
      
      * Fix compile errors
      
      * (Mostly) fix tests
      
      * Fix comment
      
      * Fix test and compile error
      
      * Test that `StatementDistributionMessage::Backed` is sent
      
      * Fix compile error
      
      * Fix some clippy errors
      
      * Add prospective parachains subsystem tests (#6454)
      
      * Add prospective parachains subsystem test
      
      * Add `should_do_no_work_if_async_backing_disabled_for_leaf` test
      
      * Implement `activate_leaf` helper, up to getting ancestry
      
      * Finish implementing `activate_leaf`
      
      * Small refactor in `activate_leaf`
      
      * Get `CandidateSeconded` working
      
      * Finish `send_candidate_and_check_if_found` test
      
      * Refactor; send more leaves & candidates
      
      * Refactor test
      
      * Implement `check_candidate_parent_leaving_view` test
      
      * Start work on `check_candidate_on_multiple_forks` test
      
      * Don’t associate specific parachains with leaf
      
      * Finish `correctly_updates_leaves` test
      
      * Fix cycle due to reused head data
      
      * Fix `check_backable_query` test
      
      * Fix `check_candidate_on_multiple_forks` test
      
      * Add `check_depth_and_pvd_queries` test
      
      * Address review comments
      
      * Remove TODO
      
      * add a new index for output head data to candidate storage
      
      * Resolve test TODOs
      
      * Fix compile errors
      
      * test candidate storage pruning, make sure new index is cleaned up
      
      ---------
      
      Co-authored-by: default avatarRobert Habermeier <[email protected]>
      
      * Node-side metrics for asynchronous backing (#6549)
      
      * Add metrics for `prune_view_candidate_storage`
      
      * Add metrics for `request_unblocked_collations`
      
      * Fix docstring
      
      * Couple fixes from review comments
      
      * Fix `check_depth_query` test
      
      * inclusion-emulator: mirror advancement rule check (#6361)
      
      * inclusion-emulator: mirror advancement rule check
      
      * fix build
      
      * prospective-parachains: introduce `backed_in_path_only` flag for advertisements (#6649)
      
      * Introduce `backed_in_path_only` flag for depth request
      
      * fmt
      
      * update doc comment
      
      * fmt
      
      * Add async-backing zombienet tests (#6314)
      
      * Async backing: impl guide for statement distribution (#6738)
      
      Co-authored-by: default avatarBradley Olson <[email protected]>
      Co-authored-by: default avataralexgparity <[email protected]>
      
      * Asynchronous backing statement distribution: Take III (#5999)
      
      * add notification types for v2 statement-distribution
      
      * improve protocol docs
      
      * add empty vstaging module
      
      * fmt
      
      * add backed candidate packet request types
      
      * start putting down structure of new logic
      
      * handle activated leaf
      
      * some sanity-checking on outbound statements
      
      * fmt
      
      * update vstaging share to use statements with PVD
      
      * tiny refactor, candidate_hash location
      
      * import local statements
      
      * refactor statement import
      
      * first stab at broadcast logic
      
      * fmt
      
      * fill out some TODOs
      
      * start on handling incoming
      
      * split off session info into separate map
      
      * start in on a knowledge tracker
      
      * address some grumbles
      
      * format
      
      * missed comment
      
      * some docs for direct
      
      * add note on slashing
      
      * amend
      
      * simplify 'direct' code
      
      * finish up the 'direct' logic
      
      * add a bunch of tests for the direct-in-group logic
      
      * rename 'direct' to 'cluster', begin a candidate_entry module
      
      * distill candidate_entry
      
      * start in on a statement-store module
      
      * some utilities for the statement store
      
      * rewrite 'send_statement_direct' using new tools
      
      * filter sending logic on peers which have the relay-parent in their view.
      
      * some more logic for handling incoming statements
      
      * req/res: BackedCandidatePacket -> AttestedCandidate + tweaks
      
      * add a `validated_in_group` bitfield to BackedCandidateInventory
      
      * BackedCandidateInventory -> Manifest
      
      * start in on requester module
      
      * add outgoing request for attested candidate
      
      * add a priority mechanism for requester
      
      * some request dispatch logic
      
      * add seconded mask to tagged-request
      
      * amend manifest to hold group index
      
      * handle errors and set up scaffold for response validation
      
      * validate attested candidate responses
      
      * requester -> requests
      
      * add some utilities for manipulating requests
      
      * begin integrating requester
      
      * start grid module
      
      * tiny
      
      * refactor grid topology to expose more info to subsystems
      
      * fix grid_topology test
      
      * fix overseer test
      
      * implement topology group-based view construction logic
      
      * fmt
      
      * flesh out grid slightly more
      
      * add indexed groups utility
      
      * integrate Groups into per-session info
      
      * refactor statement store to borrow Groups
      
      * implement manifest knowledge utility
      
      * add a test for topology setup
      
      * don't send to group members
      
      * test for conflicting manifests
      
      * manifest knowledge tests
      
      * fmt
      
      * rename field
      
      * garbage collection for grid tracker
      
      * routines for finding correct/incorrect advertisers
      
      * add manifest import logic
      
      * tweak naming
      
      * more tests for manifest import
      
      * add comment
      
      * rework candidates into a view-wide tracker
      
      * fmt
      
      * start writing boilerplate for grid sending
      
      * fmt
      
      * some more group boilerplate
      
      * refactor handling of topology and authority IDs
      
      * fmt
      
      * send statements directly to grid peers where possible
      
      * send to cluster only if statement belongs to cluster
      
      * improve handling of cluster statements
      
      * handle incoming statements along the grid
      
      * API for introduction of candidates into the tree
      
      * backing: use new prospective parachains API
      
      * fmt prospective parachains changes
      
      * fmt statement-dist
      
      * fix condition
      
      * get ready for tracking importable candidates
      
      * prospective parachains: add Cow logic
      
      * incomplete and complete hypothetical candidates
      
      * remove keep_if_unneeded
      
      * fmt
      
      * implement more general HypotheticalFrontier
      
      * fmt, cleanup
      
      * add a by_parent_hash index to candidate tracker
      
      * more framework for future code
      
      * utilities for getting all hypothetical candidates for frontier
      
      * track origin in statement store
      
      * fmt
      
      * requests should return peer
      
      * apply post-confirmation reckoning
      
      * flesh out import/announce/circulate logic on new statements
      
      * adjust
      
      * adjust TODO comment
      
      * fix  backing tests
      
      * update statement-distribution to use new indexedvec
      
      * fmt
      
      * query hypothetical candidates
      
      * implement `note_importable_under`
      
      * extract common utility of fragment tree updates
      
      * add a helper function for getting statements unknown by backing
      
      * import fresh statements to backing
      
      * send announcements and acknowledgements over grid
      
      * provide freshly importable statements
      
      also avoid tracking backed candidates in statement distribution
      
      * do not issue requests on newly importable candidates
      
      * add TODO for later when confirming candidate
      
      * write a routine for handling backed candidate notifications
      
      * simplify grid substantially
      
      * add some test TODOs
      
      * handle confirmed candidates & grid announcements
      
      * finish implementing manifest handling, including follow up statements
      
      * send follow-up statements when acknowledging freshly backed
      
      * fmt
      
      * handle incoming acknowledgements
      
      * a little DRYing
      
      * wire up network messages to handlers
      
      * fmt
      
      * some skeleton code for peer view update handling
      
      * more peer view skeleton stuff
      
      * Fix async backing statement distribution tests (#6621)
      
      * Fix compile errors in tests
      
      * Cargo fmt
      
      * Resolve some todos in async backing statement-distribution branch (#6482)
      
      * Implement `remove_by_relay_parent`
      
      * Extract `minimum_votes` to shared primitives.
      
      * Add `can_send_statements_received_with_prejudice` test
      
      * Fix test
      
      * Update docstrings
      
      * Cargo fmt
      
      * Fix compile error
      
      * Fix compile errors in tests
      
      * Cargo fmt
      
      * Add module docs; write `test_priority_ordering` (first draft)
      
      * Fix `test_priority_ordering`
      
      * Move `insert_or_update_priority`: `Drop` -> `set_cluster_priority`
      
      * Address review comments
      
      * Remove `Entry::get_mut`
      
      * fix test compilation
      
      * add a TODO for a test
      
      * clean up a couple of TODOs
      
      * implement sending pending cluster statements
      
      * refactor utility function for sending acknowledgement and statements
      
      * mostly implement catching peers up via grid
      
      * Fix clippy error
      
      * alter grid to track all pending statements
      
      * fix more TODOs and format
      
      * tweak a TODO in requests
      
      * some logic for dispatching requests
      
      * fmt
      
      * skeleton for response receiving
      
      * Async backing statement distribution: cluster tests (#6678)
      
      * Add `pending_statements_set_when_receiving_fresh_statements`
      
      * Add `pending_statements_updated_when_sending_statements` test
      
      * fix up
      
      * fmt
      
      * update TODO
      
      * rework seconded mask in requests
      
      * change doc
      
      * change unhandledresponse not to borrow request manager
      
      * only accept responses sufficient to back
      
      * finish implementing response handling
      
      * extract statement filter to protocol crate
      
      * rework requests: use statement filter in network protocol
      
      * dispatch cluster requests correctly
      
      * rework cluster statement sending
      
      * implement request answering
      
      * fmt
      
      * only send confirmed candidate statement messages on unified relay-parent
      
      * Fix Tests In Statement Distribution Branch
      
      * Async Backing: Integrate `vstaging` of statement distribution into `lib.rs` (#6715)
      
      * Integrate `handle_active_leaves_update`
      
      * Integrate `share_local_statement`/`handle_backed_candidate_message`
      
      * Start hooking up request/response flow
      
      * Finish hooking up request/response flow
      
      * Limit number of parallel requests in responder
      
      * Fix test compilation errors
      
      * Fix missing check for prospective parachains mode
      
      * Fix some more compile errors
      
      * clean up some review comments
      
      * clean up warnings
      
      * Async backing statement distribution: grid tests (#6673)
      
      * Add `manifest_import_returns_ok_true` test
      
      * cargo fmt
      
      * Add pending_communication_receiving_manifest_on_confirmed_candidate
      
      * Add `senders_can_provide_manifests_in_acknowledgement` test
      
      * Add a couple of tests for pending statements
      
      * Add `pending_statements_cleared_when_sending` test
      
      * Add `pending_statements_respect_remote_knowledge` test
      
      * Refactor group creation in tests
      
      * Clarify docs
      
      * Address some review comments
      
      * Make some clarifications
      
      * Fix post-merge errors
      
      * Clarify test `senders_can_provide_manifests_in_acknowledgement`
      
      * Try writing `pending_statements_are_updated_after_manifest_exchange`
      
      * Document "seconding limit" and `reject_overflowing_manifests` test
      
      * Test that seconding counts are not updated for validators on error
      
      * Fix tests
      
      * Fix manifest exchange test
      
      * Add more tests in `requests.rs` (#6707)
      
      This resolves remaining TODOs in this file.
      
      * remove outdated inventory terminology
      
      * Async backing statement distribution: `Candidates` tests (#6658)
      
      * Async Backing: Fix clippy errors in statement distribution branch (#6720)
      
      * Integrate `handle_active_leaves_update`
      
      * Integrate `share_local_statement`/`handle_backed_candidate_message`
      
      * Start hooking up request/response flow
      
      * Finish hooking up request/response flow
      
      * Limit number of parallel requests in responder
      
      * Fix test compilation errors
      
      * Fix missing check for prospective parachains mode
      
      * Fix some more compile errors
      
      * Async Backing: Fix clippy errors in statement distribution branch
      
      * Fix some more clippy lints
      
      * add tests module
      
      * fix warnings in existing tests
      
      * create basic test harness
      
      * create a test state struct
      
      * fmt
      
      * create empty cluster & grid modules for tests
      
      * some TODOs for cluster test suite
      
      * describe test-suite for grid logic
      
      * describe request test suite
      
      * fix seconding-limit bug
      
      * Remove extraneous `pub`
      
      This somehow made it into my clippy PR.
      
      * Fix some test compile warnings
      
      * Remove some unneeded `allow`s
      
      * adapt some new test helpers from Marcin
      
      * add helper for activating a gossip topology
      
      * add utility for signing statements
      
      * helpers for connecting/disconnecting peers
      
      * round out network utilities
      
      * fmt
      
      * fix bug in initializing validator-meta
      
      * fix compilation
      
      * implement first cluster test
      
      * TODOs for incoming request tests
      
      * Remove unneeded `make_committed_candidate` helper
      
      * fmt
      
      * some more tests for cluster
      
      * add a TODO about grid senders
      
      * integrate inbound req/res into test harness
      
      * polish off initial cluster test suite
      
      * keep introduce candidate request
      
      * fix tests after introduce candidate request
      
      * fmt
      
      * Add grid protocol to module docs
      
      * Fix comments
      
      * Test `backed_in_path_only: true`
      
      * Update node/network/protocol/src/lib.rs
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Update node/network/protocol/src/request_response/mod.rs
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Mark receiver with `vstaging`
      
      * validate grid senders based on manifest kind
      
      * fix mask_seconded/valid
      
      * fix unwanted-mask check
      
      * fix build
      
      * resolve todo on leaf mode
      
      * Unify protocol naming to vstaging
      
      * fmt, fix grid test after topology change
      
      * typo
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * address review
      
      * adjust comment, make easier to understand
      
      * Fix typo
      
      ---------
      
      Co-authored-by: default avatarMarcin S <[email protected]>
      Co-authored-by: default avatarMarcin S <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * miscellaneous fixes to make asynchronous backing work (#6791)
      
      * propagate network-protocol-staging feature
      
      * add feature to adder-collator as well
      
      * allow collation-generation of occupied cores
      
      * prospective parachains: special treatment for pending availability candidates
      
      * runtime: fetch candidates pending availability
      
      * lazily construct PVD for pending candidates
      
      * fix fallout in prospective parachains hypothetical/select_child
      
      * runtime: enact candidates when creating paras-inherent
      
      * make tests compile
      
      * test pending availability in the scope
      
      * add prospective parachains test
      
      * fix validity constraints leftovers
      
      * drop prints
      
      * Fix typos
      
      ---------
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Co-authored-by: default avatarMarcin S <[email protected]>
      
      * Remove restart from test (#6840)
      
      * Async Backing: Statement Distribution Tests (#6755)
      
      * start on handling incoming
      
      * split off session info into separate map
      
      * start in on a knowledge tracker
      
      * address some grumbles
      
      * format
      
      * missed comment
      
      * some docs for direct
      
      * add note on slashing
      
      * amend
      
      * simplify 'direct' code
      
      * finish up the 'direct' logic
      
      * add a bunch of tests for the direct-in-group logic
      
      * rename 'direct' to 'cluster', begin a candidate_entry module
      
      * distill candidate_entry
      
      * start in on a statement-store module
      
      * some utilities for the statement store
      
      * rewrite 'send_statement_direct' using new tools
      
      * filter sending logic on peers which have the relay-parent in their view.
      
      * some more logic for handling incoming statements
      
      * req/res: BackedCandidatePacket -> AttestedCandidate + tweaks
      
      * add a `validated_in_group` bitfield to BackedCandidateInventory
      
      * BackedCandidateInventory -> Manifest
      
      * start in on requester module
      
      * add outgoing request for attested candidate
      
      * add a priority mechanism for requester
      
      * some request dispatch logic
      
      * add seconded mask to tagged-request
      
      * amend manifest to hold group index
      
      * handle errors and set up scaffold for response validation
      
      * validate attested candidate responses
      
      * requester -> requests
      
      * add some utilities for manipulating requests
      
      * begin integrating requester
      
      * start grid module
      
      * tiny
      
      * refactor grid topology to expose more info to subsystems
      
      * fix grid_topology test
      
      * fix overseer test
      
      * implement topology group-based view construction logic
      
      * fmt
      
      * flesh out grid slightly more
      
      * add indexed groups utility
      
      * integrate Groups into per-session info
      
      * refactor statement store to borrow Groups
      
      * implement manifest knowledge utility
      
      * add a test for topology setup
      
      * don't send to group members
      
      * test for conflicting manifests
      
      * manifest knowledge tests
      
      * fmt
      
      * rename field
      
      * garbage collection for grid tracker
      
      * routines for finding correct/incorrect advertisers
      
      * add manifest import logic
      
      * tweak naming
      
      * more tests for manifest import
      
      * add comment
      
      * rework candidates into a view-wide tracker
      
      * fmt
      
      * start writing boilerplate for grid sending
      
      * fmt
      
      * some more group boilerplate
      
      * refactor handling of topology and authority IDs
      
      * fmt
      
      * send statements directly to grid peers where possible
      
      * send to cluster only if statement belongs to cluster
      
      * improve handling of cluster statements
      
      * handle incoming statements along the grid
      
      * API for introduction of candidates into the tree
      
      * backing: use new prospective parachains API
      
      * fmt prospective parachains changes
      
      * fmt statement-dist
      
      * fix condition
      
      * get ready for tracking importable candidates
      
      * prospective parachains: add Cow logic
      
      * incomplete and complete hypothetical candidates
      
      * remove keep_if_unneeded
      
      * fmt
      
      * implement more general HypotheticalFrontier
      
      * fmt, cleanup
      
      * add a by_parent_hash index to candidate tracker
      
      * more framework for future code
      
      * utilities for getting all hypothetical candidates for frontier
      
      * track origin in statement store
      
      * fmt
      
      * requests should return peer
      
      * apply post-confirmation reckoning
      
      * flesh out import/announce/circulate logic on new statements
      
      * adjust
      
      * adjust TODO comment
      
      * fix  backing tests
      
      * update statement-distribution to use new indexedvec
      
      * fmt
      
      * query hypothetical candidates
      
      * implement `note_importable_under`
      
      * extract common utility of fragment tree updates
      
      * add a helper function for getting statements unknown by backing
      
      * import fresh statements to backing
      
      * send announcements and acknowledgements over grid
      
      * provide freshly importable statements
      
      also avoid tracking backed candidates in statement distribution
      
      * do not issue requests on newly importable candidates
      
      * add TODO for later when confirming candidate
      
      * write a routine for handling backed candidate notifications
      
      * simplify grid substantially
      
      * add some test TODOs
      
      * handle confirmed candidates & grid announcements
      
      * finish implementing manifest handling, including follow up statements
      
      * send follow-up statements when acknowledging freshly backed
      
      * fmt
      
      * handle incoming acknowledgements
      
      * a little DRYing
      
      * wire up network messages to handlers
      
      * fmt
      
      * some skeleton code for peer view update handling
      
      * more peer view skeleton stuff
      
      * Fix async backing statement distribution tests (#6621)
      
      * Fix compile errors in tests
      
      * Cargo fmt
      
      * Resolve some todos in async backing statement-distribution branch (#6482)
      
      * Implement `remove_by_relay_parent`
      
      * Extract `minimum_votes` to shared primitives.
      
      * Add `can_send_statements_received_with_prejudice` test
      
      * Fix test
      
      * Update docstrings
      
      * Cargo fmt
      
      * Fix compile error
      
      * Fix compile errors in tests
      
      * Cargo fmt
      
      * Add module docs; write `test_priority_ordering` (first draft)
      
      * Fix `test_priority_ordering`
      
      * Move `insert_or_update_priority`: `Drop` -> `set_cluster_priority`
      
      * Address review comments
      
      * Remove `Entry::get_mut`
      
      * fix test compilation
      
      * add a TODO for a test
      
      * clean up a couple of TODOs
      
      * implement sending pending cluster statements
      
      * refactor utility function for sending acknowledgement and statements
      
      * mostly implement catching peers up via grid
      
      * Fix clippy error
      
      * alter grid to track all pending statements
      
      * fix more TODOs and format
      
      * tweak a TODO in requests
      
      * some logic for dispatching requests
      
      * fmt
      
      * skeleton for response receiving
      
      * Async backing statement distribution: cluster tests (#6678)
      
      * Add `pending_statements_set_when_receiving_fresh_statements`
      
      * Add `pending_statements_updated_when_sending_statements` test
      
      * fix up
      
      * fmt
      
      * update TODO
      
      * rework seconded mask in requests
      
      * change doc
      
      * change unhandledresponse not to borrow request manager
      
      * only accept responses sufficient to back
      
      * finish implementing response handling
      
      * extract statement filter to protocol crate
      
      * rework requests: use statement filter in network protocol
      
      * dispatch cluster requests correctly
      
      * rework cluster statement sending
      
      * implement request answering
      
      * fmt
      
      * only send confirmed candidate statement messages on unified relay-parent
      
      * Fix Tests In Statement Distribution Branch
      
      * Async Backing: Integrate `vstaging` of statement distribution into `lib.rs` (#6715)
      
      * Integrate `handle_active_leaves_update`
      
      * Integrate `share_local_statement`/`handle_backed_candidate_message`
      
      * Start hooking up request/response flow
      
      * Finish hooking up request/response flow
      
      * Limit number of parallel requests in responder
      
      * Fix test compilation errors
      
      * Fix missing check for prospective parachains mode
      
      * Fix some more compile errors
      
      * clean up some review comments
      
      * clean up warnings
      
      * Async backing statement distribution: grid tests (#6673)
      
      * Add `manifest_import_returns_ok_true` test
      
      * cargo fmt
      
      * Add pending_communication_receiving_manifest_on_confirmed_candidate
      
      * Add `senders_can_provide_manifests_in_acknowledgement` test
      
      * Add a couple of tests for pending statements
      
      * Add `pending_statements_cleared_when_sending` test
      
      * Add `pending_statements_respect_remote_knowledge` test
      
      * Refactor group creation in tests
      
      * Clarify docs
      
      * Address some review comments
      
      * Make some clarifications
      
      * Fix post-merge errors
      
      * Clarify test `senders_can_provide_manifests_in_acknowledgement`
      
      * Try writing `pending_statements_are_updated_after_manifest_exchange`
      
      * Document "seconding limit" and `reject_overflowing_manifests` test
      
      * Test that seconding counts are not updated for validators on error
      
      * Fix tests
      
      * Fix manifest exchange test
      
      * Add more tests in `requests.rs` (#6707)
      
      This resolves remaining TODOs in this file.
      
      * remove outdated inventory terminology
      
      * Async backing statement distribution: `Candidates` tests (#6658)
      
      * Async Backing: Fix clippy errors in statement distribution branch (#6720)
      
      * Integrate `handle_active_leaves_update`
      
      * Integrate `share_local_statement`/`handle_backed_candidate_message`
      
      * Start hooking up request/response flow
      
      * Finish hooking up request/response flow
      
      * Limit number of parallel requests in responder
      
      * Fix test compilation errors
      
      * Fix missing check for prospective parachains mode
      
      * Fix some more compile errors
      
      * Async Backing: Fix clippy errors in statement distribution branch
      
      * Fix some more clippy lints
      
      * add tests module
      
      * fix warnings in existing tests
      
      * create basic test harness
      
      * create a test state struct
      
      * fmt
      
      * create empty cluster & grid modules for tests
      
      * some TODOs for cluster test suite
      
      * describe test-suite for grid logic
      
      * describe request test suite
      
      * fix seconding-limit bug
      
      * Remove extraneous `pub`
      
      This somehow made it into my clippy PR.
      
      * Fix some test compile warnings
      
      * Remove some unneeded `allow`s
      
      * adapt some new test helpers from Marcin
      
      * add helper for activating a gossip topology
      
      * add utility for signing statements
      
      * helpers for connecting/disconnecting peers
      
      * round out network utilities
      
      * fmt
      
      * fix bug in initializing validator-meta
      
      * fix compilation
      
      * implement first cluster test
      
      * TODOs for incoming request tests
      
      * Remove unneeded `make_committed_candidate` helper
      
      * fmt
      
      * Hook up request sender
      
      * Add `valid_statement_without_prior_seconded_is_ignored` test
      
      * Fix `valid_statement_without_prior_seconded_is_ignored` test
      
      * some more tests for cluster
      
      * add a TODO about grid senders
      
      * integrate inbound req/res into test harness
      
      * polish off initial cluster test suite
      
      * keep introduce candidate request
      
      * fix tests after introduce candidate request
      
      * fmt
      
      * Add grid protocol to module docs
      
      * Remove obsolete test
      
      * Fix comments
      
      * Test `backed_in_path_only: true`
      
      * Update node/network/protocol/src/lib.rs
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Update node/network/protocol/src/request_response/mod.rs
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Mark receiver with `vstaging`
      
      * First draft of `ensure_seconding_limit_is_respected` test
      
      * validate grid senders based on manifest kind
      
      * fix mask_seconded/valid
      
      * fix unwanted-mask check
      
      * fix build
      
      * resolve todo on leaf mode
      
      * Unify protocol naming to vstaging
      
      * Fix `ensure_seconding_limit_is_respected` test
      
      * Start `backed_candidate_leads_to_advertisement` test
      
      * fmt, fix grid test after topology change
      
      * Send Backed notification
      
      * Finish `backed_candidate_leads_to_advertisement` test
      
      * Finish `peer_reported_for_duplicate_statements` test
      
      * Finish `received_advertisement_before_confirmation_leads_to_request`
      
      * Add `advertisements_rejected_from_incorrect_peers` test
      
      * Add `manifest_rejected_*` tests
      
      * Add `manifest_rejected_when_group_does_not_match_para` test
      
      * Add `local_node_sanity_checks_incoming_requests` test
      
      * Add `local_node_respects_statement_mask` test
      
      * Add tests where peer is reported for providing invalid signatures
      
      * Add `cluster_peer_allowed_to_send_incomplete_statements` test
      
      * Add `received_advertisement_after_backing_leads_to_acknowledgement`
      
      * Add `received_advertisement_after_confirmation_before_backing` test
      
      * peer_reported_for_advertisement_conflicting_with_confirmed_candidate
      
      * Add `peer_reported_for_not_enough_statements` test
      
      * Add `peer_reported_for_providing_statements_meant_to_be_masked_out`
      
      * Add `additional_statements_are_shared_after_manifest_exchange`
      
      * Add `grid_statements_imported_to_backing` test
      
      * Add `relay_parent_entering_peer_view_leads_to_advertisement` test
      
      * Add `advertisement_not_re_sent_when_peer_re_enters_view` test
      
      * Update node/network/statement-distribution/src/vstaging/tests/grid.rs
      
      Co-authored-by: default avatarasynchronous rob <[email protected]>
      
      * Resolve TODOs, update test
      
      * Address unused code
      
      * Add check after every test for unhandled requests
      
      * Refactor (`make_dummy_leaf` and `handle_sent_request`)
      
      * Refactor (`make_dummy_topology`)
      
      * Minor refactor
      
      ---------
      
      Co-authored-by: default avatarRobert Habermeier <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      
      * Fix some clippy lints in tests
      
      * Async backing: minor fixes (#6920)
      
      * bitfield-distribution test
      
      * implicit view tests
      
      * Refactor parameters -> params
      
      * scheduler: update storage migration (#6963)
      
      * update scheduler migration
      
      * Adjust weight to account for storage read
      
      * Statement Distribution Guide Edits (#7025)
      
      * Statement distribution guide edits
      
      * Addressed Marcin's comments
      
      * Add attested candidate request retry timeouts (#6833)
      
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Co-authored-by: default avatarasynchronous rob <[email protected]>
      Co-authored-by: default avatarRobert Habermeier <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Fix async backing statement distribution tests (#6621)
      Resolve some todos in async backing statement-distribution branch (#6482)
      Fix clippy errors in statement distribution branch (#6720)
      
      * Async backing: add Prospective Parachains impl guide (#6933)
      
      Co-authored-by: default avatarBradley Olson <[email protected]>
      
      * Updates to Provisioner Guide for Async Backing (#7106)
      
      * Initial corrections and clarifications
      
      * Partial first draft
      
      * Finished first draft
      
      * Adding back wrongly removed test bit
      
      * fmt
      
      * Update roadmap/implementers-guide/src/node/utility/provisioner.md
      
      Co-authored-by: default avatarMarcin S. <[email protected]>
      
      * Addressing comments
      
      * Reorganization
      
      * fmt
      
      ---------
      
      Co-authored-by: default avatarMarcin S. <[email protected]>
      
      * fmt
      
      * Renaming Parathread Mentions (#7287)
      
      * Renaming parathreads
      
      * Renaming module to pallet
      
      * More updates
      
      * PVF: Refactor workers into separate crates, remove host dependency (#7253)
      
      * PVF: Refactor workers into separate crates, remove host dependency
      
      * Fix compile error
      
      * Remove some leftover code
      
      * Fix compile errors
      
      * Update Cargo.lock
      
      * Remove worker main.rs files
      
      I accidentally copied these from the other PR. This PR isn't intended to
      introduce standalone workers yet.
      
      * Address review comments
      
      * cargo fmt
      
      * Update a couple of comments
      
      * Update log targets
      
      * Update quote to 1.0.27 (#7280)
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: parity-processbot <>
      
      * pallets: implement `Default` for `GenesisConfig` in `no_std` (#7271)
      
      * pallets: implement Default for GenesisConfig in no_std
      
      This change is follow-up of: https://github.com/paritytech/substrate/pull/14108
      
      It is a step towards: https://github.com/paritytech/substrate/issues/13334
      
      
      
      * Cargo.lock updated
      
      * update lockfile for {"substrate"}
      
      ---------
      
      Co-authored-by: parity-processbot <>
      
      * cli: enable BEEFY by default on test networks (#7293)
      
      We consider BEEFY mature enough to run by default on all nodes
      for test networks (Rococo/Wococo/Versi).
      
      Right now, most nodes are not running it since it's opt-in using
      --beefy flag. Switch to an opt-out model for test networks.
      
      Replace --beefy flag from CLI with --no-beefy and have BEEFY
      client start by default on test networks.
      
      Signed-off-by: default avataracatangiu <[email protected]>
      
      * runtime: past session slashing runtime API (#6667)
      
      * runtime/vstaging: unapplied_slashes runtime API
      
      * runtime/vstaging: key_ownership_proof runtime API
      
      * runtime/ParachainHost: submit_report_dispute_lost
      
      * fix key_ownership_proof API
      
      * runtime: submit_report_dispute_lost runtime API
      
      * nits
      
      * Update node/subsystem-types/src/messages.rs
      
      Co-authored-by: default avatarMarcin S. <[email protected]>
      
      * revert unrelated fmt changes
      
      * post merge fixes
      
      * fix compilation
      
      ---------
      
      Co-authored-by: default avatarMarcin S. <[email protected]>
      
      * Correcting git mishap
      
      * Document usage of `gum` crate (#7294)
      
      * Document usage of gum crate
      
      * Small fix
      
      * Add some more basic info
      
      * Update node/gum/src/lib.rs
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * Update target docs
      
      ---------
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * XCM: Fix issue with RequestUnlock (#7278)
      
      * XCM: Fix issue with RequestUnlock
      
      * Leave API changes for v4
      
      * Fix clippy errors
      
      * Fix tests
      
      ---------
      
      Co-authored-by: parity-processbot <>
      
      * Companion for Substrate#14228 (#7295)
      
      * Companion for Substrate#14228
      
      https://github.com/paritytech/substrate/pull/14228
      
      
      
      * update lockfile for {"substrate"}
      
      ---------
      
      Co-authored-by: parity-processbot <>
      
      * Companion for #14237: Use latest sp-crates (#7300)
      
      * To revert: Update substrate branch to "lexnv/bump_sp_crates"
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * Revert "To revert: Update substrate branch to "lexnv/bump_sp_crates""
      
      This reverts commit 5f1db84eac4a226c37b7f6ce6ee19b49dc7e2008.
      
      * Update cargo lock
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * Update cargo.lock
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * Update cargo.lock
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * bounded-collections bump to 0.1.7 (#7305)
      
      * bounded-collections bump to 0.1.7
      
      Companion for: paritytech/substrate#14225
      
      * update lockfile for {"substrate"}
      
      ---------
      
      Co-authored-by: parity-processbot <>
      
      * bump to quote 1.0.28 (#7306)
      
      * `RollingSessionWindow` cleanup (#7204)
      
      * Replace `RollingSessionWindow` with `RuntimeInfo` - initial commit
      
      * Fix tests in import
      
      * Fix the rest of the tests
      
      * Remove dead code
      
      * Fix todos
      
      * Simplify session caching
      
      * Comments for `SessionInfoProvider`
      
      * Separate `SessionInfoProvider` from `State`
      
      * `cache_session_info_for_head` becomes freestanding function
      
      * Remove unneeded `mut` usage
      
      * fn session_info -> fn get_session_info() to avoid name clashes. The function also tries to initialize `SessionInfoProvider`
      
      * Fix SessionInfo retrieval
      
      * Code cleanup
      
      * Don't wrap `SessionInfoProvider` in an `Option`
      
      * Remove `earliest_session()`
      
      * Remove pre-caching -> wip
      
      * Fix some tests and code cleanup
      
      * Fix all tests
      
      * Fixes in tests
      
      * Fix comments, variable names and small style changes
      
      * Fix a warning
      
      * impl From<SessionWindowSize> for NonZeroUsize
      
      * Fix logging for `get_session_info` - remove redundant logs and decrease log level to DEBUG
      
      * Code review feedback
      
      * Storage migration removing `COL_SESSION_WINDOW_DATA` from parachains db
      
      * Remove `col_session_data` usages
      
      * Storage migration clearing columns w/o removing them
      
      * Remove session data column usages from `approval-voting` and `dispute-coordinator` tests
      
      * Add some test cases from `RollingSessionWindow` to `dispute-coordinator` tests
      
      * Fix formatting in initialized.rs
      
      * Fix a corner case in `SessionInfo` caching for `dispute-coordinator`
      
      * Remove `RollingSessionWindow` ;(
      
      * Revert "Fix formatting in initialized.rs"
      
      This reverts commit 0f94664ec9f3a7e3737a30291195990e1e7065fc.
      
      * v2 to v3 migration drops `COL_DISPUTE_COORDINATOR_DATA` instead of clearing it
      
      * Fix `NUM_COLUMNS` in `approval-voting`
      
      * Use `columns::v3::NUM_COLUMNS` when opening db
      
      * Update node/service/src/parachains_db/upgrade.rs
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * Don't write in `COL_DISPUTE_COORDINATOR_DATA` for `test_rocksdb_migrate_2_to_3`
      
      * Fix `NUM+COLUMNS` in approval_voting
      
      * Fix formatting
      
      * Fix columns usage
      
      * Clarification comments about the different db versions
      
      ---------
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * pallet-para-config: Remove remnant WeightInfo functions (#7308)
      
      * pallet-para-config: Remove remnant WeightInfo functions
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * set_config_with_weight begone
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * ".git/.scripts/commands/bench/bench.sh" runtime kusama-dev runtime_parachains::configuration
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: command-bot <>
      
      * XCM: PayOverXcm config (#6900)
      
      * Move XCM query functionality to trait
      
      * Fix tests
      
      * Add PayOverXcm implementation
      
      * fix the PayOverXcm trait to compile
      
      * moved doc comment out of trait implmeentation and to the trait
      
      * PayOverXCM documentation
      
      * Change documentation a bit
      
      * Added empty benchmark methods implementation and changed docs
      
      * update PayOverXCM to convert AccountIds to MultiLocations
      
      * Implement benchmarking method
      
      * Change v3 to latest
      
      * Descend origin to an asset sender (#6970)
      
      * descend origin to an asset sender
      
      * sender as tuple of dest and sender
      
      * Add more variants to the QueryResponseStatus enum
      
      * Change Beneficiary to Into<[u8; 32]>
      
      * update PayOverXcm to return concrete errors and use AccountId as sender
      
      * use polkadot-primitives for AccountId
      
      * fix dependency to use polkadot-core-primitives
      
      * force Unpaid instruction to the top of the instructions list
      
      * modify report_outcome to accept interior argument
      
      * use new_query directly for building final xcm query, instead of report_outcome
      
      * fix usage of new_query to use the XcmQueryHandler
      
      * fix usage of new_query to use the XcmQueryHandler
      
      * tiny method calling fix
      
      * xcm query handler (#7198)
      
      * drop redundant query status
      
      * rename ReportQueryStatus to OuterQueryStatus
      
      * revert rename of QueryResponseStatus
      
      * update mapping
      
      * Update xcm/xcm-builder/src/pay.rs
      
      Co-authored-by: default avatarGavin Wood <[email protected]>
      
      * Updates
      
      * Docs
      
      * Fix benchmarking stuff
      
      * Destination can be determined based on asset_kind
      
      * Tweaking API to minimise clones
      
      * Some repotting and docs
      
      ---------
      
      Co-authored-by: default avatarAnthony Alaribe <[email protected]>
      Co-authored-by: default avatarMuharem Ismailov <[email protected]>
      Co-authored-by: default avatarAnthony Alaribe <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      
      * Companion for #14265 (#7307)
      
      * Update Cargo.lock
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * Update Cargo.lock
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: parity-processbot <>
      
      * bump serde to 1.0.163 (#7315)
      
      * bump serde to 1.0.163
      
      * bump ci
      
      * update lockfile for {"substrate"}
      
      ---------
      
      Co-authored-by: parity-processbot <>
      
      * fmt
      
      * Updated fmt
      
      * Removing changes accidentally pulled from master
      
      * fix another master pull issue
      
      * Another master pull fix
      
      * fmt
      
      * Fixing implementers guide build
      
      * Revert "Merge branch 'rh-async-backing-feature-while-frozen' of https://github.com/paritytech/polkadot
      
       into brad-rename-parathread"
      
      This reverts commit bebc24af52ab61155e3fe02cb3ce66a592bce49c, reversing
      changes made to 1b2de662dfb11173679d6da5bd0da9d149c85547.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Signed-off-by: default avataracatangiu <[email protected]>
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarMarcin S <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarMarcin S. <[email protected]>
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarSam Johnson <[email protected]>
      Co-authored-by: default avatarTsvetomir Dimitrov <[email protected]>
      Co-authored-by: default avatarAnthony Alaribe <[email protected]>
      Co-authored-by: default avatarMuharem Ismailov <[email protected]>
      Co-authored-by: default avatarAnthony Alaribe <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      
      * fix bitfield distribution test
      
      * approval distribution tests
      
      * fix bridge tests
      
      * update Cargo.lock
      
      * [async-backing-branch] Optimize collator-protocol validator-side request fetching (#7457)
      
      * Optimize collator-protocol validator-side request fetching
      
      * address feedback: replace tuples with structs
      
      * feedback: add doc comments
      
      * move collation types to subfolder
      
      ---------
      
      Signed-off-by: default avataralindima <[email protected]>
      
      * Update collation generation for asynchronous backing (#7405)
      
      * break candidate receipt construction and distribution into own function
      
      * update implementers' guide to include SubmitCollation
      
      * implement SubmitCollation for collation-generation
      
      * fmt
      
      * fix test compilation & remove unnecessary submodule
      
      * add some TODOs for a test suite.
      
      * Update roadmap/implementers-guide/src/types/overseer-protocol.md
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * add new test harness and first test
      
      * refactor to avoid requiring background sender
      
      * ensure collation gets packaged and distributed
      
      * tests for the fallback case with no hint
      
      * add parent rp-number hint tests
      
      * fmt
      
      * update uses of CollationGenerationConfig
      
      * fix remaining test
      
      * address review comments
      
      * use subsystemsender for background tasks
      
      * fmt
      
      * remove ValidationCodeHashHint and related tests
      
      ---------
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * fix some more fallout from merge
      
      * fmt
      
      * remove staging APIs from Rococo & Westend (#7513)
      
      * send network messages on main protocol name (#7515)
      
      * misc async backing improvements for allowed ancestry blocks (#7532)
      
      * shared: fix acquire_info
      
      * backwards-compat test for prospective parachains
      
      * same relay parent is allowed
      
      * provisioner: request candidate receipt by relay parent (#7527)
      
      * return candidates hash from prospective parachains
      
      * update provisioner
      
      * update tests
      
      * guide changes
      
      * send a single message to backing
      
      * fix test
      
      * revert to old `handle_new_activations` logic in some cases (#7514)
      
      * revert to old `handle_new_activations` logic
      
      * gate sending messages on scheduled cores to max_depth >= 2
      
      * fmt
      
      * 2->1
      
      * Omnibus asynchronous backing bugfix PR (#7529)
      
      * fix a bug in backing
      
      * add some more logs
      
      * prospective parachains: take ancestry only up to session bounds
      
      * add test
      
      * fix zombienet tests (#7614)
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      
      * fix runtime compilation
      
      * make bitfield distribution tests compile
      
      * attempt to fix zombienet disputes (#7618)
      
      * update metric name
      
      * update some metric names
      
      * avoid cycles when creating fake candidates
      
      * make undying collator more friendly to malformed parents
      
      * fix a bug in malus
      
      * fmt
      
      * clippy
      
      * add RUN_IN_CONTAINER to new ZombieNet tests (#7631)
      
      * remove duplicated migration
      
      happened because of master-merge
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Signed-off-by: default avataracatangiu <[email protected]>
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Signed-off-by: default avataralindima <[email protected]>
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: default avatarChris Sosnin <[email protected]>
      Co-authored-by: default avatarRobert Klotzner <[email protected]>
      Co-authored-by: default avatarRobert Klotzner <[email protected]>
      Co-authored-by: default avatarMarcin S <[email protected]>
      Co-authored-by: default avatarMarcin S <[email protected]>
      Co-authored-by: default avatarMattia L.V. Bradascio <[email protected]>
      Co-authored-by: default avatarBradley Olson <[email protected]>
      Co-authored-by: default avataralexgparity <[email protected]>
      Co-authored-by: default avatarBradleyOlson64 <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarSam Johnson <[email protected]>
      Co-authored-by: default avatarTsvetomir Dimitrov <[email protected]>
      Co-authored-by: default avatarAnthony Alaribe <[email protected]>
      Co-authored-by: default avatarMuharem Ismailov <[email protected]>
      Co-authored-by: default avatarAnthony Alaribe <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      Co-authored-by: default avatarAlin Dima <[email protected]>
      5174b9d2
  35. Aug 16, 2023
  36. Aug 15, 2023
    • alexd10s's avatar
      Change the Config of the MaxRococoNum Slot from a Constant to a Storage function (#7217) · bf785881
      alexd10s authored
      
      
      * set MaxPermanentSlots and MaxTemporarySlots with a extrinsic instead of a constant
      
      * delete the  MaxPermanentSlots and MaxTemporarySlots constants from config on  Rococo and Westend
      
      * migration code for assigned slots
      
      * remove getters
      
      * little refactor
      
      * set values in the GenesisConfig
      
      * refactor in the migration, adding it in the rococo runtime
      
      * refactor: fmt
      
      * Minor fix
      
      * pre_upgrade check
      
      * add migration to mod v1
      
      * Logs following Substrate#12873
      
      * fix: current storage version set to 1
      
      * use enact when try-runtime
      
      * Vec seems to be missing
      
      * feature gate import
      
      * fix as per #13993
      
      * address comments
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * address  comments
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * benchmarking for assign_perm_parachain_slot extrinsic
      
      * benchmark all the extrinsics of the pallet
      
      * cargo fmt for assigned slots
      
      * migration added for westend
      
      * licence in benchmarking file
      
      * BuildGenesisConfig
      
      * assigned_slots default in genesis
      
      * cargo fmt
      
      * assigned_slots fix tests config
      
      * cargo fmt
      
      * fix benchmarking compile error
      
      * fix benchmarking imports
      
      * benchmark worst case scenario for validation code and head data
      
      * add assigned_slots in frame_benchmarking on Rococo and Westend
      
      * modify values for para_id in benchmarking
      
      * delete the assigned_slots in westend frame_benchmarking
      
      * fix benchmarkings and add it to westend
      
      * cargo fmt
      
      * ".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtime=rococo --target_dir=polkadot --pallet=runtime_common::assigned_slots
      
      * ".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtime=westend --target_dir=polkadot --pallet=runtime_common::assigned_slots
      
      * use generated weights in assigned_slots pallet
      
      * small changes in set_max_permanent_slots and set_max_temporary_slots
      
      * revert last commit
      
      * address some comments
      
      * wrap migration with VersionCheckedMigrateToV1
      
      * add experimental feature in pallet, and assers in post_upgrade migration
      
      * clean warnings
      
      * clean unnecesary experimental flag
      
      * small typo in comments
      
      * cargo fmt
      
      * small comments fixes
      
      ---------
      
      Co-authored-by: default avataral3mart <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: command-bot <>
      bf785881
  37. Aug 14, 2023
  38. Jul 19, 2023
  39. Jul 18, 2023