1. Jan 16, 2024
  2. Jan 10, 2024
  3. Jan 09, 2024
  4. Jan 08, 2024
  5. Jan 07, 2024
  6. Jan 05, 2024
  7. Jan 04, 2024
  8. Dec 28, 2023
  9. Dec 27, 2023
  10. Dec 26, 2023
  11. Dec 22, 2023
  12. Dec 21, 2023
  13. Dec 20, 2023
    • joe petrowski's avatar
      Fix Coretime Master (#2765) · d84e135b
      joe petrowski authored
      Should have merged master into #2682 before merging.
      d84e135b
    • Dónal Murray's avatar
      Fix clippy lints behind feature gates and add new CI step all features (#2569) · d68868f6
      Dónal Murray authored
      
      
      Many clippy lints usually enforced by `-Dcomplexity` and `-Dcorrectness`
      are not caught by CI as they are gated by `features`, like
      `runtime-benchmarks`, while the clippy CI job runs with only the default
      features for all targets.
      
      This PR also adds a CI step to run clippy with `--all-features` to
      ensure the code quality is maintained behind feature gates from now on.
      
      To improve local development, clippy lints are downgraded to warnings,
      but they still will result in an error at CI due to the `-Dwarnings`
      rustflag.
      
      ---------
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      d68868f6
    • joe petrowski's avatar
      Add Authorize Upgrade Pattern to Frame System (#2682) · 280aa0b5
      joe petrowski authored
      Adds the `authorize_upgrade` -> `enact_authorized_upgrade` pattern to
      `frame-system`. This will be useful for upgrading bridged chains that
      are under the governance of Polkadot without passing entire runtime Wasm
      blobs over a bridge.
      
      Notes:
      
      - Changed `enact_authorized_upgrade` to `apply_authorized_upgrade`.
      Personal opinion, "apply" more accurately expresses what it's doing. Can
      change back if outvoted.
      - Remove `check_version` in favor of two extrinsics, so as to make
      _checked_ the default.
      - Left calls in `parachain-system` and marked as deprecated to prevent
      breaking the API. They just call into the `frame-system` functions.
      - Updated `frame-system` benchmarks to v2 syntax.
      
      ---------
      
      Co-authored-by: command-bot <>
      280aa0b5
    • Muharem Ismailov's avatar
      pallet-asset-conversion: Decoupling Native Currency Dependancy (#2031) · 4f832ea8
      Muharem Ismailov authored
      closes https://github.com/paritytech/polkadot-sdk/issues/1842
      
      Decoupling Pallet from the Concept of Native Currency
      
      Currently, the pallet is intrinsically linked with the concept of native
      currency, requiring users to provide implementations of the
      `fungible::*` and `fungibles::*` traits to interact with native and non
      native assets. This incapsulates some non-related to the pallet
      complexity and makes it less adaptable in contexts where the native
      currency concept is absent.
      
      With this PR, the dependence on `fungible::*` for liquidity-supplying
      assets has been removed. Instead, the native and non-native currencies'
      handling is now overseen by a single type that implements the
      `fungibles::*` traits. To simplify this integration, types have been
      introduced to facilitate the creation of a union between `fungible::*`
      and `fungibles::*` implementations, producing a unified `fungibles::*`
      type.
      
      One of the reasons driving these changes is the ambition to create a
      more user-friendly API for the `SwapCredit` implementation. Given that
      it interacts with two distinct credit types from `fungible` and
      `fungibles`, a unified type was introduced. Clients now manage potential
      conversion failures for those credit types. In certain contexts, it's
      vital to guarantee that operations are fail-safe, like in this impl -
      [PR](https://github.com/paritytech/polkadot-sdk/pull/1845), place in
      [code](https://github.com/paritytech/polkadot-sdk/blob/20b85a5fada8f55c98ba831964f5866ffeadf4da/cumulus/primitives/utility/src/lib.rs#L429).
      
      Additional Updates:
      - abstracted the pool ID and its account derivation logic via trait
      bounds, along with common implementation offerings;
      - removed `inc_providers` on a pool creation for the pool account;
      - benchmarks:
      -- swap complexity is N, not const;
      -- removed `From<u128> + Into<u128>` bound from `T::Balance`;
      -- removed swap/liquidity/.. amount constants, resolve them dynamically
      based on pallet configuration;
      -- migrated to v2 API;
      - `OnUnbalanced` handler for the pool creation fee, replacing direct
      transfers to a specified account ID;
      - renamed `MultiAssetId` to `AssetKind` aligning with naming across
      frame crates;
      
      related PRs:
      - (depends) https://github.com/paritytech/polkadot-sdk/pull/1677
      - (caused) https://github.com/paritytech/polkadot-sdk/pull/2033
      - (caused) https://github.com/paritytech/polkadot-sdk/pull/1876
      
      
      
      ---------
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      4f832ea8
  14. Dec 19, 2023
  15. Dec 18, 2023
  16. Dec 15, 2023
  17. Dec 14, 2023
    • Svyatoslav Nikolsky's avatar
      Add Rococo People <> Rococo Bulletin bridge support to Rococo Bridge Hub (#2540) · 097308e3
      Svyatoslav Nikolsky authored
      This PR adds [Rococo
      People](https://github.com/paritytech/polkadot-sdk/pull/2281) <> [Rococo
      Bulletin](https://github.com/zdave-parity/polkadot-bulletin-chain) to
      the Rococo Bridge Hub code. There's a couple of things left to do here:
      - [x] add remaining tests - it'd need some refactoring in the
      `bridge-hub-test-utils` - will do in a separate PR;
      - [x] actually run benchmarks for new messaging pallet (do we have bot
      nowadays?).
      
      The reason why I'm opening it before this ^^^ is ready, is that I'd like
      to hear others opinion on how to deal with hacks with that bridge.
      Initially I was assuming that Rococo Bulletin will be the 1:1 copy of
      the Polkadot Bulletin (to avoid maintaining multiple
      runtimes/releases/...), so you can see many `PolkadotBulletin` mentions
      in this PR, even though we are going to bridge with the parallel chain
      (`RococoBulletin`). That's because e.g. pallet names from
      `construct_runtime` are affecting runtime storage keys and bridges are
      using runtime storage proofs => it is important to use names that the
      Bulletin chain expects.
      
      But in the end, this hack won't work - we can't use Polkadot Bulletin
      runtime to bridge with Rococo Bridge Hub, because Polkadot Bulletin
      expects Polkadot Bridge hub to use `1002` parachain id and Rococo Bridge
      Hub seats on the `1013`. This also affects storage keys using in
      bridging, so I had to add the [`rococo`
      feature](https://github.com/svyatonik/polkadot-bulletin-chain/blob/add-bridge-pallets/runtime/Cargo.toml#L198)
      to the Bulletin chain. So now we can actually alter its runtime and
      adapt it for Rococo.
      
      So the question here is - what's better for us here
      - to leave everything as is (seems hacky and non-trivial);
      - change Bulletin chain runtime when `rococo` feature is used - e.g. use
      proper names there (`WithPolkadotGrandpa` -> `WithRococoGrandpa`, ...)
      - add another set of pallets to the Bulletin chain runtime to bridge
      with Rococo and never use them in production. Similar to hack that we
      had in Rococo/Wococo
      
      cc @acatangiu @bkontur @serban300 
      
      also cc @joepetrowski
      
       as the main "client" of this bridge
      
      ---
      
      A couple words on how this bridge is different from the Rococo <>
      Westend bridge:
      - it is a bridge with a chain that uses GRANDPA finality, not the
      parachain finality (hence the tests needs to be changed);
      - it is a fee-free bridge. So
      `AllowExplicitUnpaidExecutionFrom<Equals<SiblingPeople>>` + we are not
      paying any rewards to relayers (apart from compensating transaction
      costs).
      
      ---------
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarEgor_P <[email protected]>
      Co-authored-by: command-bot <>
      097308e3
    • Francisco Aguirre's avatar
      Add FungibleAdapter (#2684) · 10a91f82
      Francisco Aguirre authored
      In the move from the old `Currency` traits to the new `fungible/s`
      family of traits, we already had the `FungiblesAdapter` and
      `NonFungiblesAdapter` for multiple fungible and non fungible assets
      respectively. However, for handling only one fungible asset, we were
      missing a `FungibleAdapter`, and so used the old `CurrencyAdapter`
      instead. This PR aims to fill in that gap, and provide the new adapter
      for more updated examples.
      
      I marked the old `CurrencyAdapter` as deprecated as part of this PR, and
      I'll change it to the new `FungibleAdapter` in a following PR.
      The two stages are separated so as to not bloat this PR with some name
      fixes in tests.
      
      ---------
      
      Co-authored-by: command-bot <>
      10a91f82
    • Egor_P's avatar
      [Backport] txn version bump from 1.5.0 (#2709) · 3e4e8c0b
      Egor_P authored
      This PR backports `transaction_version` bump from `1.5.0` release back
      to `master`
      3e4e8c0b
  18. Dec 13, 2023
    • Squirrel's avatar
      Set clippy lints in workspace (requires rust 1.74) (#2390) · be8e6268
      Squirrel authored
      
      
      We currently use a bit of a hack in `.cargo/config` to make sure that
      clippy isn't too annoying by specifying the list of lints.
      
      There is now a stable way to define lints for a workspace. The only down
      side is that every crate seems to have to opt into this so there's a
      *few* files modified in this PR.
      
      Dependencies:
      
      - [x] PR that upgrades CI to use rust 1.74 is merged.
      
      ---------
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      be8e6268
    • Branislav Kontur's avatar
      Updated benchmarks related to the Rococo/Westend bridge (#2639) · 4c4407a8
      Branislav Kontur authored
      Co-authored-by: command-bot <>
      4c4407a8
    • Svyatoslav Nikolsky's avatar
      Tests for BridgeHub(s) <> remote GRANDPA chain (#2692) · 9ecb2d33
      Svyatoslav Nikolsky authored
      So far the `bridge-hub-test-utils` contained a tests set for testing
      BridgeHub runtime that is bridging with the remote **parachain**. But we
      have https://github.com/paritytech/polkadot-sdk/pull/2540 coming, which
      would add Rococo <> Bulletin chain bridge (where Bulletin = standalone
      chain that is using GRANDPA finality). Then it'll be expanded to
      Polkadot BH as well.
      
      So this PR adds the same set of tests to the `bridge-hub-test-utils`,
      but for the case when remote chain is the chain with GRANDPA finality.
      There's a lot of changes in this PR - I'll describe some:
      - I've added `BasicParachainRuntime` trait to decrease number of lines
      we need to add to `where` clause. Could revert, but imo it is useful;
      - `cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_data` is
      a submodule for generating test data for the test sets.
      `from_parachain.rs` is used in tests for the case when remote chain is a
      parachain, `from_grandpa_chain.rs` - for the bridges with remote GRANDPA
      chains. `mod.rs` has some code, shared by both types of tests;
      - `cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_data` is
      a submodule with all test cases. The `mod.rs` has tests, suitable for
      all cases. There's also `wth_parachain.rs` and `with_grandpa_chain.rs`
      with the same meaning as above;
      - I've merged the "core" code of two previous tests -
      `relayed_incoming_message_works` and `complex_relay_extrinsic_works`
      into one single `relayed_incoming_message_works` test. So now we are
      always constructing extrinsics and are dispatching them using executive
      module (meaning all signed extensions are also tested).
      
      New test set is used here:
      https://github.com/paritytech/polkadot-sdk/pull/2540. Once this PR is
      merged, I'll merge that other PR with master to remove duplicate
      changes.
      
      I'm also planning to cleanup generic constraints + remove some
      unnecessary assumptions about used chains in a follow-up PRs. But for
      now I think this PR has enough changes, so don't want to complicate it
      even more.
      
      ---
      
      Breaking changes for the code that have used those tests before:
      - the `construct_and_apply_extrinsic` callback now accepts the
      `RuntimeCall` instead of the `pallet_utility::Call`;
      - the `construct_and_apply_extrinsic` now may be called multiple times
      for the single test, so make sure the `frame_system::CheckNonce` is
      correctly constructed;
      - all previous tests have been moved from
      `bridge_hub_test_utils::test_cases` to
      `bridge_hub_test_utils::test_cases::from_parachain` module;
      - there are several changes in test arguments - please refer to
      https://github.com/paritytech/polkadot-sdk/compare/sv-tests-for-bridge-with-remote-grandpa-chain?expand=1#diff-79a28d4d3e1749050341c2424f00c4c139825b1a20937767f83e58b95166735c
      for details.
      9ecb2d33
    • Alexandru Gheorghe's avatar
      Approve multiple candidates with a single signature (#1191) · a84dd0db
      Alexandru Gheorghe authored
      Initial implementation for the plan discussed here: https://github.com/paritytech/polkadot-sdk/issues/701
      Built on top of https://github.com/paritytech/polkadot-sdk/pull/1178
      v0: https://github.com/paritytech/polkadot/pull/7554,
      
      ## Overall idea
      
      When approval-voting checks a candidate and is ready to advertise the
      approval, defer it in a per-relay chain block until we either have
      MAX_APPROVAL_COALESCE_COUNT candidates to sign or a candidate has stayed
      MAX_APPROVALS_COALESCE_TICKS in the queue, in both cases we sign what
      candidates we have available.
      
      This should allow us to reduce the number of approvals messages we have
      to create/send/verify. The parameters are configurable, so we should
      find some values that balance:
      
      - Security of the network: Delaying broadcasting of an approval
      shouldn't but the finality at risk and to make sure that never happens
      we won't delay sending a vote if we are past 2/3 from the no-show time.
      - Scalability of the network: MAX_APPROVAL_COALESCE_COUNT = 1 &
      MAX_APPROVALS_COALESCE_TICKS =0, is what we have now and we know from
      the measurements we did on versi, it bottlenecks
      approval-distribution/approval-voting when increase significantly the
      number of validators and parachains
      - Block storage: In case of disputes we have to import this votes on
      chain and that increase the necessary storage with
      MAX_APPROVAL_COALESCE_COUNT * CandidateHash per vote. Given that
      disputes are not the normal way of the network functioning and we will
      limit MAX_APPROVAL_COALESCE_COUNT in the single digits numbers, this
      should be good enough. Alternatively, we could try to create a better
      way to store this on-chain through indirection, if that's needed.
      
      ## Other fixes:
      - Fixed the fact that we were sending random assignments to
      non-validators, that was wrong because those won't do anything with it
      and they won't gossip it either because they do not have a grid topology
      set, so we would waste the random assignments.
      - Added metrics to be able to debug potential no-shows and
      mis-processing of approvals/assignments.
      
      ## TODO:
      - [x] Get feedback, that this is moving in the right direction. @ordian
      @sandreim @eskimor @burdges, let me know what you think.
      - [x] More and more testing.
      - [x]  Test in versi.
      - [x] Make MAX_APPROVAL_COALESCE_COUNT &
      MAX_APPROVAL_COALESCE_WAIT_MILLIS a parachain host configuration.
      - [x] Make sure the backwards compatibility works correctly
      - [x] Make sure this direction is compatible with other streams of work:
      https://github.com/paritytech/polkadot-sdk/issues/635 &
      https://github.com/paritytech/polkadot-sdk/issues/742
      
      
      - [x] Final versi burn-in before merging
      
      ---------
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      a84dd0db