Skip to content
  1. Nov 26, 2024
    • Branislav Kontur's avatar
      xcm: fix local/remote exports when inner routers return `NotApplicable` (#6645) · 1c0b6100
      Branislav Kontur authored
      
      
      This PR addresses two small fixes:  
      
      1. Fixed a typo ("as as") found on the way.  
      2. Resolved a bug in the `local/remote exporters` used for bridging.
      Previously, they consumed `dest` and `msg` without returning them when
      inner routers/exporters failed with `NotApplicable`. This PR ensures
      compliance with the
      [`SendXcm`](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/src/v5/traits.rs#L449-L450)
      and
      [`ExportXcm`](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-executor/src/traits/export.rs#L44-L45)
      traits.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <[email protected]>
      1c0b6100
  2. Nov 25, 2024
  3. Nov 22, 2024
  4. Nov 19, 2024
  5. Nov 18, 2024
    • Tsvetomir Dimitrov's avatar
      Remove `ProspectiveParachainsMode` usage in backing subsystem (#6215) · 7d5d7202
      Tsvetomir Dimitrov authored
      
      
      Since async backing parameters runtime api is released on all networks
      the code in backing subsystem can be simplified by removing the usages
      of `ProspectiveParachainsMode` and keeping only the branches of the code
      under `ProspectiveParachainsMode::Enabled`.
      
      The PR does that and reworks the tests in mod.rs to use async backing.
      It's a preparation for
      https://github.com/paritytech/polkadot-sdk/issues/5079
      
      ---------
      
      Co-authored-by: default avatarAlin Dima <[email protected]>
      Co-authored-by: command-bot <>
      7d5d7202
  6. Nov 14, 2024
    • georgepisaltu's avatar
      Follow up work on `TransactionExtension` - fix weights and clean up `UncheckedExtrinsic` (#6418) · ae4b68b3
      georgepisaltu authored
      
      
      Follow up to https://github.com/paritytech/polkadot-sdk/pull/3685
      Partially fixes https://github.com/paritytech/polkadot-sdk/issues/6403
      
      The main PR introduced bare support for the new extension version byte
      as well as extension weights and benchmarking.
      
      This PR:
      - Removes the redundant extension version byte from the signed v4
      extrinsic, previously unused and defaulted to 0.
      - Adds the extension version byte to the inherited implication passed to
      `General` transactions.
      - Whitelists the `pallet_authorship::Author`, `frame_system::Digest` and
      `pallet_transaction_payment::NextFeeMultiplier` storage items as they
      are read multiple times by extensions for each transaction, but are hot
      in memory and currently overestimate the weight.
      - Whitelists the benchmark caller for `CheckEra` and `CheckGenesis` as
      the reads are performed for every transaction and overestimate the
      weight.
      - Updates the umbrella frame weight template to work with the system
      extension changes.
      - Plans on re-running the benchmarks at least for the `frame_system`
      extensions.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatargui <[email protected]>
      ae4b68b3
  7. Nov 13, 2024
    • Stephane Gurgenidze's avatar
      backing: improve session buffering for runtime information (#6284) · e617d1d0
      Stephane Gurgenidze authored
      ## Issue
      [[#3421] backing: improve session buffering for runtime
      information](https://github.com/paritytech/polkadot-sdk/issues/3421)
      
      ## Description
      In the current implementation of the backing module, certain pieces of
      information, which remain unchanged throughout a session, are fetched
      multiple times via runtime API calls. The goal of this task was to
      introduce a local cache to store such session-stable information and
      perform the runtime API call only once per session.
      
      This PR implements caching specifically for the validators list, node
      features, executor parameters, minimum backing votes threshold, and
      validator-to-group mapping, which were previously fetched from the
      runtime or computed each time `PerRelayParentState` was built. Now, this
      information is cached and reused within the session.
      
      ## TODO
      * [X] Create a separate struct for per-session caches;
      * [X] Cache validators list;
      * [X] Cache node features;
      * [X] Cache executor parameters;
      * [X] Cache minimum backing votes threshold;
      * [X] Cache validator-to-group mapping;
      * [X] Update tests to reflect these changes;
      * [X] Add prdoc.
      
      ## For the next PR
      Cache validator groups and any other session-stable data (if present).
      e617d1d0
    • Michał Gil's avatar
      remove pallet::getter from pallet-staking (#6184) · 95d98e6d
      Michał Gil authored
      
      
      # Description
      
      Part of https://github.com/paritytech/polkadot-sdk/issues/3326
      Removes all pallet::getter occurrences from pallet-staking and replaces
      them with explicit implementations.
      Adds tests to verify that retrieval of affected entities works as
      expected so via storage::getter.
      
      ## Review Notes
      
      1. Traits added to the `derive` attribute are used in tests (either
      directly or indirectly).
      2. The getters had to be placed in a separate impl block since the other
      one is annotated with `#[pallet::call]` and that requires
      `#[pallet::call_index(0)]` annotation on each function in that block. So
      I thought it's better to separate them.
      
      ---------
      
      Co-authored-by: default avatarDónal Murray <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      95d98e6d
    • thiolliere's avatar
      [Tx ext stage 2: 1/4] Add `TransactionSource` as argument in... · 8e3d9296
      thiolliere authored
      [Tx ext stage 2: 1/4] Add `TransactionSource` as argument in `TransactionExtension::validate` (#6323)
      
      ## Meta 
      
      This PR is part of 4 PR:
      * https://github.com/paritytech/polkadot-sdk/pull/6323
      * https://github.com/paritytech/polkadot-sdk/pull/6324
      * https://github.com/paritytech/polkadot-sdk/pull/6325
      * https://github.com/paritytech/polkadot-sdk/pull/6326
      
      ## Description
      
      One goal of transaction extension is to get rid or unsigned
      transactions.
      But unsigned transaction validation has access to the
      `TransactionSource`.
      
      The source is used for unsigned transactions that the node trust and
      don't want to pay upfront.
      Instead of using transaction source we could do: the transaction is
      valid if it is signed by the block author, conceptually it should work,
      but it doesn't look so easy.
      
      This PR add `TransactionSource` to the validate function for transaction
      extensions
      8e3d9296
    • Andrei Eres's avatar
      Remove debug message about pruning active leaves (#6440) · 5aeaa664
      Andrei Eres authored
      
      
      # Description
      
      The debug message was added to identify a potential memory leak.
      However, recent observations show that pruning works as expected.
      Therefore, it is best to remove this line, as it generates quite
      annoying logs.
      
      
      ## Integration
      
      Doesn't affect downstream projects.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <[email protected]>
      5aeaa664
  8. Nov 12, 2024
  9. Nov 11, 2024
    • jpserrat's avatar
      add FeeManager to pallet xcm (#5363) · dd9514f7
      jpserrat authored
      
      
      Closes #2082
      
      change send xcm to use `xcm::executor::FeeManager` to determine if the
      sender should be charged.
      
      I had to change the `FeeManager` of the penpal config to ensure the same
      test behaviour as before. For the other tests, I'm using the
      `FeeManager` from the `xcm::executor::FeeManager` as this one is used to
      check if the fee can be waived on the charge fees method.
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatarGitHub Action <[email protected]>
      dd9514f7
    • Nazar Mokrynskyi's avatar
      Remove network starter that is no longer needed (#6400) · b601d57a
      Nazar Mokrynskyi authored
      
      
      # Description
      
      This seems to be an old artifact of the long closed
      https://github.com/paritytech/substrate/issues/6827 that I noticed when
      working on related code earlier.
      
      ## Integration
      
      `NetworkStarter` was removed, simply remove its usage:
      ```diff
      -let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
      +let (network, system_rpc_tx, tx_handler_controller, sync_service) =
          build_network(BuildNetworkParams {
      ...
      -start_network.start_network();
      ```
      
      ## Review Notes
      
      Changes are trivial, the only reason for this to not be accepted is if
      it is desired to not start network automatically for whatever reason, in
      which case the description of network starter needs to change.
      
      # Checklist
      
      * [x] My PR includes a detailed description as outlined in the
      "Description" and its two subsections above.
      * [ ] My PR follows the [labeling requirements](
      
      https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
      ) of this project (at minimum one label for `T` required)
      * External contributors: ask maintainers to put the right label on your
      PR.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      b601d57a
    • Alin Dima's avatar
      fix prospective-parachains best backable chain reversion bug (#6417) · 05ad5475
      Alin Dima authored
      
      
      Kudos to @EclesioMeloJunior for noticing it 
      
      Also added a regression test for it. The existing unit test was
      exercising only the case where the full chain is reverted
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      05ad5475
  10. Nov 08, 2024
    • Michal Kucharczyk's avatar
      runtimes: presets are provided as config patches (#6349) · 8c8f3390
      Michal Kucharczyk authored
      This PR introduces usage of `build_struct_json_patch` macro in all
      runtimes (also guides) within the code base.
      
      It also fixes macro to support _field init shorthand_, and _Struct
      Update_ syntax which were missing in original implementation.
      
      Follow up of #5700 and #5813
      8c8f3390
  11. Nov 07, 2024
    • Alin Dima's avatar
      make prospective-parachains debug logs less spammy (#6406) · 2680f20a
      Alin Dima authored
      Fixes https://github.com/paritytech/polkadot-sdk/issues/6172
      2680f20a
    • Andrei Eres's avatar
      PVF: drop backing jobs if it is too late (#5616) · 6c8a347a
      Andrei Eres authored
      
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/5530
      
      This PR introduces the removal of backing jobs that have been back
      pressured for longer than `allowedAncestryLen`, as these candidates are
      no longer viable.
      
      It is reasonable to expect a result for a backing job execution within
      `allowedAncestryLen` blocks. Therefore, we set the job TTL as a relay
      block number and synchronize the validation host by sending activated
      leaves.
      
      ---------
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      6c8a347a
    • Nazar Mokrynskyi's avatar
      Syncing strategy refactoring (part 3) (#5737) · 12d90524
      Nazar Mokrynskyi authored
      # Description
      
      This is a continuation of
      https://github.com/paritytech/polkadot-sdk/pull/5666 that finally fixes
      https://github.com/paritytech/polkadot-sdk/issues/5333.
      
      This should allow developers to create custom syncing strategies or even
      the whole syncing engine if they so desire. It also moved syncing engine
      creation and addition of corresponding protocol outside
      `build_network_advanced` method, which is something Bastian expressed as
      desired in
      https://github.com/paritytech/polkadot-sdk/issues/5#issuecomment-1700816458
      
      Here I replaced strategy-specific types and methods in `SyncingStrategy`
      trait with generic ones. Specifically `SyncingAction` is now used by all
      strategies instead of strategy-specific types with conversions.
      `StrategyKey` was an enum with a fixed set of options and now replaced
      with an opaque type that strategies create privately and send to upper
      layers as an opaque type. Requests and responses are now handled in a
      generic way regardless of the strategy, which reduced and simplified
      strategy API.
      
      `PolkadotSyncingStrategy` now lives in its dedicated module (had to edit
      .gitignore for this) like other strategies.
      
      `build_network_advanced` takes generic `SyncingService` as an argument
      alongside with a few other low-level types (that can probably be
      extracted in the future as well) without any notion of specifics of the
      way syncing is actually done. All the protocol and tasks are created
      outside and not a part of the network anymore. It still adds a bunch of
      protocols like for light client and some others that should eventually
      be restructured making `build_network_advanced` just building generic
      network and not application-specific protocols handling.
      
      ## Integration
      
      Just like https://github.com/paritytech/polkadot-sdk/pull/5666
      introduced `build_polkadot_syncing_strategy`, this PR introduces
      `build_default_block_downloader`, but for convenience and to avoid
      typical boilerplate a simpler high-level function
      `build_default_syncing_engine` is added that will take care of creating
      typical block downloader, syncing strategy and syncing engine, which is
      what most users will be using going forward. `build_network` towards the
      end of the PR was renamed to `build_network_advanced` and
      `build_network`'s API was reverted to
      pre-https://github.com/paritytech/polkadot-sdk/pull/5666, so most users
      will not see much of a difference during upgrade unless they opt-in to
      use new API.
      
      ## Review Notes
      
      For `StrategyKey` I was thinking about using something like private type
      and then storing `TypeId` inside instead of a static string in it, let
      me know if that would preferred.
      
      The biggest change happened to requests that different strategies make
      and how their responses are handled. The most annoying thing here is
      that block response decoding, in contrast to all other responses, is
      dependent on request. This meant request had to be sent throughout the
      system. While originally `Response` was `Vec<u8>`, I didn't want to
      re-encode/decode request and response just to fit into that API, so I
      ended up with `Box<dyn Any + Send>`. This allows responses to be truly
      generic and each strategy will know how to downcast it back to the
      concrete type when handling the response.
      
      Import queue refactoring was needed to move `SyncingEngine` construction
      out of `build_network` that awkwardly implemented for `SyncingService`,
      but due to `&mut self` wasn't usable on `Arc<SyncingService>` for no
      good reason. `Arc<SyncingService>` itself is of course useless, but
      refactoring to replace it with just `SyncingService` was unfortunately
      rejected in https://github.com/paritytech/polkadot-sdk/pull/5454
      
      As usual I recommend to review this PR as a series of commits instead of
      as the final diff, it'll make more sense that way.
      
      # Checklist
      
      * [x] My PR includes a detailed description as outlined in the
      "Description" and its two subsections above.
      * [x] My PR follows the [labeling requirements](
      
      https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
      ) of this project (at minimum one label for `T` required)
      * External contributors: ask maintainers to put the right label on your
      PR.
      * [x] I have made corresponding changes to the documentation (if
      applicable)
      12d90524
    • Alin Dima's avatar
      fix shared-core-idle-parachain flaky test (#6387) · ec77843c
      Alin Dima authored
      https://github.com/paritytech/polkadot-sdk/issues/6343
      ec77843c
  12. Nov 06, 2024
  13. Nov 05, 2024
    • Nazar Mokrynskyi's avatar
      Remove `sp_runtime::RuntimeString` and replace with `Cow<'static, str>` or... · c5444f38
      Nazar Mokrynskyi authored
      Remove `sp_runtime::RuntimeString` and replace with `Cow<'static, str>` or `String` depending on use case (#5693)
      
      # Description
      
      As described in https://github.com/paritytech/polkadot-sdk/issues/4001
      `RuntimeVersion` was not encoded consistently using serde. Turned out it
      was a remnant of old times and no longer actually needed. As such I
      removed it completely in this PR and replaced with `Cow<'static, str>`
      for spec/impl names and `String` for error cases.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/4001.
      
      ## Integration
      
      For downstream projects the upgrade will primarily consist of following
      two changes:
      ```diff
      #[sp_version::runtime_version]
      pub const VERSION: RuntimeVersion = RuntimeVersion {
      -	spec_name: create_runtime_str!("statemine"),
      -	impl_name: create_runtime_str!("statemine"),
      +	spec_name: alloc::borrow::Cow::Borrowed("statemine"),
      +	impl_name: alloc::borrow::Cow::Borrowed("statemine"),
      ```
      ```diff
      		fn dispatch_benchmark(
      			config: frame_benchmarking::BenchmarkConfig
      -		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
      +		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {
      ```
      
      SCALE encoding/decoding remains the same as before, but serde encoding
      in runtime has changed from bytes to string (it was like this in `std`
      environment already), which most projects shouldn't have issues with. I
      consider the impact of serde encoding here low due to the type only
      being used in runtime version struct and mostly limited to runtime
      internals, where serde encoding/decoding of this data structure is quite
      unlikely (though we did hit exactly this edge-case ourselves
      😅
      
      ).
      
      ## Review Notes
      
      Most of the changes are trivial and mechanical, the only non-trivial
      change is in
      `substrate/primitives/version/proc-macro/src/decl_runtime_version.rs`
      where macro call expectation in `sp_version::runtime_version`
      implementation was replaced with function call expectation.
      
      # Checklist
      
      * [x] My PR includes a detailed description as outlined in the
      "Description" and its two subsections above.
      * [ ] My PR follows the [labeling requirements](
      
      https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
      ) of this project (at minimum one label for `T` required)
      * External contributors: ask maintainers to put the right label on your
      PR.
      * [ ] I have made corresponding changes to the documentation (if
      applicable)
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      c5444f38
    • Andrei Sandu's avatar
      Fix statement distribution benchmark (#6369) · 52a7325e
      Andrei Sandu authored
      
      
      I've broken this test with
      https://github.com/paritytech/polkadot-sdk/pull/5883 and this is the
      fix.
      
      The benchmark is now updated to use proper core index and session index
      for the generated candidates.
      
      TODO:
      - [ ] <del> PRDoc </del>
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      52a7325e
    • Alin Dima's avatar
      refactor and harden check_core_index (#6217) · 74ec1ee2
      Alin Dima authored
      Resolves https://github.com/paritytech/polkadot-sdk/issues/6179
      74ec1ee2
    • Adrian Catangiu's avatar
      Remove leftover references of Wococo (#6361) · ec61396e
      Adrian Catangiu authored
      Remove references of now defunct Wococo network.
      
      The XCM `NetworkId::Wococo` will also be removed with [XCMv5
      PR](https://github.com/paritytech/polkadot-sdk/pull/4826)
      ec61396e
    • davidk-pt's avatar
      Bounty Pallet: add `approve_bounty_with_curator` call to `bounties` pallet (#5961) · 2ae79be8
      davidk-pt authored
      
      
      Resolves issue https://github.com/paritytech/polkadot-sdk/issues/5928
      
      Adds `approve_bounty_with_curator` call to the `bounties` pallet to
      combine functions of `approve_bounty` and `propose_curator` into one
      call. Also adds a new status `ApprovedWithCurator` required to
      distinguish if bounty was approved with curator when skipping through
      `Funded` status and moving to `CuratorProposed` status.
      
      If `unassign_curator` is called after `approve_bounty_with_curator` the
      process will fall back to the old flow of calling `propose_curator`
      separately.
      
      ---------
      
      Co-authored-by: default avatarDavidK <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarAnkan <[email protected]>
      2ae79be8
  14. Nov 04, 2024
  15. Nov 01, 2024
  16. Oct 31, 2024