1. Nov 08, 2023
  2. Nov 07, 2023
    • Sebastian Kunert's avatar
      Disable incoming light-client connections for minimal relay node (#2202) · 8ebb5c33
      Sebastian Kunert authored
      When running with `--relay-chain-rpc-url` we received multiple reports
      of high traffic that disappears when `--in-peers-light 0` is set. Indeed
      it does not make much sense for light clients to connect to the minimal
      node since it is not running the block announce protocol and the
      request/response protocol for light clients.
      
      This is intended to alleviate the traffic issues for now.
      
      closes #1896
      probably related https://github.com/paritytech/cumulus/issues/2563
      8ebb5c33
    • Bill Laboon's avatar
      Fix "slashaed" typo (#2205) · 44c7a5eb
      Bill Laboon authored
      # Description
      
      This merely fixes a typo in the documentation, replacing the typo
      "slashaed" with "slashed". Since external entities use the comments for
      explanations of events, this will then be shown externally. I noticed
      this when reviewing [this
      event](https://polkadot.subscan.io/extrinsic/0xb6bc1e3abde0c2ed9c500c74cfc64cdb8179e5d9af97f4bf53242ce4cdd15a1d?event=18064194-6)
      on Subscan.
      
      This is not related to any other issues or PRs.
      44c7a5eb
    • vuittont60's avatar
      docs: fix typos (#2193) · 4caa3d8d
      vuittont60 authored
      4caa3d8d
    • Xiliang Chen's avatar
      mark pallet-asset-rate optional in polkadot-runtime-common (#2187) · 295a8483
      Xiliang Chen authored
      Part of #2186
      
      The only usage of pallet-asset-rate is guarded by `runtime-benchmarks`
      feature. I don't want ORML to be forced to include this pallet in deps
      for no good reason.
      295a8483
    • Alexandru Gheorghe's avatar
      zombienet_tests: Fix genesis error in 0006-parachains-max-tranche0.toml (#2191) · f5e9827f
      Alexandru Gheorghe authored
      There was a race in merging between
      https://github.com/paritytech/polkadot-sdk/pull/1256 and
      https://github.com/paritytech/polkadot-sdk/pull/1178
      
      , so this newly
      added tests wasn't updated with the new path for the configuration, so
      fix that.
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      f5e9827f
    • Liam Aharon's avatar
      Initialise on-chain `StorageVersion` for pallets added after genesis (#1297) · c4211b65
      Liam Aharon authored
      Original PR https://github.com/paritytech/substrate/pull/14641
      
      ---
      
      Closes https://github.com/paritytech/polkadot-sdk/issues/109
      
      
      
      ### Problem
      Quoting from the above issue:
      
      > When adding a pallet to chain after genesis we currently don't set the
      StorageVersion. So, when calling on_chain_storage_version it returns 0
      while the pallet is maybe already at storage version 9 when it was added
      to the chain. This could lead to issues when running migrations.
      
      ### Solution
      
      - Create a new trait `BeforeAllRuntimeMigrations` with a single method
      `fn before_all_runtime_migrations() -> Weight` trait with a noop default
      implementation
      - Modify `Executive` to call
      `BeforeAllRuntimeMigrations::before_all_runtime_migrations` for all
      pallets before running any other hooks
      - Implement `BeforeAllRuntimeMigrations` in the pallet proc macro to
      initialize the on-chain version to the current pallet version if the
      pallet has no storage set (indicating it has been recently added to the
      runtime and needs to have its version initialised).
      
      ### Other changes in this PR
      
      - Abstracted repeated boilerplate to access the `pallet_name` in the
      pallet expand proc macro.
      
      ### FAQ
      
      #### Why create a new hook instead of adding this logic to the pallet
      `pre_upgrade`?
      
      `Executive` currently runs `COnRuntimeUpgrade` (custom migrations)
      before `AllPalletsWithSystem` migrations. We need versions to be
      initialized before the `COnRuntimeUpgrade` migrations are run, because
      `COnRuntimeUpgrade` migrations may use the on-chain version for critical
      logic. e.g. `VersionedRuntimeUpgrade` uses it to decide whether or not
      to execute.
      
      We cannot reorder `COnRuntimeUpgrade` and `AllPalletsWithSystem` so
      `AllPalletsWithSystem` runs first, because `AllPalletsWithSystem` have
      some logic in their `post_upgrade` hooks to verify that the on-chain
      version and current pallet version match. A common use case of
      `COnRuntimeUpgrade` migrations is to perform a migration which will
      result in the versions matching, so if they were reordered these
      `post_upgrade` checks would fail.
      
      #### Why init the on-chain version for pallets without a current storage
      version?
      
      We must init the on-chain version for pallets even if they don't have a
      defined storage version so if there is a future version bump, the
      on-chain version is not automatically set to that new version without a
      proper migration.
      
      e.g. bad scenario:
      
      1. A pallet with no 'current version' is added to the runtime
      2. Later, the pallet is upgraded with the 'current version' getting set
      to 1 and a migration is added to Executive Migrations to migrate the
      storage from 0 to 1
          a. Runtime upgrade occurs
          b. `before_all` hook initializes the on-chain version to 1
      c. `on_runtime_upgrade` of the migration executes, and sees the on-chain
      version is already 1 therefore think storage is already migrated and
      does not execute the storage migration
      Now, on-chain version is 1 but storage is still at version 0.
      
      By always initializing the on-chain version when the pallet is added to
      the runtime we avoid that scenario.
      
      ---------
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      c4211b65
  3. Nov 06, 2023
  4. Nov 05, 2023
  5. Nov 04, 2023
  6. Nov 03, 2023
    • georgepisaltu's avatar
      Identity pallet improvements (#2048) · 21fbc00d
      georgepisaltu authored
      This PR is a follow up to #1661 
      
      - [x] rename the `simple` module to `legacy`
      - [x] fix benchmarks to disregard the number of additional fields
      - [x] change the storage deposits to charge per encoded byte of the
      identity information instance, removing the need for `fn
      additional(&self) -> usize` in `IdentityInformationProvider`
      - [x] ~add an extrinsic to rejig deposits to account for the change
      above~
      - [ ] ~ensure through proper configuration that the new byte-based
      deposit is always lower than whatever is reserved now~
      - [x] remove `IdentityFields` from the `set_fields` extrinsic signature,
      as per [this
      discussion](https://github.com/paritytech/polkadot-sdk/pull/1661#discussion_r1371703403)
      
      > ensure through proper configuration that the new byte-based deposit is
      always lower than whatever is reserved now
      
      Not sure this is needed anymore. If the new deposits are higher than
      what is currently on chain and users don't have enough funds to reserve
      what is needed, the extrinisc fails and they're basically grandfathered
      and frozen until they add more funds and/or make a change to their
      identity. This behavior seems fine to me. Original idea
      [here](https://github.com/paritytech/polkadot-sdk/pull/1661#issuecomment-1779606319).
      
      > add an extrinsic to rejig deposits to account for the change above
      
      This was initially implemented but now removed from this PR in favor of
      the implementation detailed
      [here](https://github.com/paritytech/polkadot-sdk/pull/2088
      
      ).
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: default avatarjoepetrowski <[email protected]>
      21fbc00d
    • Bastian Köcher's avatar
      `sc-block-builder`: Remove `BlockBuilderProvider` (#2099) · ca5f1056
      Bastian Köcher authored
      The `BlockBuilderProvider` was a trait that was defined in
      `sc-block-builder`. The trait was implemented for `Client`. This
      basically meant that you needed to import `sc-block-builder` any way to
      have access to the block builder. So, this trait was not providing any
      real value. This pull request is removing the said trait. Instead of the
      trait it introduces a builder for creating a `BlockBuilder`. The builder
      currently has the quite fabulous name `BlockBuilderBuilder` (I'm open to
      any better name 😅
      
      ). The rest of the pull request is about
      replacing the old trait with the new builder.
      
      # Downstream code changes
      
      If you used `new_block` or `new_block_at` before you now need to switch
      it over to the new `BlockBuilderBuilder` pattern:
      
      ```rust
      // `new` requires a type that implements `CallApiAt`. 
      let mut block_builder = BlockBuilderBuilder::new(client)
                      // Then you need to specify the hash of the parent block the block will be build on top of
      		.on_parent_block(at)
                      // The block builder also needs the block number of the parent block. 
                      // Here it is fetched from the given `client` using the `HeaderBackend`
                      // However, there also exists `with_parent_block_number` for directly passing the number
      		.fetch_parent_block_number(client)
      		.unwrap()
                      // Enable proof recording if required. This call is optional.
      		.enable_proof_recording()
                      // Pass the digests. This call is optional.
                      .with_inherent_digests(digests)
      		.build()
      		.expect("Creates new block builder");
      ```
      
      ---------
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: command-bot <>
      ca5f1056
    • s0me0ne-unkn0wn's avatar
      cd2d5d25