Skip to content
  1. Apr 26, 2024
    • Tsvetomir Dimitrov's avatar
      Implementation of the new validator disabling strategy (#2226) · 988e30f1
      Tsvetomir Dimitrov authored
      Closes https://github.com/paritytech/polkadot-sdk/issues/1966,
      https://github.com/paritytech/polkadot-sdk/issues/1963 and
      https://github.com/paritytech/polkadot-sdk/issues/1962.
      
      Disabling strategy specification
      [here](https://github.com/paritytech/polkadot-sdk/pull/2955). (Updated
      13/02/2024)
      
      Implements:
      * validator disabling for a whole era instead of just a session
      * no more than 1/3 of the validators in the active set are disabled
      Removes:
      * `DisableStrategy` enum - now each validator committing an offence is
      disabled.
      * New era is not forced if too many validators are disabled.
      
      Before this PR not all offenders were disabled. A decision was made
      based on [`enum
      DisableStrategy`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/primitives/staking/src/offence.rs#L54).
      Some offenders were disabled for a whole era, some just for a session,
      some were not disabled at all.
      
      This PR changes the disabling behaviour. Now a validator committing an
      offense is disabled immediately till the end of the current era.
      
      Some implementation notes:
      * `OffendingValidators` in pallet session keeps all offenders (this is
      not changed). However its type is changed from `Vec<(u32, bool)>` to
      `Vec<u32>`. The reason is simple - each offender is getting disabled so
      the bool doesn't make sense anymore.
      * When a validator is disabled it is first added to
      `OffendingValidators` and then to `DisabledValidators`. This is done in
      [`add_offending_validator`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/frame/staking/src/slashing.rs#L325)
      from staking pallet.
      * In
      [`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe9829/substrate/frame/session/src/lib.rs#L623)
      the `end_session` also calls
      [`end_era`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/frame/staking/src/pallet/impls.rs#L490)
      when an era ends. In this case `OffendingValidators` are cleared
      **(1)**.
      * Then in
      [`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe9829/substrate/frame/session/src/lib.rs#L623)
      `DisabledValidators` are cleared **(2)**
      * And finally (still in `rotate_session`) a call to
      [`start_session`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316
      
      /substrate/frame/staking/src/pallet/impls.rs#L430)
      repopulates the disabled validators **(3)**.
      * The reason for this complication is that session pallet knows nothing
      abut eras. To overcome this on each new session the disabled list is
      repopulated (points 2 and 3). Staking pallet knows when a new era starts
      so with point 1 it ensures that the offenders list is cleared.
      
      ---------
      
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarMaciej <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarAnkan <[email protected]>
      988e30f1
  2. Apr 17, 2024
    • Oliver Tale-Yazdi's avatar
      Fix nostd build of several crates (#4060) · 7a2c9d4a
      Oliver Tale-Yazdi authored
      
      
      Preparation for https://github.com/paritytech/polkadot-sdk/pull/3935
      
      Changes:
      - Add some `default-features = false` for the case that a crate and that
      dependency both support nostd builds.
      - Shuffle files around of some benchmarking-only crates. These
      conditionally disabled the `cfg_attr` for nostd and pulled in libstd.
      Example [here](https://github.com/ggwpez/zepter/pull/95). The actual
      logic is moved into a `inner.rs` to preserve nostd capability of the
      crate in case the benchmarking feature is disabled.
      - Add some `use sp_std::vec` where needed.
      - Remove some `optional = true` in cases where it was not optional.
      - Removed one superfluous `cfg_attr(not(feature = "std"), no_std..`.
      
      All in all this should be logical no-op.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      7a2c9d4a
  3. Apr 02, 2024
    • Serban Iorga's avatar
      Align dependencies with `parity-bridges-common` (#3937) · 8e95a3e1
      Serban Iorga authored
      Working towards migrating the `parity-bridges-common` repo inside
      `polkadot-sdk`. This PR upgrades some dependencies in order to align
      them with the versions used in `parity-bridges-common`
      
      Related to
      https://github.com/paritytech/parity-bridges-common/issues/2538
      8e95a3e1
  4. Mar 26, 2024
    • Dcompoze's avatar
      Fix spelling mistakes across the whole repository (#3808) · 002d9260
      Dcompoze authored
      **Update:** Pushed additional changes based on the review comments.
      
      **This pull request fixes various spelling mistakes in this
      repository.**
      
      Most of the changes are contained in the first **3** commits:
      
      - `Fix spelling mistakes in comments and docs`
      
      - `Fix spelling mistakes in test names`
      
      - `Fix spelling mistakes in error messages, panic messages, logs and
      tracing`
      
      Other source code spelling mistakes are separated into individual
      commits for easier reviewing:
      
      - `Fix the spelling of 'authority'`
      
      - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
      
      - `Fix the spelling of 'prev_enqueud_messages'`
      
      - `Fix the spelling of 'endpoint'`
      
      - `Fix the spelling of 'children'`
      
      - `Fix the spelling of 'PenpalSiblingSovereignAccount'`
      
      - `Fix the spelling of 'PenpalSudoAccount'`
      
      - `Fix the spelling of 'insufficient'`
      
      - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
      
      - `Fix the spelling of 'subtracted'`
      
      - `Fix the spelling of 'CandidatePendingAvailability'`
      
      - `Fix the spelling of 'exclusive'`
      
      - `Fix the spelling of 'until'`
      
      - `Fix the spelling of 'discriminator'`
      
      - `Fix the spelling of 'nonexistent'`
      
      - `Fix the spelling of 'subsystem'`
      
      - `Fix the spelling of 'indices'`
      
      - `Fix the spelling of 'committed'`
      
      - `Fix the spelling of 'topology'`
      
      - `Fix the spelling of 'response'`
      
      - `Fix the spelling of 'beneficiary'`
      
      - `Fix the spelling of 'formatted'`
      
      - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
      
      - `Fix the spelling of 'succeeded'`
      
      - `Fix the spelling of 'reopened'`
      
      - `Fix the spelling of 'proposer'`
      
      - `Fix the spelling of 'InstantiationNonce'`
      
      - `Fix the spelling of 'depositor'`
      
      - `Fix the spelling of 'expiration'`
      
      - `Fix the spelling of 'phantom'`
      
      - `Fix the spelling of 'AggregatedKeyValue'`
      
      - `Fix the spelling of 'randomness'`
      
      - `Fix the spelling of 'defendant'`
      
      - `Fix the spelling of 'AquaticMammal'`
      
      - `Fix the spelling of 'transactions'`
      
      - `Fix the spelling of 'PassingTracingSubscriber'`
      
      - `Fix the spelling of 'TxSignaturePayload'`
      
      - `Fix the spelling of 'versioning'`
      
      - `Fix the spelling of 'descendant'`
      
      - `Fix the spelling of 'overridden'`
      
      - `Fix the spelling of 'network'`
      
      Let me know if this structure is adequate.
      
      **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
      `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
      as it is.
      
      ~~**Note:** In some places the term `Receival` is used to refer to
      message reception, IMO `Reception` is the correct word here, but I left
      it as it is.~~
      
      ~~**Note:** In some places the term `Overlayed` is used instead of the
      more acceptable version `Overlaid` but I also left it as it is.~~
      
      ~~**Note:** In some places the term `Applyable` is used instead of the
      correct version `Applicable` but I also left it as it is.~~
      
      **Note:** Some usage of British vs American english e.g. `judgement` vs
      `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
      are both present in different places, but I suppose that's
      understandable given the number of contributors.
      
      ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
      triggers errors in CI when I make changes to it, so I left it as it
      is.~~
      002d9260
  5. Mar 15, 2024
  6. Mar 13, 2024
    • georgepisaltu's avatar
      Revert "FRAME: Create `TransactionExtension` as a replacement for... · bbd51ce8
      georgepisaltu authored
      
      Revert "FRAME: Create `TransactionExtension` as a replacement for `SignedExtension` (#2280)" (#3665)
      
      This PR reverts #2280 which introduced `TransactionExtension` to replace
      `SignedExtension`.
      
      As a result of the discussion
      [here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700),
      the changes will be reverted for now with plans to reintroduce the
      concept in the future.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      bbd51ce8
  7. 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
  8. Feb 20, 2024
    • Oliver Tale-Yazdi's avatar
      Lift dependencies to the workspace (Part 2/x) (#3366) · e89d0fca
      Oliver Tale-Yazdi authored
      
      
      Lifting some more dependencies to the workspace. Just using the
      most-often updated ones for now.
      It can be reproduced locally.
      
      ```sh
      # First you can check if there would be semver incompatible bumps (looks good in this case):
      $ zepter transpose dependency lift-to-workspace --ignore-errors syn quote thiserror "regex:^serde.*"
      
      # Then apply the changes:
      $ zepter transpose dependency lift-to-workspace --version-resolver=highest syn quote thiserror "regex:^serde.*" --fix
      
      # And format the changes:
      $ taplo format --config .config/taplo.toml
      ```
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      e89d0fca
  9. Feb 16, 2024
    • dependabot[bot]'s avatar
      Bump the known_good_semver group with 6 updates (#3347) · 4b484e6a
      dependabot[bot] authored
      
      
      Bumps the known_good_semver group with 6 updates:
      
      | Package | From | To |
      | --- | --- | --- |
      | [serde](https://github.com/serde-rs/serde) | `1.0.195` | `1.0.196` |
      | [serde_json](https://github.com/serde-rs/json) | `1.0.111` | `1.0.113`
      |
      | [clap](https://github.com/clap-rs/clap) | `4.4.18` | `4.5.0` |
      | [syn](https://github.com/dtolnay/syn) | `2.0.48` | `2.0.49` |
      | [serde_yaml](https://github.com/dtolnay/serde-yaml) | `0.9.30` |
      `0.9.31` |
      | [serde_derive](https://github.com/serde-rs/serde) | `1.0.195` |
      `1.0.196` |
      
      Updates `serde` from 1.0.195 to 1.0.196
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/serde/releases">serde's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.196</h2>
      <ul>
      <li>Improve formatting of &quot;invalid type&quot; error messages
      involving floats (<a
      href="https://redirect.github.com/serde-rs/serde/issues/2682">#2682</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/serde/commit/ede9762a583c3cc3b87c10a53551828fad339525"><code>ede9762</code></a>
      Release 1.0.196</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/d438c2d67bf30e3edab31c2272c4829c12cf4cb5"><code>d438c2d</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2682">#2682</a>
      from dtolnay/decimalpoint</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/bef110b92a171ac568a47339f5bd97938a8c9da2"><code>bef110b</code></a>
      Format Unexpected::Float with decimal point</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/b971ef11d1b53da7673e0c8199e87509c003c1a8"><code>b971ef1</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2681">#2681</a>
      from dtolnay/workspacedeps</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/29d9f693996d199748136d5561a971ed68626724"><code>29d9f69</code></a>
      Fix workspace.dependencies default-features future compat warning</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/aecb4083bde754155752f5d7d442b64eb7dc636f"><code>aecb408</code></a>
      Sort workspace dependencies</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/1c675ab3a38e46df4e62465800970f8b20a2055d"><code>1c675ab</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2678">#2678</a>
      from rodoufu/workspaceDependencies</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/dd619630a337139424725697ccd9a9f7596a2d3a"><code>dd61963</code></a>
      Adding workspace dependencies</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/111803ab0768d010c606f2fc0d0add12750d5eef"><code>111803a</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2673">#2673</a>
      from Sky9x/msrv-badge</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/0024f74f34fbbdc44a7b22457faebe36c5cbe7f8"><code>0024f74</code></a>
      Use shields.io's MSRV badges</li>
      <li>See full diff in <a
      href="https://github.com/serde-rs/serde/compare/v1.0.195...v1.0.196">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `serde_json` from 1.0.111 to 1.0.113
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/json/releases">serde_json's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.113</h2>
      <ul>
      <li>Add <code>swap_remove</code> and <code>shift_remove</code> methods
      on Map (<a
      href="https://redirect.github.com/serde-rs/json/issues/1109">#1109</a>)</li>
      </ul>
      <h2>v1.0.112</h2>
      <ul>
      <li>Improve formatting of &quot;invalid type&quot; error messages
      involving floats (<a
      href="https://redirect.github.com/serde-rs/json/issues/1107">#1107</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/json/commit/09d865b34b9701be52764dc9bf571b1a16e9d3dc"><code>09d865b</code></a>
      Release 1.0.113</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/5aeab4eaf69d7959f013f8081865c264d6c00551"><code>5aeab4e</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/json/issues/1109">#1109</a>
      from serde-rs/remove</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/ca3c2ca3696cab79b8b279be7569ee1647250f1e"><code>ca3c2ca</code></a>
      Add swap_remove and shift_remove methods on Map</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/7fece969e3b480ec620419d65c2aeb08776bebcb"><code>7fece96</code></a>
      Release 1.0.112</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/6a6d2bbd9e8b8bd72573b863f12a4ec991f33232"><code>6a6d2bb</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/json/issues/1107">#1107</a>
      from serde-rs/unexpectedfloat</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/83d7bad54ba5db3a44198d6df0ff2e81621683fa"><code>83d7bad</code></a>
      Format f64 in error messages using ryu</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/107c2d1c42817f0d71f07a4d5b0ea2f29dbce8b8"><code>107c2d1</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/json/issues/1106">#1106</a>
      from serde-rs/invalidvalue</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/62ca3e4c01c2e62cd5c2a32e9104f386e5ce7808"><code>62ca3e4</code></a>
      Handle Unexpected::Unit in Error::invalid_value</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/296fafb8f32e8442ef8e4d5725c15ffca726b288"><code>296fafb</code></a>
      Factor out JSON-specific Display impl for serde::de::Unexpected</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/e56cc696bd7c112e5dd4ccfa23d094c3a1c1c1ff"><code>e56cc69</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/json/issues/1105">#1105</a>
      from keienWang/master</li>
      <li>Additional commits viewable in <a
      href="https://github.com/serde-rs/json/compare/v1.0.111...v1.0.113">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `clap` from 4.4.18 to 4.5.0
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
      changelog</a>.</em></p>
      <blockquote>
      <h2>[4.5.0] - 2024-02-08</h2>
      <h3>Compatibility</h3>
      <ul>
      <li>Update MSRV to 1.74</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/clap-rs/clap/commit/a751c5fe65cd33cb09e85ff3039b4fd0182cdb6e"><code>a751c5f</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/9ec6c942b81c370a8c14652e42295933244555ac"><code>9ec6c94</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/0735119775c2d27fef6b3c232cb9ef2fcbbd963f"><code>0735119</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/c4d3959506f5068f86ffb7ab34b622bd2da40dd8"><code>c4d3959</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5344">#5344</a>
      from epage/encode</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/f750e577789e1dd34c6950d8c8fe16d1bfd1f49c"><code>f750e57</code></a>
      fix(lex): Use new-ish OsStr API</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/1d9a554cdfddffcb92d197706b9720e2760cb443"><code>1d9a554</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5343">#5343</a>
      from epage/msrv</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/4b45d361b1b96eb1f37b7d1db2684203ca828a94"><code>4b45d36</code></a>
      chore: Update MSRV to 1.74</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/55b1f945157d4d0e480dea6c492e04d0b541088a"><code>55b1f94</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5342">#5342</a>
      from epage/divan</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/ea77b98da3f321069ae136a241a2d266c2b28bd7"><code>ea77b98</code></a>
      test(complete): Make it order independent</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/b0fea2bac60819bdb042e10c032817fded67f815"><code>b0fea2b</code></a>
      test(bench): Switch to divan</li>
      <li>Additional commits viewable in <a
      href="https://github.com/clap-rs/clap/compare/v4.4.18...clap_complete-v4.5.0">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `syn` from 2.0.48 to 2.0.49
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/syn/releases">syn's
      releases</a>.</em></p>
      <blockquote>
      <h2>2.0.49</h2>
      <ul>
      <li>Improve error location when parsing from an empty string literal
      using <code>LitStr::parse</code> (<a
      href="https://redirect.github.com/dtolnay/syn/issues/1590">#1590</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/syn/commit/e64c0636042bcd8cf56f9e6c3e828a49cb434649"><code>e64c063</code></a>
      Release 2.0.49</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/981359c5f46f25f3db42d1b341cc607f634688e7"><code>981359c</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/syn/issues/1590">#1590</a>
      from dtolnay/streof</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/51298d40a447b9e5b3cd8c898c2ea9d24b31cd6d"><code>51298d4</code></a>
      Improve error location at eof in LitStr::parse</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/270c63384a9d891f65880a03a5a92f0bf4605bbf"><code>270c633</code></a>
      Update test suite to nightly-2024-02-13</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/dc9cf16b9b0601d2d393d059c46a8f8e0220cc21"><code>dc9cf16</code></a>
      Remove FilterAttrs trait when unused</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/7dcfac79eda716fa806d68cc0aa811f3be717dc0"><code>7dcfac7</code></a>
      Ignore dead_code warning in test</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/98318441089f9a9bb596fc010ed14c3b593d4bda"><code>9831844</code></a>
      Update signature of Emitter::emit_diagnostic in nightly-2024-02-07</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/9e8033f63da93dfb6a3e698449c6edff5e56727d"><code>9e8033f</code></a>
      Update test suite to nightly-2024-02-07</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/cb3348cd94be50995054796facdfa055b6e0e9e8"><code>cb3348c</code></a>
      Update test suite to nightly-2024-01-23</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/15b9dbcd67bc56f3da7d33bbede46f7380fc7164"><code>15b9dbc</code></a>
      Update test suite to nightly-2024-01-19</li>
      <li>Additional commits viewable in <a
      href="https://github.com/dtolnay/syn/compare/2.0.48...2.0.49">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `serde_yaml` from 0.9.30 to 0.9.31
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/serde-yaml/releases">serde_yaml's
      releases</a>.</em></p>
      <blockquote>
      <h2>0.9.31</h2>
      <ul>
      <li>Add <code>swap_remove</code> and <code>shift_remove</code> methods
      on Mapping (<a
      href="https://redirect.github.com/dtolnay/serde-yaml/issues/408">#408</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/2a77483b23897115bdd69af32ae34d593268d555"><code>2a77483</code></a>
      Release 0.9.31</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/d8d1a839cf42ef4627c66bebd743f5fecd24e3ed"><code>d8d1a83</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/serde-yaml/issues/408">#408</a>
      from dtolnay/remove</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/f8a99a496836ccfa6c547af9136986d13011be98"><code>f8a99a4</code></a>
      Add swap_remove and shift_remove methods on Mapping</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/8b26413e3307e39329dc68a96b065058aec38f9a"><code>8b26413</code></a>
      Work around dead_code warning in tests</li>
      <li>See full diff in <a
      href="https://github.com/dtolnay/serde-yaml/compare/0.9.30...0.9.31">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `serde_derive` from 1.0.195 to 1.0.196
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/serde/releases">serde_derive's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.196</h2>
      <ul>
      <li>Improve formatting of &quot;invalid type&quot; error messages
      involving floats (<a
      href="https://redirect.github.com/serde-rs/serde/issues/2682">#2682</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/serde/commit/ede9762a583c3cc3b87c10a53551828fad339525"><code>ede9762</code></a>
      Release 1.0.196</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/d438c2d67bf30e3edab31c2272c4829c12cf4cb5"><code>d438c2d</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2682">#2682</a>
      from dtolnay/decimalpoint</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/bef110b92a171ac568a47339f5bd97938a8c9da2"><code>bef110b</code></a>
      Format Unexpected::Float with decimal point</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/b971ef11d1b53da7673e0c8199e87509c003c1a8"><code>b971ef1</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2681">#2681</a>
      from dtolnay/workspacedeps</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/29d9f693996d199748136d5561a971ed68626724"><code>29d9f69</code></a>
      Fix workspace.dependencies default-features future compat warning</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/aecb4083bde754155752f5d7d442b64eb7dc636f"><code>aecb408</code></a>
      Sort workspace dependencies</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/1c675ab3a38e46df4e62465800970f8b20a2055d"><code>1c675ab</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2678">#2678</a>
      from rodoufu/workspaceDependencies</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/dd619630a337139424725697ccd9a9f7596a2d3a"><code>dd61963</code></a>
      Adding workspace dependencies</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/111803ab0768d010c606f2fc0d0add12750d5eef"><code>111803a</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2673">#2673</a>
      from Sky9x/msrv-badge</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/0024f74f34fbbdc44a7b22457faebe36c5cbe7f8"><code>0024f74</code></a>
      Use shields.io's MSRV badges</li>
      <li>See full diff in <a
      href="https://github.com/serde-rs/serde/compare/v1.0.195...v1.0.196">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      Dependabot will resolve any conflicts with this PR as long as you don't
      alter it yourself. You can also trigger a rebase manually by commenting
      `@dependabot rebase`.
      
      [//]: # (dependabot-automerge-start)
      [//]: # (dependabot-automerge-end)
      
      ---
      
      <details>
      <summary>Dependabot commands and options</summary>
      <br />
      
      You can trigger Dependabot actions by commenting on this PR:
      - `@dependabot rebase` will rebase this PR
      - `@dependabot recreate` will recreate this PR, overwriting any edits
      that have been made to it
      - `@dependabot merge` will merge this PR after your CI passes on it
      - `@dependabot squash and merge` will squash and merge this PR after
      your CI passes on it
      - `@dependabot cancel merge` will cancel a previously requested merge
      and block automerging
      - `@dependabot reopen` will reopen this PR if it is closed
      - `@dependabot close` will close this PR and stop Dependabot recreating
      it. You can achieve the same result by closing it manually
      - `@dependabot show <dependency name> ignore conditions` will show all
      of the ignore conditions of the specified dependency
      - `@dependabot ignore <dependency name> major version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's major version (unless you unignore this specific
      dependency's major version or upgrade to it yourself)
      - `@dependabot ignore <dependency name> minor version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's minor version (unless you unignore this specific
      dependency's minor version or upgrade to it yourself)
      - `@dependabot ignore <dependency name>` will close this group update PR
      and stop Dependabot creating any more for the specific dependency
      (unless you unignore this specific dependency or upgrade to it yourself)
      - `@dependabot unignore <dependency name>` will remove all of the ignore
      conditions of the specified dependency
      - `@dependabot unignore <dependency name> <ignore condition>` will
      remove the ignore condition of the specified dependency and ignore
      conditions
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      4b484e6a
  10. Feb 12, 2024
    • Oliver Tale-Yazdi's avatar
      Lift dependencies to the workspace (Part 1) (#2070) · e80c2473
      Oliver Tale-Yazdi authored
      Changes (partial https://github.com/paritytech/polkadot-sdk/issues/994):
      - Set log to `0.4.20` everywhere
      - Lift `log` to the workspace
      
      Starting with a simpler one after seeing
      https://github.com/paritytech/polkadot-sdk/pull/2065 from @jsdw
      
      .
      This sets the `default-features` to `false` in the root and then
      overwrites that in each create to its original value. This is necessary
      since otherwise the `default` features are additive and its impossible
      to disable them in the crate again once they are enabled in the
      workspace.
      
      I am using a tool to do this, so its mostly a test to see that it works
      as expected.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      e80c2473
  11. 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
  12. Jan 26, 2024
  13. Jan 22, 2024
  14. Jan 07, 2024
    • dependabot[bot]'s avatar
      Bump the known_good_semver group with 4 updates (#2865) · 204fe7ff
      dependabot[bot] authored
      
      
      Bumps the known_good_semver group with 4 updates:
      [serde](https://github.com/serde-rs/serde),
      [serde_json](https://github.com/serde-rs/json),
      [clap](https://github.com/clap-rs/clap) and
      [syn](https://github.com/dtolnay/syn).
      
      Updates `serde` from 1.0.194 to 1.0.195
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/serde/releases">serde's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.195</h2>
      <ul>
      <li>Prevent remote definitions of tuple struct or tuple variant from
      triggering dead_code warning (<a
      href="https://redirect.github.com/serde-rs/serde/issues/2671">#2671</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/serde/commit/03eec42c3313b36da416be1486e9ecac345784d5"><code>03eec42</code></a>
      Release 1.0.195</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/196f311ae2fd8ad94fe38a57830419859a4d3dbb"><code>196f311</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2671">#2671</a>
      from dtolnay/deadremote</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/38d9e0b2091e9b6150486c2c37367819b86bcc39"><code>38d9e0b</code></a>
      Revert &quot;Add FIXME to fix dead_code warning when using
      serde(remote)&quot;</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/6502b3131697eff6420786ad71f87f29cfff3a13"><code>6502b31</code></a>
      Fix new dead_code warning in tuple struct and tuple variant remote
      defs</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/6f1a8c3115c8d2502178c25d610fbaee2e82c46b"><code>6f1a8c3</code></a>
      Add FIXME to fix dead_code warning when using serde(remote)</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/d883c94cc9fe72d0512dc7f4def7191a401595c9"><code>d883c94</code></a>
      Work around dead_code warning in tests</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/961fa59a7469c5b5e323b9723323df412048d60d"><code>961fa59</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2670">#2670</a>
      from serde-rs/exhaustive</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/8bc71def551df190e6817d3311e5c76f751f53e6"><code>8bc71de</code></a>
      Fill in omitted patterns for GenericArguments match</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/7c65a9dc0eab2d4d829b258a7b3549351bbe8dcd"><code>7c65a9d</code></a>
      Pick up changes to non_exhaustive_omitted_patterns lint</li>
      <li>See full diff in <a
      href="https://github.com/serde-rs/serde/compare/v1.0.194...v1.0.195">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `serde_json` from 1.0.110 to 1.0.111
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/json/releases">serde_json's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.111</h2>
      <ul>
      <li>Improve floating point parsing performance on loongarch64 (<a
      href="https://redirect.github.com/serde-rs/json/issues/1100">#1100</a>,
      thanks <a
      href="https://github.com/heiher"><code>@​heiher</code></a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/json/commit/0131ac68212e8094bd14ee618587d731b4f9a68b"><code>0131ac6</code></a>
      Release 1.0.111</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/96ecfadd3f7dd6366a2d07a098e228d15df93cb4"><code>96ecfad</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/json/issues/1100">#1100</a>
      from heiher/limb-64-la64</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/c80dbaf8ff5902ca670e0a48bbe495065b9314f5"><code>c80dbaf</code></a>
      Set limb width to 64 for loongarch64</li>
      <li>See full diff in <a
      href="https://github.com/serde-rs/json/compare/v1.0.110...v1.0.111">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `clap` from 4.4.12 to 4.4.13
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/releases">clap's
      releases</a>.</em></p>
      <blockquote>
      <h2>v4.4.13</h2>
      <h2>[4.4.13] - 2024-01-04</h2>
      <h3>Documentation</h3>
      <ul>
      <li>Fix link to structopt migration guide</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
      changelog</a>.</em></p>
      <blockquote>
      <h2>[4.4.13] - 2024-01-04</h2>
      <h3>Documentation</h3>
      <ul>
      <li>Fix link to structopt migration guide</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/clap-rs/clap/commit/2ab48b295c2463ce8c141a9868095b811ccf3b99"><code>2ab48b2</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/7a06a8cd619db704c6d826bf752eae3b86ce23a8"><code>7a06a8c</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/cca190efedf40f48147a3a4a777a9cc17728abdf"><code>cca190e</code></a>
      docs: Correct link to StructOpt migration guide</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/5c31f453c1a9f46109db8e0a47ed212748c0556c"><code>5c31f45</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5281">#5281</a>
      from Manishearth/safety-docs</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/ddae7e6f411c4c87294212152b8d9beea16637e7"><code>ddae7e6</code></a>
      Correct safety docs</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/48d28aa689bfd0fb44ec025244b30ba261e2515a"><code>48d28aa</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/748ce18cc2ccc3f7c07fa8b7c5b6f90ed9242b72"><code>748ce18</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/adbe6ec4cb6a617070c41927a389d0bea7b30936"><code>adbe6ec</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5278">#5278</a>
      from henry-hsieh/fix-nosort</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/2b48858ba84c62e9af97bee4734d70530254cd8a"><code>2b48858</code></a>
      fix: Skip nosort option below bash 4.4</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/777b744102cde324dc75534ef043efc15a9f40be"><code>777b744</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5277">#5277</a>
      from clap-rs/renovate/actions-setup-python-5.x</li>
      <li>Additional commits viewable in <a
      href="https://github.com/clap-rs/clap/compare/v4.4.12...v4.4.13">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `syn` from 2.0.47 to 2.0.48
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/syn/releases">syn's
      releases</a>.</em></p>
      <blockquote>
      <h2>2.0.48</h2>
      <ul>
      <li>Improve error message on unexpected token after <code>else</code>
      (<a
      href="https://redirect.github.com/dtolnay/syn/issues/1578">#1578</a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/syn/commit/5e16fc24e68b16a381cb7ef22455dba9db143083"><code>5e16fc2</code></a>
      Release 2.0.48</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/dc40084b15ab4a443179fc39cbadac6452408838"><code>dc40084</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/syn/issues/1578">#1578</a>
      from dtolnay/elseblock</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/82fcefce69d36e78301936c5af91f005d6a24357"><code>82fcefc</code></a>
      Fix error message on unexpected token after 'else'</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/e8a5c68ad45194e575a923f6b1e08f1817196331"><code>e8a5c68</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/syn/issues/1576">#1576</a>
      from dtolnay/exhaustive</li>
      <li><a
      href="https://github.com/dtolnay/syn/commit/97b1df6d935cb4801f4090782304577c8574d024"><code>97b1df6</code></a>
      Pick up changes to non_exhaustive_omitted_patterns lint</li>
      <li>See full diff in <a
      href="https://github.com/dtolnay/syn/compare/2.0.47...2.0.48">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      Dependabot will resolve any conflicts with this PR as long as you don't
      alter it yourself. You can also trigger a rebase manually by commenting
      `@dependabot rebase`.
      
      [//]: # (dependabot-automerge-start)
      [//]: # (dependabot-automerge-end)
      
      ---
      
      <details>
      <summary>Dependabot commands and options</summary>
      <br />
      
      You can trigger Dependabot actions by commenting on this PR:
      - `@dependabot rebase` will rebase this PR
      - `@dependabot recreate` will recreate this PR, overwriting any edits
      that have been made to it
      - `@dependabot merge` will merge this PR after your CI passes on it
      - `@dependabot squash and merge` will squash and merge this PR after
      your CI passes on it
      - `@dependabot cancel merge` will cancel a previously requested merge
      and block automerging
      - `@dependabot reopen` will reopen this PR if it is closed
      - `@dependabot close` will close this PR and stop Dependabot recreating
      it. You can achieve the same result by closing it manually
      - `@dependabot show <dependency name> ignore conditions` will show all
      of the ignore conditions of the specified dependency
      - `@dependabot ignore <dependency name> major version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's major version (unless you unignore this specific
      dependency's major version or upgrade to it yourself)
      - `@dependabot ignore <dependency name> minor version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's minor version (unless you unignore this specific
      dependency's minor version or upgrade to it yourself)
      - `@dependabot ignore <dependency name>` will close this group update PR
      and stop Dependabot creating any more for the specific dependency
      (unless you unignore this specific dependency or upgrade to it yourself)
      - `@dependabot unignore <dependency name>` will remove all of the ignore
      conditions of the specified dependency
      - `@dependabot unignore <dependency name> <ignore condition>` will
      remove the ignore condition of the specified dependency and ignore
      conditions
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      204fe7ff
  15. Jan 04, 2024
    • dependabot[bot]'s avatar
      Bump the known_good_semver group with 4 updates (#2845) · 88e7b49c
      dependabot[bot] authored
      
      
      Bumps the known_good_semver group with 4 updates:
      [serde](https://github.com/serde-rs/serde),
      [serde_json](https://github.com/serde-rs/json),
      [clap](https://github.com/clap-rs/clap) and
      [serde_yaml](https://github.com/dtolnay/serde-yaml).
      
      Updates `serde` from 1.0.193 to 1.0.194
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/serde/releases">serde's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.194</h2>
      <ul>
      <li>Update proc-macro2 to fix caching issue when using a rustc-wrapper
      such as sccache</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/serde/commit/d2d977a6c6dcff237ae956336d18b0c900c61aad"><code>d2d977a</code></a>
      Release 1.0.194</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/a9a6ee9d7f2e3a3306ad7c7a8f21dcf369c6acb7"><code>a9a6ee9</code></a>
      Pull in proc-macro2 sccache fix</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/28c5d215c11b66368b725f04cb92e49e4350bcdc"><code>28c5d21</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2669">#2669</a>
      from dtolnay/optionifletelse</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/3d6a789562579fb7ea783e0d7f35530914d8baca"><code>3d6a789</code></a>
      Remove option_if_let_else clippy suppression</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/a0e68698e33fa928f1d9f208d68b17df9f8bb568"><code>a0e6869</code></a>
      Work around doc_link_with_quotes pedantic clippy lint</li>
      <li>See full diff in <a
      href="https://github.com/serde-rs/serde/compare/v1.0.193...v1.0.194">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `serde_json` from 1.0.108 to 1.0.110
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/json/releases">serde_json's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.109</h2>
      <ul>
      <li>Documentation improvements</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/json/commit/df5cf215b70fb6341b255e7c0a210c06f64c0669"><code>df5cf21</code></a>
      Release 1.0.110</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/c35856a93c37b48b3d6efc4fec8e05554dd3f9d5"><code>c35856a</code></a>
      Pull in proc-macro2 sccache fix</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/f88bf1fccb05aa4de129675de44eb6aaf3fec0a0"><code>f88bf1f</code></a>
      Release 1.0.109</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/bb62c73ecef901e689b0a7a67ed613a32975520c"><code>bb62c73</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/json/issues/1097">#1097</a>
      from serde-rs/doccfg</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/df36d109fd9f9cdd22a874c0177cafec12237f95"><code>df36d10</code></a>
      Restore doc cfg on re-exports</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/c3670913423329c166add9d85ecdfc3e3da21e7a"><code>c367091</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/json/issues/1095">#1095</a>
      from dtolnay/hashtest</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/b328ee7df4dd772922f084600aa7cea39218b694"><code>b328ee7</code></a>
      Eliminate hash closure in favor of calling hash_one directly</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/b9bcbad3c094042f79f1a45189ec0edbb8f9f322"><code>b9bcbad</code></a>
      Use BuildHasher::hash_one</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/7ff6c9e30c2ecc2cdcf089ed86c7ccfe7a41721c"><code>7ff6c9e</code></a>
      Use random hasher state for number hashing test</li>
      <li><a
      href="https://github.com/serde-rs/json/commit/fe031cd1de4dde5b47e0f18934632b41bd18b48d"><code>fe031cd</code></a>
      Delete trace_macros! functionality from test</li>
      <li>Additional commits viewable in <a
      href="https://github.com/serde-rs/json/compare/v1.0.108...v1.0.110">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `clap` from 4.4.11 to 4.4.12
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/releases">clap's
      releases</a>.</em></p>
      <blockquote>
      <h2>v4.4.12</h2>
      <h2>[4.4.12] - 2023-12-28</h2>
      <h3>Performance</h3>
      <ul>
      <li>Only ask <code>TypedValueParser</code> for possible values if
      needed</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
      changelog</a>.</em></p>
      <blockquote>
      <h2>[4.4.12] - 2023-12-28</h2>
      <h3>Performance</h3>
      <ul>
      <li>Only ask <code>TypedValueParser</code> for possible values if
      needed</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/clap-rs/clap/commit/6d601e6f312857d78f47741268f1748840484d4a"><code>6d601e6</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/048e7f0fbc4f8108894e4307af768c8d332a0576"><code>048e7f0</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/53f5b820988c1c03f0d2696fc144857ad461edc1"><code>53f5b82</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5267">#5267</a>
      from vermiculus/sa/avoid-pv-expansion-in-help</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/05cd057978db743a65fb5fde33213af752d064e7"><code>05cd057</code></a>
      perf: Avoid retrieving possible_values unless used</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/29208083b0598ba7d1b80e79821c0ba3eb2342ce"><code>2920808</code></a>
      test: Update snapshots</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/28763ebb6d8714f6ca588bf477729040e0e760b0"><code>28763eb</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/ace7bb5b4570b030f7c2d0fa91e0afaaac1b0030"><code>ace7bb5</code></a>
      docs(complete): Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/76beca4d4d42a817bbb578f23553c64ded2aea97"><code>76beca4</code></a>
      docs(complete): Polish API reference for dynamic</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/3630e582d3ec59912b8e9369c38687695ddb1f43"><code>3630e58</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5273">#5273</a>
      from epage/docsrs</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/3724b9e2e4c2a2e69337b6d809949b246d3fef39"><code>3724b9e</code></a>
      docs: Include more content on docs.rs</li>
      <li>See full diff in <a
      href="https://github.com/clap-rs/clap/compare/v4.4.11...v4.4.12">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `serde_yaml` from 0.9.29 to 0.9.30
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/dtolnay/serde-yaml/releases">serde_yaml's
      releases</a>.</em></p>
      <blockquote>
      <h2>0.9.30</h2>
      <ul>
      <li>Update proc-macro2 to fix caching issue when using a rustc-wrapper
      such as sccache</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/09ee25156f608f95150b27edd120bd5471db3c64"><code>09ee251</code></a>
      Release 0.9.30</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/caea939ece85ab54ac41de0672d683905f1e406a"><code>caea939</code></a>
      Pull in proc-macro2 sccache fix</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/d255918c141fd72d01f169bb5aa0152234981699"><code>d255918</code></a>
      Merge pull request <a
      href="https://redirect.github.com/dtolnay/serde-yaml/issues/403">#403</a>
      from dtolnay/optionifletelse</li>
      <li><a
      href="https://github.com/dtolnay/serde-yaml/commit/8cfeedd766f83dab24d03b9fb11b72886a247425"><code>8cfeedd</code></a>
      Remove option_if_let_else clippy suppression</li>
      <li>See full diff in <a
      href="https://github.com/dtolnay/serde-yaml/compare/0.9.29...0.9.30">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      Dependabot will resolve any conflicts with this PR as long as you don't
      alter it yourself. You can also trigger a rebase manually by commenting
      `@dependabot rebase`.
      
      [//]: # (dependabot-automerge-start)
      [//]: # (dependabot-automerge-end)
      
      ---
      
      <details>
      <summary>Dependabot commands and options</summary>
      <br />
      
      You can trigger Dependabot actions by commenting on this PR:
      - `@dependabot rebase` will rebase this PR
      - `@dependabot recreate` will recreate this PR, overwriting any edits
      that have been made to it
      - `@dependabot merge` will merge this PR after your CI passes on it
      - `@dependabot squash and merge` will squash and merge this PR after
      your CI passes on it
      - `@dependabot cancel merge` will cancel a previously requested merge
      and block automerging
      - `@dependabot reopen` will reopen this PR if it is closed
      - `@dependabot close` will close this PR and stop Dependabot recreating
      it. You can achieve the same result by closing it manually
      - `@dependabot show <dependency name> ignore conditions` will show all
      of the ignore conditions of the specified dependency
      - `@dependabot ignore <dependency name> major version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's major version (unless you unignore this specific
      dependency's major version or upgrade to it yourself)
      - `@dependabot ignore <dependency name> minor version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's minor version (unless you unignore this specific
      dependency's minor version or upgrade to it yourself)
      - `@dependabot ignore <dependency name>` will close this group update PR
      and stop Dependabot creating any more for the specific dependency
      (unless you unignore this specific dependency or upgrade to it yourself)
      - `@dependabot unignore <dependency name>` will remove all of the ignore
      conditions of the specified dependency
      - `@dependabot unignore <dependency name> <ignore condition>` will
      remove the ignore condition of the specified dependency and ignore
      conditions
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      88e7b49c
  16. Dec 13, 2023
  17. Dec 12, 2023
    • Ross Bulat's avatar
      Staking: Add `deprecate_controller_batch` AdminOrigin call (#2589) · 048a9c27
      Ross Bulat authored
      
      
      Partially Addresses #2500
      
      Adds a `deprecate_controller_batch` call to the staking pallet that is
      callable by `Root` and `StakingAdmin`. To be used for controller account
      deprecation and removed thereafter. Adds
      `MaxControllersDeprecationBatch` pallet constant that defines max
      possible deprecations per call.
      
      - [x] Add `deprecate_controller_batch` call, and
      `MaxControllersInDeprecationBatch` constant.
      - [x] Add tests, benchmark, weights. Tests that weight is only consumed
      if unique pair.
      - [x] Adds `StakingAdmin` origin to staking's `AdminOrigin` type in
      westend runtime.
      - [x] Determined that worst case 5,900 deprecations does fit into
      `maxBlock` `proofSize` and `refTime` in both normal and operational
      thresholds, meaning we can deprecate all controllers for each network in
      one call.
      
      ## Block Weights
      
      By querying `consts.system.blockWeights` we can see that the
      `deprecate_controller_batch` weights fit within the `normal` threshold
      on Polkadot.
      
      #### `controller_deprecation_batch` where i = 5900:
      #### Ref time: 69,933,325,300
      #### Proof size: 21,040,390
      
      ### Polkadot 
      
      ```
      // consts.query.blockWeights
      
      maxBlock: {
              refTime: 2,000,000,000,000
              proofSize: 18,446,744,073,709,551,615
      }
      normal: {
       maxExtrinsic: {
      	refTime: 1,479,873,955,000
      	proofSize: 13,650,590,614,545,068,195
       }
       maxTotal: {
      	refTime: 1,500,000,000,000
      	proofSize: 13,835,058,055,282,163,711
       }
      }
      ```
      
      ### Kusama
      
      ```
      // consts.query.blockWeights
      
        maxBlock: {
          refTime: 2,000,000,000,000
          proofSize: 18,446,744,073,709,551,615
        }
          normal: {
            maxExtrinsic: {
              refTime: 1,479,875,294,000
              proofSize: 13,650,590,614,545,068,195
            }
            maxTotal: {
              refTime: 1,500,000,000,000
              proofSize: 13,835,058,055,282,163,711
            }
      }
      ```
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      048a9c27
  18. Dec 01, 2023
  19. Nov 30, 2023
    • dependabot[bot]'s avatar
      Bump the known_good_semver group with 2 updates (#2570) · 6742aba0
      dependabot[bot] authored
      
      
      Bumps the known_good_semver group with 2 updates:
      [serde](https://github.com/serde-rs/serde) and
      [clap](https://github.com/clap-rs/clap).
      
      Updates `serde` from 1.0.188 to 1.0.193
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/serde-rs/serde/releases">serde's
      releases</a>.</em></p>
      <blockquote>
      <h2>v1.0.193</h2>
      <ul>
      <li>Fix field names used for the deserialization of
      <code>RangeFrom</code> and <code>RangeTo</code> (<a
      href="https://redirect.github.com/serde-rs/serde/issues/2653">#2653</a>,
      <a
      href="https://redirect.github.com/serde-rs/serde/issues/2654">#2654</a>,
      <a
      href="https://redirect.github.com/serde-rs/serde/issues/2655">#2655</a>,
      thanks <a
      href="https://github.com/emilbonnek"><code>@​emilbonnek</code></a>)</li>
      </ul>
      <h2>v1.0.192</h2>
      <ul>
      <li>Allow internal tag field in untagged variant (<a
      href="https://redirect.github.com/serde-rs/serde/issues/2646">#2646</a>,
      thanks <a
      href="https://github.com/robsdedude"><code>@​robsdedude</code></a>)</li>
      </ul>
      <h2>v1.0.191</h2>
      <ul>
      <li>Documentation improvements</li>
      </ul>
      <h2>v1.0.190</h2>
      <ul>
      <li>Preserve NaN sign when deserializing f32 from f64 or vice versa (<a
      href="https://redirect.github.com/serde-rs/serde/issues/2637">#2637</a>)</li>
      </ul>
      <h2>v1.0.189</h2>
      <ul>
      <li>Fix &quot;cannot infer type&quot; error when internally tagged enum
      contains untagged variant (<a
      href="https://redirect.github.com/serde-rs/serde/issues/2613">#2613</a>,
      thanks <a href="https://github.com/ahl"><code>@​ahl</code></a>)</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/serde-rs/serde/commit/44613c7d0190dbb5ecd2d5ec19c636f45b7488cc"><code>44613c7</code></a>
      Release 1.0.193</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/c706281df3c8d50dba1763f19c856df2746eba6c"><code>c706281</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2655">#2655</a>
      from dtolnay/rangestartend</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/65d75b8fe3105f00ab2e01537d568d4587167582"><code>65d75b8</code></a>
      Add RangeFrom and RangeTo tests</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/332b0cba40bcbcc7a6b23a9706277c54791a9856"><code>332b0cb</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2654">#2654</a>
      from dtolnay/rangestartend</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/8c4af412969086bc8f54fdc2a079d373632e0a03"><code>8c4af41</code></a>
      Fix more RangeFrom / RangeEnd mixups</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/24a78f071b22ae491eec4127be696ac255b9b5d3"><code>24a78f0</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2653">#2653</a>
      from emilbonnek/fix/range-to-from-de-mixup</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/c91c33436d7aaef7472ebc18b734ddc9b5bd11fa"><code>c91c334</code></a>
      Fix Range{From,To} deserialize mixup</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/2083f43a287cac8302009fda5bbe41518dd83209"><code>2083f43</code></a>
      Update ui test suite to nightly-2023-11-19</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/4676abdc9e6bbbddfb33a00ce8d7e81e92f01120"><code>4676abd</code></a>
      Release 1.0.192</li>
      <li><a
      href="https://github.com/serde-rs/serde/commit/35700eb23e21d8cb198ef4a422ddad13b855ce3b"><code>35700eb</code></a>
      Merge pull request <a
      href="https://redirect.github.com/serde-rs/serde/issues/2646">#2646</a>
      from robsdedude/fix/2643/allow-tag-field-in-untagged</li>
      <li>Additional commits viewable in <a
      href="https://github.com/serde-rs/serde/compare/v1.0.188...v1.0.193">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      Updates `clap` from 4.4.6 to 4.4.10
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/releases">clap's
      releases</a>.</em></p>
      <blockquote>
      <h2>v4.4.10</h2>
      <h2>[4.4.10] - 2023-11-28</h2>
      <h3>Documentation</h3>
      <ul>
      <li>Link out to changelog</li>
      <li>Cross link derive's attribute reference to derive tutorial</li>
      </ul>
      <h2>v4.4.9</h2>
      <h2>[4.4.9] - 2023-11-27</h2>
      <h3>Fixes</h3>
      <ul>
      <li><em>(help)</em> Show correct <code>Command::about</code> under
      flattened headings</li>
      <li><em>(help)</em> Respect <code>hide</code> when flattening
      subcommands</li>
      </ul>
      <h2>v4.4.8</h2>
      <h2>[4.4.8] - 2023-11-10</h2>
      <h3>Features</h3>
      <ul>
      <li>Add <code>Command::flatten_help</code> to allow <code>git stash
      -h</code> like help for subcommands</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
      changelog</a>.</em></p>
      <blockquote>
      <h2>[4.4.10] - 2023-11-28</h2>
      <h3>Documentation</h3>
      <ul>
      <li>Link out to changelog</li>
      <li>Cross link derive's attribute reference to derive tutorial</li>
      </ul>
      <h2>[4.4.9] - 2023-11-27</h2>
      <h3>Fixes</h3>
      <ul>
      <li><em>(help)</em> Show correct <code>Command::about</code> under
      flattened headings</li>
      <li><em>(help)</em> Respect <code>hide</code> when flattening
      subcommands</li>
      </ul>
      <h2>[4.4.8] - 2023-11-10</h2>
      <h3>Features</h3>
      <ul>
      <li>Add <code>Command::flatten_help</code> to allow <code>git stash
      -h</code> like help for subcommands</li>
      </ul>
      <h2>[4.4.7] - 2023-10-24</h2>
      <h3>Performance</h3>
      <ul>
      <li>Reduced code size</li>
      </ul>
      </blockquote>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/clap-rs/clap/commit/c0a1814d3c1d93c18faaedc95fd251846e47f4fe"><code>c0a1814</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/c83e681e20b05f7e128088f47f8fcfc44e8ea166"><code>c83e681</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/91bcac4ca9d442786f554abeb7b1ed6d7a464a42"><code>91bcac4</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5230">#5230</a>
      from epage/migrate</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/030d87505d150345ddd425c1df21c034d2ae7748"><code>030d875</code></a>
      docs: Link out to the changelog at the relevant tag</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/b661a9de04aebd1adaaafdbf7e470f07a8d8a36d"><code>b661a9d</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5229">#5229</a>
      from epage/derive</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/a08587b00e347492165ded1415bad6ab339e9f0b"><code>a08587b</code></a>
      docs(derive): Link to tutorial sections for attributes</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/21b671f689bc0b8d790dc8c42902c22822bf6f82"><code>21b671f</code></a>
      chore: Release</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/93ba76dbaaf9136313a4fe2978693cc39fa467dd"><code>93ba76d</code></a>
      docs: Update changelog</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/c1c55b30d853446e2cab78664c0d22c1b77d4dfd"><code>c1c55b3</code></a>
      Merge pull request <a
      href="https://redirect.github.com/clap-rs/clap/issues/5228">#5228</a>
      from epage/flat</li>
      <li><a
      href="https://github.com/clap-rs/clap/commit/b13f6d98622b80ba30e63c2c6e65d218cc8a4de3"><code>b13f6d9</code></a>
      fix(help): Hide 'help' if only flattened subcommand</li>
      <li>Additional commits viewable in <a
      href="https://github.com/clap-rs/clap/compare/v4.4.6...v4.4.10">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      Dependabot will resolve any conflicts with this PR as long as you don't
      alter it yourself. You can also trigger a rebase manually by commenting
      `@dependabot rebase`.
      
      [//]: # (dependabot-automerge-start)
      [//]: # (dependabot-automerge-end)
      
      ---
      
      <details>
      <summary>Dependabot commands and options</summary>
      <br />
      
      You can trigger Dependabot actions by commenting on this PR:
      - `@dependabot rebase` will rebase this PR
      - `@dependabot recreate` will recreate this PR, overwriting any edits
      that have been made to it
      - `@dependabot merge` will merge this PR after your CI passes on it
      - `@dependabot squash and merge` will squash and merge this PR after
      your CI passes on it
      - `@dependabot cancel merge` will cancel a previously requested merge
      and block automerging
      - `@dependabot reopen` will reopen this PR if it is closed
      - `@dependabot close` will close this PR and stop Dependabot recreating
      it. You can achieve the same result by closing it manually
      - `@dependabot show <dependency name> ignore conditions` will show all
      of the ignore conditions of the specified dependency
      - `@dependabot ignore <dependency name> major version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's major version (unless you unignore this specific
      dependency's major version or upgrade to it yourself)
      - `@dependabot ignore <dependency name> minor version` will close this
      group update PR and stop Dependabot creating any more for the specific
      dependency's minor version (unless you unignore this specific
      dependency's minor version or upgrade to it yourself)
      - `@dependabot ignore <dependency name>` will close this group update PR
      and stop Dependabot creating any more for the specific dependency
      (unless you unignore this specific dependency or upgrade to it yourself)
      - `@dependabot unignore <dependency name>` will remove all of the ignore
      conditions of the specified dependency
      - `@dependabot unignore <dependency name> <ignore condition>` will
      remove the ignore condition of the specified dependency and ignore
      conditions
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      6742aba0
  20. Nov 28, 2023
  21. Nov 01, 2023
    • Ankan's avatar
      [NPoS] Paging reward payouts in order to scale rewardable nominators (#1189) · 00b85c51
      Ankan authored
      
      
      helps https://github.com/paritytech/polkadot-sdk/issues/439.
      closes https://github.com/paritytech/polkadot-sdk/issues/473.
      
      PR link in the older substrate repository:
      https://github.com/paritytech/substrate/pull/13498.
      
      # Context
      Rewards payout is processed today in a single block and limited to
      `MaxNominatorRewardedPerValidator`. This number is currently 512 on both
      Kusama and Polkadot.
      
      This PR tries to scale the nominators payout to an unlimited count in a
      multi-block fashion. Exposures are stored in pages, with each page
      capped to a certain number (`MaxExposurePageSize`). Starting out, this
      number would be the same as `MaxNominatorRewardedPerValidator`, but
      eventually, this number can be lowered through new runtime upgrades to
      limit the rewardeable nominators per dispatched call instruction.
      
      The changes in the PR are backward compatible.
      
      ## How payouts would work like after this change
      Staking exposes two calls, 1) the existing `payout_stakers` and 2)
      `payout_stakers_by_page`.
      
      ### payout_stakers
      This remains backward compatible with no signature change. If for a
      given era a validator has multiple pages, they can call `payout_stakers`
      multiple times. The pages are executed in an ascending sequence and the
      runtime takes care of preventing double claims.
      
      ### payout_stakers_by_page
      Very similar to `payout_stakers` but also accepts an extra param
      `page_index`. An account can choose to payout rewards only for an
      explicitly passed `page_index`.
      
      **Lets look at an example scenario**
      Given an active validator on Kusama had 1100 nominators,
      `MaxExposurePageSize` set to 512 for Era e. In order to pay out rewards
      to all nominators, the caller would need to call `payout_stakers` 3
      times.
      
      - `payout_stakers(origin, stash, e)` => will pay the first 512
      nominators.
      - `payout_stakers(origin, stash, e)` => will pay the second set of 512
      nominators.
      - `payout_stakers(origin, stash, e)` => will pay the last set of 76
      nominators.
      ...
      - `payout_stakers(origin, stash, e)` => calling it the 4th time would
      return an error `InvalidPage`.
      
      The above calls can also be replaced by `payout_stakers_by_page` and
      passing a `page_index` explicitly.
      
      ## Commission note
      Validator commission is paid out in chunks across all the pages where
      each commission chunk is proportional to the total stake of the current
      page. This implies higher the total stake of a page, higher will be the
      commission. If all the pages of a validator's single era are paid out,
      the sum of commission paid to the validator across all pages should be
      equal to what the commission would have been if we had a non-paged
      exposure.
      
      ### Migration Note
      Strictly speaking, we did not need to bump our storage version since
      there is no migration of storage in this PR. But it is still useful to
      mark a storage upgrade for the following reasons:
      
      - New storage items are introduced in this PR while some older storage
      items are deprecated.
      - For the next `HistoryDepth` eras, the exposure would be incrementally
      migrated to its corresponding paged storage item.
      - Runtimes using staking pallet would strictly need to wait at least
      `HistoryDepth` eras with current upgraded version (14) for the migration
      to complete. At some era `E` such that `E >
      era_at_which_V14_gets_into_effect + HistoryDepth`, we will upgrade to
      version X which will remove the deprecated storage items.
      In other words, it is a strict requirement that E<sub>x</sub> -
      E<sub>14</sub> > `HistoryDepth`, where
      E<sub>x</sub> = Era at which deprecated storages are removed from
      runtime,
      E<sub>14</sub> = Era at which runtime is upgraded to version 14.
      - For Polkadot and Kusama, there is a [tracker
      ticket](https://github.com/paritytech/polkadot-sdk/issues/433) to clean
      up the deprecated storage items.
      
      ### Storage Changes
      
      #### Added
      - ErasStakersOverview
      - ClaimedRewards
      - ErasStakersPaged
      
      #### Deprecated
      The following can be cleaned up after 84 eras which is tracked
      [here](https://github.com/paritytech/polkadot-sdk/issues/433).
      
      - ErasStakers.
      - ErasStakersClipped.
      - StakingLedger.claimed_rewards, renamed to
      StakingLedger.legacy_claimed_rewards.
      
      ### Config Changes
      - Renamed MaxNominatorRewardedPerValidator to MaxExposurePageSize.
      
      ### TODO
      - [x] Tracker ticket for cleaning up the old code after 84 eras.
      - [x] Add companion.
      - [x] Redo benchmarks before merge.
      - [x] Add Changelog for pallet_staking.
      - [x] Pallet should be configurable to enable/disable paged rewards.
      - [x] Commission payouts are distributed across pages.
      - [x] Review documentation thoroughly.
      - [x] Rename `MaxNominatorRewardedPerValidator` ->
      `MaxExposurePageSize`.
      - [x] NMap for `ErasStakersPaged`.
      - [x] Deprecate ErasStakers.
      - [x] Integrity tests.
      
      ### Followup issues
      [Runtime api for deprecated ErasStakers storage
      item](https://github.com/paritytech/polkadot-sdk/issues/426)
      
      ---------
      
      Co-authored-by: default avatarJavier Viola <[email protected]>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: command-bot <>
      00b85c51
  22. Oct 24, 2023
    • Kian Paimani's avatar
      Ensure correct variant count in `Runtime[Hold/Freeze]Reason` (#1900) · 35eb133b
      Kian Paimani authored
      
      
      closes https://github.com/paritytech/polkadot-sdk/issues/1882
      
      ## Breaking Changes
      
      This PR introduces a new item to `pallet_balances::Config`:
      
      ```diff
      trait Config {
      ++    type RuntimeFreezeReasons;
      }
      ```
      
      This value is only used to check it against `type MaxFreeze`. A similar
      check has been added for `MaxHolds` against `RuntimeHoldReasons`, which
      is already given to `pallet_balances`.
      
      In all contexts, you should pass the real `RuntimeFreezeReasons`
      generated by `construct_runtime` to `type RuntimeFreezeReasons`. Passing
      `()` would also work, but it would imply that the runtime uses no
      freezes at all.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      35eb133b
  23. Oct 20, 2023
    • Bastian Köcher's avatar
      `xcm`: Change `TypeInfo::path` to not include `staging` (#1948) · f3bf5c1a
      Bastian Köcher authored
      
      
      The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
      crates.io as someone as squatted `xcm`. The problem with this rename is
      that the `TypeInfo` includes the crate name which ultimately lands in
      the metadata. The metadata is consumed by downstream users like
      `polkadot-js` or people building on top of `polkadot-js`. These people
      are using the entire `path` to find the type in the type registry. Thus,
      their code would break as the type path would now be [`staging_xcm`,
      `VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
      fixes this by renaming the path segment `staging_xcm` to `xcm`.
      
      This requires: https://github.com/paritytech/scale-info/pull/197
      
      ---------
      
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      f3bf5c1a
  24. Sep 04, 2023
    • Chevdor's avatar
      Markdown linter (#1309) · a30092ab
      Chevdor authored
      
      
      * Add markdown linting
      
      - add linter default rules
      - adapt rules to current code
      - fix the code for linting to pass
      - add CI check
      
      fix #1243
      
      * Fix markdown for Substrate
      * Fix tooling install
      * Fix workflow
      * Add documentation
      * Remove trailing spaces
      * Update .github/.markdownlint.yaml
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      * Fix mangled markdown/lists
      * Fix captalization issues on known words
      a30092ab
  25. Aug 31, 2023
  26. Aug 30, 2023
    • dependabot[bot]'s avatar
      Bump the known_good_semver group with 2 updates (#1284) · c5060a5d
      dependabot[bot] authored
      
      
      Bumps the known_good_semver group with 2 updates: [serde](https://github.com/serde-rs/serde) and [clap](https://github.com/clap-rs/clap).
      
      
      Updates `serde` from 1.0.186 to 1.0.188
      - [Release notes](https://github.com/serde-rs/serde/releases)
      - [Commits](https://github.com/serde-rs/serde/compare/v1.0.186...v1.0.188)
      
      Updates `clap` from 4.4.0 to 4.4.1
      - [Release notes](https://github.com/clap-rs/clap/releases)
      - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
      - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.4.0...v4.4.1)
      
      ---
      updated-dependencies:
      - dependency-name: serde
        dependency-type: direct:production
        update-type: version-update:semver-patch
        dependency-group: known_good_semver
      - dependency-name: clap
        dependency-type: direct:production
        update-type: version-update:semver-patch
        dependency-group: known_good_semver
      ...
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      c5060a5d
  27. Aug 29, 2023
  28. Aug 25, 2023
  29. Aug 23, 2023
  30. Aug 10, 2023
    • Gonçalo Pestana's avatar
      [NPoS] Implements dynamic number of nominators (#12970) · 93754780
      Gonçalo Pestana authored
      
      
      * Implements dynamic nominations per nominator
      
      * Adds SnapshotBounds and ElectionSizeTracker
      
      * Changes the ElectionDataProvider interface to receive ElectionBounds as input
      
      * Implements get_npos_voters with ElectionBounds
      
      * Implements get_npos_targets with ElectionBounds
      
      * Adds comments
      
      * tests
      
      * Truncates nomninations that exceed nominations quota; Old tests passing
      
      * Uses DataProviderBounds and ElectionBounds (to continue)
      
      * Finishes conversions - tests passing
      
      * Refactor staking in babe mocks
      
      * Replaces MaxElectableTargets and MaxElectingVoters with ElectionBounds; Adds more tests
      
      * Fixes nits; node compiling
      
      * bechmarks
      
      * removes nomination_quota extrinsic to request the nomination quota
      
      * Lazy quota check, ie. at nominate time only
      
      * remove non-working test (for now)
      
      * tests lazy nominations quota when quota is lower than current number of nominated targets
      
      * Adds runtime API and custom RPC call for clients to query the nominations quota for a given balance
      
      * removes old rpc
      
      * Cosmetic touches
      
      * All mocks working
      
      * Fixes benchmarking mocks
      
      * nits
      
      * more tests
      
      * renames trait methods
      
      * nit
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Fix V2 PoV benchmarking (#13485)
      
      * Bump default 'additional_trie_layers' to two
      
      The default here only works for extremely small runtimes, which have
      no more than 16 storage prefices. This is changed to a "sane" default
      of 2, which is save for runtimes with up to 4096 storage prefices (eg StorageValue).
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update tests and test weights
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Fix PoV weights
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_message_queue
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton
      
      * Fix sanity check
      
      >0 would also do as a check, but let's try this.
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: command-bot <>
      
      * Move BEEFY code to consensus (#13484)
      
      * Move beefy primitives to consensus dir
      * Move beefy gadget to client consensus folder
      * Rename beefy crates
      
      * chore: move genesis block builder to chain-spec crate. (#13427)
      
      * chore: move genesis block builder to block builder crate.
      
      * add missing file
      
      * chore: move genesis block builder to sc-chain-spec
      
      * Update client/chain-spec/src/genesis.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update test-utils/runtime/src/genesismap.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update test-utils/runtime/client/src/lib.rs
      
      * fix warnings
      
      * fix warnings
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Speed up storage iteration from within the runtime (#13479)
      
      * Speed up storage iteration from within the runtime
      
      * Move the cached iterator into an `Option`
      
      * Use `RefCell` in no_std
      
      * Simplify the code slightly
      
      * Use `Option::replace`
      
      * Update doc comment for `next_storage_key_slow`
      
      * Make unbounded channels size warning exact (part 1) (#13490)
      
      * Replace `futures-channel` with `async-channel` in `out_events`
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Also print the backtrace of `send()` call
      
      * Switch from `backtrace` crate to `std::backtrace`
      
      * Remove outdated `backtrace` dependency
      
      * Remove `backtrace` from `Cargo.lock`
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Removal of Prometheus alerting rules deployment in cloud-infra (#13499)
      
      * sp-consensus: remove unused error variants (#13495)
      
      * Expose `ChargedAmount` (#13488)
      
      * Expose `ChargedAmount`
      
      * Fix imports
      
      * sc-consensus-beefy: fix metrics: use correct names (#13494)
      
      
      Signed-off-by: default avataracatangiu <[email protected]>
      
      * clippy fix
      
      * removes NominationsQuotaExceeded event
      
      * Update frame/staking/src/lib.rs
      
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      
      * adds back the npos_max_iter
      
      * remove duplicate imports added after merge
      
      * fmt
      
      * Adds comment in public struct; Refactors CountBound and SizeCount to struct
      
      * addresses various pr comments
      
      * PR comment reviews
      
      * Fixes on-chain election bounds and related code
      
      * EPM checks the size of the voter list returned by the data provider
      
      * cosmetic changes
      
      * updates e2e tests mock
      
      * Adds more tests for size tracker and refactors code
      
      * Adds back only_iterates_max_2_times_max_allowed_len test
      
      * Refactor
      
      * removes unecessary dependency
      
      * empty commit -- restart all stuck CI jobs
      
      * restarts ci jobs
      
      * Renames ElectionBounds -> Bounds in benchmarking mocks et al
      
      * updates mocks
      
      * Update frame/election-provider-support/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/staking/src/pallet/impls.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/election-provider-support/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/staking/src/tests.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * more checks in api_nominations_quota in tests
      
      * Improves docs
      
      * fixes e2e tests
      
      * Uses size_hint rather than mem::size_of in size tracker; Refactor size tracker to own module
      
      * nits from reviews
      
      * Refactors bounds to own module; improves docs
      
      * More tests and docs
      
      * fixes docs
      
      * Fixes benchmarks
      
      * Fixes rust docs
      
      * fixes bags-list remote-ext-tests
      
      * Simplify bound checks in create_snapshot_external
      
      * Adds target size check in get_npos_targets
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * restart ci
      
      * rust doc fixes and cosmetic nits
      
      * rollback upgrade on parity-scale-codec version (unecessary)
      
      * reset cargo lock, no need to update it
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Signed-off-by: default avataracatangiu <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avataryjh <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarAnthony Lazam <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: default avatarPiotr Mikołajczyk <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      93754780
  31. Aug 01, 2023
  32. Jul 14, 2023
    • juangirini's avatar
      Replace system config `Index` for `Nonce` (#14290) · 6a29a70a
      juangirini authored
      * replace Index by Nonce
      
      * replace Index by Nonce
      
      * replace Index by Nonce
      
      * replace Index by Nonce
      
      * replace Index by Nonce
      
      * wip
      
      * remove index in lieu of nonce
      
      * wip
      
      * remove accountnonce in lieu of nonce
      
      * add minor improvement
      
      * rebase and merge conflicts
      6a29a70a
  33. Jul 13, 2023
    • gupnik's avatar
      Moves `Block` to `frame_system` instead of `construct_runtime` and removes... · 5e7b27e9
      gupnik authored
      
      Moves `Block` to `frame_system` instead of `construct_runtime` and removes `Header` and `BlockNumber` (#14437)
      
      * Initial setup
      
      * Adds node block
      
      * Uses UncheckedExtrinsic and removes Where section
      
      * Updates frame_system to use Block
      
      * Adds deprecation warning
      
      * Fixes pallet-timestamp
      
      * Removes Header and BlockNumber
      
      * Addresses review comments
      
      * Addresses review comments
      
      * Adds comment about compiler bug
      
      * Removes where clause
      
      * Refactors code
      
      * Fixes errors in cargo check
      
      * Fixes errors in cargo check
      
      * Fixes warnings in cargo check
      
      * Formatting
      
      * Fixes construct_runtime tests
      
      * Uses import instead of full path for BlockNumber
      
      * Uses import instead of full path for Header
      
      * Formatting
      
      * Fixes construct_runtime tests
      
      * Fixes imports in benchmarks
      
      * Formatting
      
      * Fixes construct_runtime tests
      
      * Formatting
      
      * Minor updates
      
      * Fixes construct_runtime ui tests
      
      * Fixes construct_runtime ui tests with 1.70
      
      * Fixes docs
      
      * Fixes docs
      
      * Adds u128 mock block type
      
      * Fixes split example
      
      * fixes for cumulus
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Updates new tests
      
      * Fixes fully-qualified path in few places
      
      * Formatting
      
      * Update frame/examples/default-config/src/lib.rs
      
      Co-authored-by: default avatarJuan <[email protected]>
      
      * Update frame/support/procedural/src/construct_runtime/mod.rs
      
      Co-authored-by: default avatarJuan <[email protected]>
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Addresses some review comments
      
      * Fixes build
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Update frame/democracy/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/democracy/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/support/procedural/src/construct_runtime/mod.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/support/procedural/src/construct_runtime/mod.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Addresses review comments
      
      * Updates trait bounds
      
      * Minor fix
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Removes unnecessary bound
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Updates test
      
      * Fixes build
      
      * Adds a bound for header
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * Removes where block
      
      * Minor fix
      
      * Minor fix
      
      * Fixes tests
      
      * ".git/.scripts/commands/update-ui/update-ui.sh" 1.70
      
      * Updates test
      
      * Update primitives/runtime/src/traits.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update primitives/runtime/src/traits.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Updates doc
      
      * Updates doc
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarJuan <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      5e7b27e9
  34. Jul 12, 2023
    • Michal Kucharczyk's avatar
      `GenesisBuild<T,I>` deprecated. `BuildGenesisConfig` added. (#14306) · 87d41d0a
      Michal Kucharczyk authored
      
      
      * frame::support: GenesisConfig types for Runtime enabled
      
      * frame::support: macro generating GenesisBuild::build for RuntimeGenesisConfig
      
      * frame: ambiguity BuildStorage vs GenesisBuild fixed
      
      * fix
      
      * RuntimeGenesisBuild added
      
      * Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed"
      
      This reverts commit 950f3d019d0e21c55a739c44cc19cdabd3ff0293.
      
      * Revert "fix"
      
      This reverts commit a2f76dd24e9a16cf9230d45825ed28787211118b.
      
      * Revert "RuntimeGenesisBuild added"
      
      This reverts commit 3c131b618138ced29c01ab8d15d8c6410c9e128b.
      
      * Revert "Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed""
      
      This reverts commit 2b1ecd467231eddec69f8d328039ba48a380da3d.
      
      * Revert "Revert "fix""
      
      This reverts commit fd7fa629adf579d83e30e6ae9fd162637fc45e30.
      
      * Code review suggestions
      
      * frame: BuildGenesisConfig added, BuildGenesis deprecated
      
      * frame: some pallets updated with BuildGenesisConfig
      
      * constuct_runtime: support for BuildGenesisConfig
      
      * frame::support: genesis_build macro supports BuildGenesisConfig
      
      * frame: BuildGenesisConfig added, BuildGenesis deprecated
      
      * Cargo.lock update
      
      * test-runtime: fixes
      
      * Revert "fix"
      
      This reverts commit a2f76dd24e9a16cf9230d45825ed28787211118b.
      
      * Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed"
      
      This reverts commit 950f3d019d0e21c55a739c44cc19cdabd3ff0293.
      
      * self review
      
      * doc fixed
      
      * ui tests fixed
      
      * fmt
      
      * tests fixed
      
      * genesis_build macrto fixed for non-generic GenesisConfig
      
      * BuildGenesisConfig constraints added
      
      * warning fixed
      
      * some duplication removed
      
      * fmt
      
      * fix
      
      * doc tests fix
      
      * doc fix
      
      * cleanup: remove BuildModuleGenesisStorage
      
      * self review comments
      
      * fix
      
      * Update frame/treasury/src/tests.rs
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      
      * Update frame/support/src/traits/hooks.rs
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      
      * doc fix: GenesisBuild exposed
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * frame: more serde(skip) + cleanup
      
      * Update frame/support/src/traits/hooks.rs
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * frame: phantom fields moved to the end of structs
      
      * chain-spec: Default::default cleanup
      
      * test-runtime: phantom at the end
      
      * merge master fixes
      
      * fix
      
      * fix
      
      * fix
      
      * fix
      
      * fix (facepalm)
      
      * Update frame/support/procedural/src/pallet/expand/genesis_build.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * fmt
      
      * fix
      
      * fix
      
      ---------
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      87d41d0a
  35. Jul 09, 2023
  36. Jun 21, 2023
  37. Jun 15, 2023
    • Anton's avatar
      [frame/im-online] remove network state from heartbeats (#14251) · 6cd2c8b3
      Anton authored
      * [frame/im-online] remove `external_addresses` from heartbeats
      
      Users should use DHT for discovering new nodes. The reason for adding external addresses was
      unstable work of authority discovery (see https://github.com/paritytech/substrate/issues/2719),
      which is now stable. Hence we can safely remove `external_addresses`.
      
      Refs https://github.com/paritytech/polkadot/issues/7181
      
      * remove unused import
      
      * run benchmark
      
      * remove external_addresses from offchain NetworkState
      
      * add missing fn to TestNetwork
      
      * Revert "run benchmark"
      
      This reverts commit a282042c2d6bf8bae2c383f6e2699c3fe2970a3d.
      
      * update weights
      
      * address @bkchr comments
      
      * remove duplicate fn
      
      * cleanup benchmarking.rs
      
      * fix executor tests
      
      * remove peer_id from hearbeat as well
      
      https://github.com/paritytech/substrate/pull/14251#discussion_r1210887220
      
      * remove MaxPeerDataEncodingSize
      
      * change storage value type to `()`
      
      https://github.com/paritytech/substrate/pull/14251#discussion_r1214268931
      
      * scaffold storage migration
      
      * no need to check the type actually
      
      * remove unnecessary types from v0 mod
      
      * add a test for migration
      
      * expose Config types
      
      + pre_upgrade and post_upgrade working fn
      
      * fix test
      
      * replace dummy type with ConstU32
      
      * add some comments to migration test
      
      * fix comment
      
      * respond to @bkchr comments
      
      * use BoundedOpaqueNetworkState::default
      
      intead of using default for each field
      6cd2c8b3
  38. May 31, 2023