1. Jan 19, 2024
  2. Jan 18, 2024
  3. Jan 17, 2024
  4. Jan 16, 2024
    • Francisco Aguirre's avatar
      XCMv4 (#1230) · 8428f678
      Francisco Aguirre authored
      
      
      # Note for reviewer
      
      Most changes are just syntax changes necessary for the new version.
      Most important files should be the ones under the `xcm` folder.
      
      # Description 
      
      Added XCMv4.
      
      ## Removed `Multi` prefix
      The following types have been renamed:
      - MultiLocation -> Location
      - MultiAsset -> Asset
      - MultiAssets -> Assets
      - InteriorMultiLocation -> InteriorLocation
      - MultiAssetFilter -> AssetFilter
      - VersionedMultiAsset -> VersionedAsset
      - WildMultiAsset -> WildAsset
      - VersionedMultiLocation -> VersionedLocation
      
      In order to fix a name conflict, the `Assets` in `xcm-executor` were
      renamed to `HoldingAssets`, as they represent assets in holding.
      
      ## Removed `Abstract` asset id
      
      It was not being used anywhere and this simplifies the code.
      
      Now assets are just constructed as follows:
      
      ```rust
      let asset: Asset = (AssetId(Location::new(1, Here)), 100u128).into();
      ```
      
      No need for specifying `Concrete` anymore.
      
      ## Outcome is now a named fields struct
      
      Instead of
      
      ```rust
      pub enum Outcome {
        Complete(Weight),
        Incomplete(Weight, Error),
        Error(Error),
      }
      ```
      
      we now have
      
      ```rust
      pub enum Outcome {
        Complete { used: Weight },
        Incomplete { used: Weight, error: Error },
        Error { error: Error },
      }
      ```
      
      ## Added Reanchorable trait
      
      Now both locations and assets implement this trait, making it easier to
      reanchor both.
      
      ## New syntax for building locations and junctions
      
      Now junctions are built using the following methods:
      
      ```rust
      let location = Location {
          parents: 1,
          interior: [Parachain(1000), PalletInstance(50), GeneralIndex(1984)].into()
      };
      ```
      
      or
      
      ```rust
      let location = Location::new(1, [Parachain(1000), PalletInstance(50), GeneralIndex(1984)]);
      ```
      
      And they are matched like so:
      
      ```rust
      match location.unpack() {
        (1, [Parachain(id)]) => ...
        (0, Here) => ...,
        (1, [_]) => ...,
      }
      ```
      
      This syntax is mandatory in v4, and has been also implemented for v2 and
      v3 for easier migration.
      
      This was needed to make all sizes smaller.
      
      # TODO
      - [x] Scaffold v4
      - [x] Port github.com/paritytech/polkadot/pull/7236
      - [x] Remove `Multi` prefix
      - [x] Remove `Abstract` asset id
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      8428f678
    • Andrei Eres's avatar
      subsystem-bench: cache misses profiling (#2893) · ec7bfae0
      Andrei Eres authored
      ## Why we need it
      To provide another level of understanding to why polkadot's subsystems
      may perform slower than expected. Cache misses occur when processing
      large amounts of data, such as during availability recovery.
      
      ## Why Cachegrind
      Cachegrind has many drawbacks: it is slow, it uses its own cache
      simulation, which is very basic. But unlike `perf`, which is a great
      tool, Cachegrind can run in a virtual machine. This means we can easily
      run it in remote installations and even use it in CI/CD to catch
      possible regressions.
      
      Why Cachegrind and not Callgrind, another part of Valgrind? It is simply
      empirically proven that profiling runs faster with Cachegrind.
      
      ## First results
      First results have been obtained while testing of the approach. Here is
      an example.
      
      ```
      $ target/testnet/subsystem-bench --n-cores 10 --cache-misses data-availability-read
      $ cat cachegrind_report.txt
      I refs:        64,622,081,485
      I1  misses:         3,018,168
      LLi misses:           437,654
      I1  miss rate:           0.00%
      LLi miss rate:           0.00%
      
      D refs:        12,161,833,115  (9,868,356,364 rd   + 2,293,476,751 wr)
      D1  misses:       167,940,701  (   71,060,073 rd   +    96,880,628 wr)
      LLd misses:        33,550,018  (   16,685,853 rd   +    16,864,165 wr)
      D1  miss rate:            1.4% (          0.7%     +           4.2%  )
      LLd miss rate:            0.3% (          0.2%     +           0.7%  )
      
      LL refs:          170,958,869  (   74,078,241 rd   +    96,880,628 wr)
      LL misses:         33,987,672  (   17,123,507 rd   +    16,864,165 wr)
      LL miss rate:             0.0% (          0.0%     +           0.7%  )
      ```
      
      The CLI output shows that 1.4% of the L1 data cache missed, which is not
      so bad, given that the last-level cache had that data most of the time
      missing only 0.3%. Instruction data of the L1 has 0.00% misses of the
      time. Looking at an output file with `cg_annotate` shows that most of
      the misses occur during reed-solomon, which is expected.
      ec7bfae0
    • dependabot[bot]'s avatar
      Bump walkdir from 2.3.3 to 2.4.0 (#2910) · 82c057ee
      dependabot[bot] authored
      Bumps [walkdir](https://github.com/BurntSushi/walkdir) from 2.3.3 to
      2.4.0.
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/BurntSushi/walkdir/commit/037c5e16ec4d8b3eacb51f077cfdab7a356e8412"><code>037c5e1</code></a>
      2.4.0</li>
      <li><a
      href="https://github.com/BurntSushi/walkdir/commit/dcc527d8326fae4272b66bb55f433a302a8cad6f"><code>dcc527d</code></a>
      api: add follow_root_links() option to WalkDir</li>
      <li><a
      href="https://github.com/BurntSushi/walkdir/commit/61a185fe49df24966acdec732f5a4b44a0475031"><code>61a185f</code></a>
      ci: use latest OS versions</li>
      <li>See full diff in <a
      href="https://github.com/BurntSushi/walkdir/compare/2.3.3...2.4.0">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=walkdir&package-manager=cargo&previous-version=2.3.3&new-version=2.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores
      
      )
      
      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>
      82c057ee
    • Xavier Lau's avatar
      CI check features (#1708) · 05cfb02b
      Xavier Lau authored
      To resolve issue #1136.
      
      This is a cross verification against zepter.
      
      - [cargo-featalign](https://github.com/hack-ink/cargo-featalign):
      Verifies the proper propagation of all features.
      - [zepter](https://github.com/ggwpez/zepter): Checks for accidentally
      enabled features.
      
      cc @ggwpez
      
       
      
      ---
      Switch to a new branch. Original PR #1537.
      
      ---------
      
      Signed-off-by: default avatarXavier Lau <[email protected]>
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarChevdor <[email protected]>
      05cfb02b
    • Dónal Murray's avatar
      Bump rococo relay and coretime-rococo to 1.6 (#2913) · a42a47f8
      Dónal Murray authored
      Co-authored-by: command-bot <>
      a42a47f8
    • Muharem Ismailov's avatar
      XCM WeightTrader: Swap Fee Asset for Native Asset (#1845) · 2cb39f8d
      Muharem Ismailov authored
      Implements an XCM executor `WeightTrader`, facilitating fee payments in
      any asset that can be exchanged for a native asset.
      
      A few constraints need to be observed:
      - `buy_weight` and `refund` operations must be atomic, as another weight
      trader implementation might be attempted in case of failure.
      - swap credit must be utilized since there isn’t an account to which an
      asset of some class can be deposited with a guarantee to meet the
      existential deposit requirement. Also, operating with credits enhances
      the efficiency of the weight trader -
      https://github.com/paritytech/polkadot-sdk/pull/1677
      
      related PRs:
      - (depends) https://github.com/paritytech/polkadot-sdk/pull/2031
      - (depends) https://github.com/paritytech/polkadot-sdk/pull/1677
      - (caused) https://github.com/paritytech/polkadot-sdk/pull/1847
      - (caused) https://github.com/paritytech/polkadot-sdk/pull/1876
      
      // DONE: impl `OnUnbalanced` for a `fungible/s` credit
      // DONE: make the trader free from a concept of a native currency and
      drop few fallible conversions. related issue -
      https://github.com/paritytech/polkadot-sdk/issues/1842
      
      
      // DONE: tests
      
      ---------
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      2cb39f8d
    • dependabot[bot]'s avatar
      Bump Swatinem/rust-cache from 2.7.2 to 2.7.3 (#2925) · 4c4963a1
      dependabot[bot] authored
      Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from
      2.7.2 to 2.7.3.
      <details>
      <summary>Release notes</summary>
      <p><em>Sourced from <a
      href="https://github.com/swatinem/rust-cache/releases">Swatinem/rust-cache's
      releases</a>.</em></p>
      <blockquote>
      <h2>v2.7.3</h2>
      <ul>
      <li>Work around upstream problem that causes cache saving to hang for
      minutes.</li>
      </ul>
      <p><strong>Full Changelog</strong>: <a
      href="https://github.com/Swatinem/rust-cache/compare/v2.7.2...v2.7.3">https://github.com/Swatinem/rust-cache/compare/v2.7.2...v2.7.3</a></p>
      </blockquote>
      </details>
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md">Swatinem/rust-cache's
      changelog</a>.</em></p>
      <blockquote>
      <h1>Changelog</h1>
      <h2>2.7.3</h2>
      <ul>
      <li>Work around upstream problem that causes cache saving to hang for
      minutes.</li>
      </ul>
      <h2>2.7.2</h2>
      <ul>
      <li>Only key by <code>Cargo.toml</code> and <code>Cargo.lock</code>
      files of workspace members.</li>
      </ul>
      <h2>2.7.1</h2>
      <ul>
      <li>Update toml parser to fix parsing errors.</li>
      </ul>
      <h2>2.7.0</h2>
      <ul>
      <li>Properly cache <code>trybuild</code> tests.</li>
      </ul>
      <h2>2.6.2</h2>
      <ul>
      <li>Fix <code>toml</code> parsing.</li>
      </ul>
      <h2>2.6.1</h2>
      <ul>
      <li>Fix hash contributions of
      <code>Cargo.lock</code>/<code>Cargo.toml</code> files.</li>
      </ul>
      <h2>2.6.0</h2>
      <ul>
      <li>Add &quot;buildjet&quot; as a second <code>cache-provider</code>
      backend.</li>
      <li>Clean up sparse registry index.</li>
      <li>Do not clean up src of <code>-sys</code> crates.</li>
      <li>Remove <code>.cargo/credentials.toml</code> before saving.</li>
      </ul>
      <h2>2.5.1</h2>
      <ul>
      <li>Fix hash contribution of <code>Cargo.lock</code>.</li>
      </ul>
      <h2>2.5.0</h2>
      <ul>
      <li>feat: Rm workspace crates version before caching.</li>
      <li>feat: Add hash of <code>.cargo/config.toml</code> to key.</li>
      </ul>
      <h2>2.4.0</h2>
      <ul>
      <li>Fix cache key stability.</li>
      <li>Use 8 character hash components to reduce the key length, making it
      more readable.</li>
      </ul>
      <h2>2.3.0</h2>
      <ul>
      <li>Add <code>cache-all-crates</code> option, which enables caching of
      crates installed by workflows.</li>
      </ul>
      <!-- raw HTML omitted -->
      </blockquote>
      <p>... (truncated)</p>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/Swatinem/rust-cache/commit/23bce251a8cd2ffc3c1075eaa2367cf899916d84"><code>23bce25</code></a>
      2.7.3</li>
      <li><a
      href="https://github.com/Swatinem/rust-cache/commit/378c8285a4eaf12899d11bea686a763e906956af"><code>378c828</code></a>
      Work around upstream GitHub issue and update dependencies</li>
      <li>See full diff in <a
      href="https://github.com/swatinem/rust-cache/compare/a22603398250b864f7190077025cf752307154dc...23bce251a8cd2ffc3c1075eaa2367cf899916d84">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Swatinem/rust-cache&package-manager=github_actions&previous-version=2.7.2&new-version=2.7.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores
      
      )
      
      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 this major version` will close this PR and stop
      Dependabot creating any more for this major version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this minor version` will close this PR and stop
      Dependabot creating any more for this minor version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this dependency` will close this PR and stop
      Dependabot creating any more for this dependency (unless you reopen the
      PR or upgrade to it yourself)
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      4c4963a1
    • Bastian Köcher's avatar
      Some random fixes (#2936) · 1c2db174
      Bastian Köcher authored
      - Do not disable `std` feature in the integration tests
      - `contracts-fixtures` test should only check for `riscv` build when the
      feature is enabled
      1c2db174
  5. Jan 15, 2024