Skip to content
  1. Feb 23, 2024
  2. Feb 21, 2024
    • Alexander Theißen's avatar
      contracts: Fix double charge of gas for host functions (#3361) · f3a6b6dc
      Alexander Theißen authored
      
      
      This PR is fixing a bug in the sync mechanism between wasmi and
      pallet-contracts. This bug leads to essentially double charging all the
      gas that was used during the execution of the host function. When the
      `call` host function is used for recursion this will lead to a quadratic
      amount of gas consumption with regard to the nesting depth.We also took
      the chance to refactor the code in question and improve the rust docs.
      
      The bug was caused by not updating `GasMeter::executor_consumed`
      (previously `engine_consumed`) when leaving the host function. This lead
      to the value being stale (too low) when entering another host function.
      
      ---------
      
      Co-authored-by: default avatarPG Herveou <[email protected]>
      f3a6b6dc
  3. Feb 20, 2024
    • PG Herveou's avatar
      Contracts: Stabilize APIs (#3384) · d250a6e4
      PG Herveou authored
      Remove `#[unstable]` on `call_v2`, `instantiate_v2`,
      `lock_delegate_dependency` and `unlock_delegate_dependency`.
      See ink! integrations: 
      - call_v2: https://github.com/paritytech/ink/pull/2077
      - instantiate_v2: <TODO>
      - lock/unlock dependency: https://github.com/paritytech/ink/pull/2076
      d250a6e4
    • 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
  4. Feb 19, 2024
    • PG Herveou's avatar
      Contracts: xcm host fn fixes (#3086) · ca382f32
      PG Herveou authored
      ## Xcm changes:
      - Fix `pallet_xcm::execute`, move the logic into The `ExecuteController`
      so it can be shared with anything that implement that trait.
      - Make `ExecuteController::execute` retursn `DispatchErrorWithPostInfo`
      instead of `DispatchError`, so that we don't charge the full
      `max_weight` provided if the execution is incomplete (useful for
      force_batch or contracts calls)
      - Fix docstring for `pallet_xcm::execute`, to reflect the changes from
      #2405
      - Update the signature for `ExecuteController::execute`, we don't need
      to return the `Outcome` anymore since we only care about
      `Outcome::Complete`
      
      ## Contracts changes:
      
      - Update host fn `xcm_exexute`, we don't need to write the `Outcome` to
      the sandbox memory anymore. This was also not charged as well before so
      it if fixes this too.
      - One of the issue was that the dry_run of a contract that call
      `xcm_execute` would exhaust the `gas_limit`.
      
      This is because `XcmExecuteController::execute` takes a `max_weight`
      argument, and since we don't want the user to specify it manually we
      were passing everything left by pre-charghing
      `ctx.ext.gas_meter().gas_left()`
      
      - To fix it I added a `fn influence_lowest_limit` on the `Token` trait
      and make it return false for `RuntimeCost::XcmExecute`.
      - Got rid of the `RuntimeToken` indirection, we can just use
      `RuntimeCost` directly.
      
      ---------
      
      Co-authored-by: command-bot <>
      ca382f32
    • Gilt0's avatar
      [FRAME Core] remove unnecessary overrides while using derive_impl for frame_system (#3317) · b78c72cf
      Gilt0 authored
      
      
      # Description
      
      This PR removes redundant type definition from test definition config
      implementations like
      ```
      #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
      impl frame_system::Config for Test {
          type A = A;
          ...
      }
      ```
      
      This changes avoid redundancies in the code as the macro `derive_impl`
      defines the relevant types. To implement the changes, it was a simple
      fact of running tests and making sure that the tests would still run
      while the definition would be removed.
      
      Closes #3237
      
      As a note, here is a brief account of things done from the Issue's
      description statement
      ```
      alliance migrate alliance, fast-unstake and bags list to use derive-impl #1636
      asset-conversion                                                                                            DONE
      asset-rate                                                                                                  DONE
      assets                                                                                                      DONE
      atomic-swap                                                                                                 DONE
      aura                                                                                                        DONE
      authority-discovery                                                                                         DONE                                                                     
      authorship  migrate babe and authorship to use derive-impl #1790
      babe  migrate babe and authorship to use derive-impl #1790
      bags-list migrate alliance, fast-unstake and bags list to use derive-impl #1636
      balances                                                                                                    DONE
      beefy                                                                                                       NOTHING TO DO --- also noted this error without failing tests Feb 13 13:49:08.941 ERROR runtime::timestamp: `pallet_timestamp::UnixTime::now` is called at genesis, invalid value returned: 0
      beefy-mmr                                                                                                   NOTHING TO DO
      bounties                                                                                                    DONE
      child-bounties                                                                                              DONE
      collective                                                                                                  DONE
      contracts                                                                                                   DONE
      conviction-voting                                                                                           DONE
      core-fellowship                                                                                             NOTHING TO DO
      democracy                                                                                                   DONE
      election-provider-multi-phase                                                                               NOTHING TO DO
      elections-phragmen                                                                                          DONE
      executive                                                                                                   NOTHING TO DO
      fast-unstake migrate alliance, fast-unstake and bags list to use derive-impl #1636
      glutton                                                                                                     DONE
      grandpa                                                                                                     DONE
      identity                                                                                                    DONE
      im-online                                                                                                   NOTHING TO DO
      indices Refactor indices pallet #1789
      insecure-randomness-collective-flip                                                                         DONE
      lottery                                                                                                     DONE
      membership                                                                                                  DONE
      merkle-mountain-range                                                                                       NOTHING TO DO
      message-queue                                                                                               DONE
      multisig add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453
      nft-fractionalization                                                                                       DONE
      nfts                                                                                                        DONE
      nicks Refactor pallet-state-trie-migration to fungible::* traits #1801                                      NOT IN REPO
      nis                                                                                                         DONE
      node-authorization                                                                                          DONE
      nomination-pools                                                                                            NOTHING TO DO -- ONLY impl for Runtime
      offences                                                                                                    DELETED EVERYTHING -- IS THAT CORRECT??
      preimage                                                                                                    DONE
      proxy add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453
      ranked-collective                                                                                           NOTHING TO DO
      recovery                                                                                                    DONE
      referenda                                                                                                   DONE
      remark                                                                                                      DONE
      root-offences                                                                                               DONE
      root-testing                                                                                                NOTHING TO DO
      salary                                                                                                      NOTHING TO DO
      scheduler                                                                                                   DONE
      scored-pool                                                                                                 DONE
      session                                                                                                     DONE -- substrate/frame/session/benchmarking/src/mock.rs untouched
      society                                                                                                     NOTHING TO DO
      staking                                                                                                     DONE
      staking-bags-benchmarks                                                                                     NOT IN REPO
      state-trie-migration                                                                                        NOTHING TO DO
      statement                                                                                                   DONE
      sudo                                                                                                        DONE
      system                                                                                                      DONE
      timestamp                                                                                                   DONE
      tips                                                                                                        DONE
      transaction-payment                                                                                         NOTHING TO DO
      transaction-storage                                                                                         NOTHING TO DO
      treasury                                                                                                    DONE
      try-runtime                                                                                                 NOTHING TO DO -- no specific mention of 'for Test'
      uniques                                                                                                     DONE
      utility                                                                                                     DONE
      vesting                                                                                                     DONE
      whitelist                                                                                                   DONE
      ```
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatargupnik <[email protected]>
      b78c72cf
  5. 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
  6. Feb 13, 2024
  7. 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
  8. Feb 08, 2024
    • PG Herveou's avatar
      Contracts update doc.rs metadata (#3241) · bc5a758c
      PG Herveou authored
      
      
      Adding Rust metadata for doc
      see https://docs.rs/about/metadata
      
      ---------
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      bc5a758c
    • Alexander Theißen's avatar
      contracts: Remove no longer enforced limits from the `Schedule` (#3184) · d54412ce
      Alexander Theißen authored
      When switching from the instrumented gas metering to the wasmi gas
      metering we also removed all imposed limits regarding Wasm module
      internals. All those things do not interact with the host and have to be
      handled by wasmi. For example, Wasmi charges additional gas for
      parameters to each function because as they incur some overhead.
      
      Back then we took the opportunity to remove the dependency on the
      deprecated `parity-wasm` which was used to enforce those limits.
      
      This PR merely removes them from the `Schedule` they aren't enforced for
      a while.
      d54412ce
    • Alexander Theißen's avatar
      contracts: Remove unused benchmarks (#3185) · 7fa05518
      Alexander Theißen authored
      Those were used for some adhoc comparison of solang vs ink! with regards
      to ERC20 transfers. Not been used for a while.
      
      Benchmarking is done here now:
      [smart-bench](https://github.com/paritytech/smart-bench): Weight based
      benchmark to test how much transaction actually fit into a block with
      the current Weights
      [schlau](https://github.com/ascjones/schlau): Time based benchmarks to
      compare performance
      7fa05518
    • Alexander Theißen's avatar
      contracts: Don't fail fast if the `Weight` limit of a cross contract call is too big (#3243) · 28463a12
      Alexander Theißen authored
      
      
      When doing a cross contract call you can supply an optional Weight limit
      for that call. If one doesn't specify the limit (setting it to 0) the
      sub call will have all the remaining gas available. If one does specify
      the limit we subtract that amount eagerly from the Weight meter and fail
      fast if not enough `Weight` is available.
      
      This is quite annoying because setting a fixed limit will set the
      `gas_required` in the gas estimation according to the specified limit.
      Even if in that dry-run the actual call didn't consume that whole
      amount. It effectively discards the more precise measurement it should
      have from the dry-run.
      
      This PR changes the behaviour so that the supplied limit is an actual
      limit: We do the cross contract call even if the limit is higher than
      the remaining `Weight`. We then fail and roll back in the cub call in
      case there is not enough weight.
      
      This makes the weight estimation in the dry-run no longer dependent on
      the weight limit supplied when doing a cross contract call.
      
      ---------
      
      Co-authored-by: default avatarPG Herveou <[email protected]>
      28463a12
  9. Feb 06, 2024
    • Squirrel's avatar
      sp-std -> core (#3199) · bc2e5e1f
      Squirrel authored
      First in a series of PRs that reduces our use of sp-std with a view to
      deprecating it.
      
      This is just looking at /substrate and moving some of the references
      from `sp-std` to `core`.
      These particular changes should be uncontroversial.
      
      Where macros are used `::core` should be used to remove any ambiguity.
      
      part of https://github.com/paritytech/polkadot-sdk/issues/2101
      bc2e5e1f
  10. Feb 03, 2024
  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 30, 2024
  13. Jan 28, 2024
    • dependabot[bot]'s avatar
      Bump polkavm-derive from 0.4.0 to 0.5.0 (#3011) · 84a246c2
      dependabot[bot] authored
      
      
      Bumps [polkavm-derive](https://github.com/koute/polkavm) from 0.4.0 to
      0.5.0.
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/koute/polkavm/commit/fe4f77a161bfe6ae247c7290b3e314a713865071"><code>fe4f77a</code></a>
      Add more tests</li>
      <li><a
      href="https://github.com/koute/polkavm/commit/170d1bf2ff468eefd7b46a56bacb2996a480ce25"><code>170d1bf</code></a>
      Rework
      <code>R_RISCV_HI20</code>/<code>R_RISCV_LO12_I</code>/<code>R_RISCV_LO12_S</code>
      relocations</li>
      <li><a
      href="https://github.com/koute/polkavm/commit/97310bb7a2cf0c109957c3f6e59f2dfc9f1a470d"><code>97310bb</code></a>
      Support more types of relocations</li>
      <li><a
      href="https://github.com/koute/polkavm/commit/09ae074e680072f6839d565062ff78d0427e3bca"><code>09ae074</code></a>
      Add a slightly better error message</li>
      <li><a
      href="https://github.com/koute/polkavm/commit/02f1a061c34a355805a3e73b8a1a98775ced609e"><code>02f1a06</code></a>
      Make error messages about unsupported relocations more
      human-readable</li>
      <li><a
      href="https://github.com/koute/polkavm/commit/4c7e40dd7be9ac7608124e74859448376b671a66"><code>4c7e40d</code></a>
      Support importing of the same function from multiple places</li>
      <li><a
      href="https://github.com/koute/polkavm/commit/35968d9b1625fde61df420d1a42614a730cfdadc"><code>35968d9</code></a>
      Update the test blob build script</li>
      <li><a
      href="https://github.com/koute/polkavm/commit/3b2176d3835157e7e1f76787c96abf91b4b8ba9a"><code>3b2176d</code></a>
      Reexport <code>ProgramParseError</code> from
      <code>polkavm-linker</code></li>
      <li><a
      href="https://github.com/koute/polkavm/commit/200124014fd5b666af5b7ea4b80016332bd77883"><code>2001240</code></a>
      Support <code>unsafe fn</code>s in <code>#[polkavm_export]</code></li>
      <li><a
      href="https://github.com/koute/polkavm/commit/9b76ec57b7e949f17c62d6c11a41699ac1699623"><code>9b76ec5</code></a>
      Remove the need for a linker script</li>
      <li>Additional commits viewable in <a
      href="https://github.com/koute/polkavm/compare/v0.4.0...v0.5.0">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=polkavm-derive&package-manager=cargo&previous-version=0.4.0&new-version=0.5.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>
      84a246c2
  14. Jan 26, 2024
    • Alexander Theißen's avatar
      contracts: Fix printing the `Schedule` (#3021) · 5e5341da
      Alexander Theißen authored
      Printing the `Schedule` is a useful debugging tool and general sanity
      check. It is much more easy to interpret than the raw weights.
      
      The printing relied on using `println` and hence was only available from
      the native runtime. This is no longer available. This is why in this PR
      we switch to using `log` which works from Wasm.
      
      I made sure that the `WeightDebug` is only derived when
      `runtime-benchmarks` is set so that we don't increase the size of the
      binary.
      
      Some other changes were necessary to make this actually work inside the
      runtime. For example, I needed to remove `format!` and usage of floats.
      
      Please note that this removed the decimal from the number because
      truncating the fraction without using floats would not be easy and would
      require custom code. I think the precision here is sufficient.
      
      This is how the output looks like now:
      ```
      Schedule {
          limits: Limits {
              event_topics: 4,
              globals: 256,
              locals: 1024,
              parameters: 128,
              memory_pages: 16,
              table_size: 4096,
              br_table_size: 256,
              subject_len: 32,
              payload_len: 16384,
              runtime_memory: 134217728,
          },
          instruction_weights: InstructionWeights {
              base: 2565,
              _phantom: PhantomData<kitchensink_runtime::Runtime>,
          },
          host_fn_weights: HostFnWeights {
              caller: 322 ns, 6 bytes,
              is_contract: 28 µs, 2684 bytes,
              code_hash: 29 µs, 2688 bytes,
              own_code_hash: 400 ns, 6 bytes,
              caller_is_origin: 176 ns, 3 bytes,
              caller_is_root: 158 ns, 3 bytes,
              address: 315 ns, 6 bytes,
              gas_left: 355 ns, 6 bytes,
              balance: 1 µs, 6 bytes,
              value_transferred: 314 ns, 6 bytes,
              minimum_balance: 318 ns, 6 bytes,
              block_number: 313 ns, 6 bytes,
              now: 325 ns, 6 bytes,
              weight_to_fee: 1 µs, 14 bytes,
              input: 263 ns, 6 bytes,
              input_per_byte: 989 ps, 0 bytes,
              r#return: 0 ps, 45 bytes,
              return_per_byte: 320 ps, 0 bytes,
              terminate: 1 ms, 5266 bytes,
              random: 1 µs, 10 bytes,
              deposit_event: 1 µs, 10 bytes,
              deposit_event_per_topic: 127 µs, 2508 bytes,
              deposit_event_per_byte: 501 ps, 0 bytes,
              debug_message: 226 ns, 7 bytes,
              debug_message_per_byte: 1 ns, 0 bytes,
              set_storage: 131 µs, 293 bytes,
              set_storage_per_new_byte: 576 ps, 0 bytes,
              set_storage_per_old_byte: 184 ps, 1 bytes,
              set_code_hash: 297 µs, 3090 bytes,
              clear_storage: 131 µs, 289 bytes,
              clear_storage_per_byte: 92 ps, 1 bytes,
              contains_storage: 29 µs, 289 bytes,
              contains_storage_per_byte: 213 ps, 1 bytes,
              get_storage: 29 µs, 297 bytes,
              get_storage_per_byte: 980 ps, 1 bytes,
              take_storage: 131 µs, 297 bytes,
              take_storage_per_byte: 921 ps, 1 bytes,
              transfer: 156 µs, 2520 bytes,
              call: 484 µs, 2721 bytes,
              delegate_call: 406 µs, 2637 bytes,
              call_transfer_surcharge: 607 µs, 5227 bytes,
              call_per_cloned_byte: 970 ps, 0 bytes,
              instantiate: 1 ms, 2731 bytes,
              instantiate_transfer_surcharge: 131 µs, 2549 bytes,
              instantiate_per_input_byte: 1 ns, 0 bytes,
              instantiate_per_salt_byte: 1 ns, 0 bytes,
              hash_sha2_256: 377 ns, 8 bytes,
              hash_sha2_256_per_byte: 1 ns, 0 bytes,
              hash_keccak_256: 767 ns, 8 bytes,
              hash_keccak_256_per_byte: 3 ns, 0 bytes,
              hash_blake2_256: 443 ns, 8 bytes,
              hash_blake2_256_per_byte: 1 ns, 0 bytes,
              hash_blake2_128: 440 ns, 8 bytes,
              hash_blake2_128_per_byte: 1 ns, 0 bytes,
              ecdsa_recover: 45 µs, 77 bytes,
              ecdsa_to_eth_address: 11 µs, 42 bytes,
              sr25519_verify: 41 µs, 112 bytes,
              sr25519_verify_per_byte: 5 ns, 1 bytes,
              reentrance_count: 174 ns, 3 bytes,
              account_reentrance_count: 248 ns, 40 bytes,
              instantiation_nonce: 154 ns, 3 bytes,
              add_delegate_dependency: 131 µs, 2606 bytes,
              remove_delegate_dependency: 130 µs, 2568 bytes,
          },
      }
      ###############################################
      Lazy deletion weight per key: Weight(ref_time: 126109302, proof_size: 70)
      Lazy deletion keys per block: 15859
      ```
      5e5341da
    • Liam Aharon's avatar
      Sync Cargo.toml and crates.io versions (#3034) · 3717ec38
      Liam Aharon authored
      
      
      Related https://github.com/paritytech/polkadot-sdk/issues/3032
      
      ---
      
      Using https://github.com/liamaharon/cargo-workspace-version-tools/ 
      
      `cargo run -- sync --path ../polkadot-sdk`
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      3717ec38
  15. Jan 24, 2024
    • Just van Stam's avatar
      Transactional processing for XCM (#1222) · 50eb12cf
      Just van Stam authored
      
      
      Moved from: https://github.com/paritytech/polkadot/pull/6951
      
      closes https://github.com/paritytech/polkadot-sdk/issues/490
      
      - [x] update cumulus
      
      --- 
      This PR introduces transactional processing of certain xcm instructions.
      For the list of instructions checkout
      https://github.com/paritytech/polkadot-sdk/issues/490. The transactional
      processing is implemented as an xcm-executor config item. The two
      implementations in this PR are `FrameTransactionalProcessor` and `()`.
      The `()` implementation does no transactional processing. Each
      implementation of the `ProcessTransaction` trait has an
      `IS_TRANSACTIONAL` const that tells the XCVM if transactional processing
      is actually implemented. If Transactional processing is implemented,
      changes to touched registers should also be rolled back to prevent
      inconsistencies.
      
      
      Note for reviewers:
      Check out the following safety assumption:
      https://github.com/paritytech/polkadot-sdk/pull/1222/files#diff-4effad7d8c1c9de19fd27e18661cbf2128c8718f3b2420a27d2f816e0749ea53R30
      
      ---------
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: command-bot <>
      50eb12cf
  16. Jan 22, 2024
  17. Jan 19, 2024
    • Robin Freyler's avatar
      Update Wasm benchmarks (#2957) · e02c5204
      Robin Freyler authored
      In https://github.com/paritytech/polkadot-sdk/pull/2941 we found out
      that the new Wasmi (register) is very effective at optimizing away
      certain benchmark bytecode constructs in a way that created an unfair
      advantage over Wasmi (stack) which yielded our former benchmarks to be
      ineffective at properly measuring the performance impact.
      
      This PR adjusts both affected benchmarks to fix the stated problems.
      Affected are
      - `instr_i64const` -> `instr_i64add`: Renamed since it now measures the
      performance impact of the Wasm `i64.add` instruction with locals as
      inputs and outputs. This makes it impossible for Wasmi (register) to
      aggressively optimize away the entire function body (as it previously
      did) but still provides a way for Wasmi (register) to shine with its
      register based execution model.
      - `call_with_code_per_byte`: Now uses `local.get` instead of `i32.const`
      for the `if` condition which prevents Wasmi (register) to aggressively
      optimizing away whole parts of the `if` creating an unfair advantage.
      
      cc @athei
      
      
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarIgnacio Palacios <[email protected]>
      e02c5204
    • Oliver Tale-Yazdi's avatar
      Contract fixtures tests: fixe nightly version (#3000) · 2e9b4405
      Oliver Tale-Yazdi authored
      
      
      Using just `nightly` is too generic and can fail on different systems.  
      Now its fixed to the nightly version of the CI.
      
      Another way would be to use a toolchain file, since this already assumes
      `rustup`.
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      2e9b4405
  18. Jan 18, 2024
    • Nazar Mokrynskyi's avatar
      Fix contracts compilation with `CARGO_TARGET_DIR` set (#2927) · b4b523c8
      Nazar Mokrynskyi authored
      In case `CARGO_TARGET_DIR` is set, build artifacts were in the wrong
      place and `build.rs` was failing. With
      `CARGO_TARGET_DIR=/home/nazar-pc/.cache/cargo/target`:
      ```
      error: failed to run custom build command for `pallet-contracts-fixtures v1.0.0 (/web/subspace/polkadot-sdk/substrate/frame/contracts/fixtures)`
      
      Caused by:
        process didn't exit successfully: `/home/nazar-pc/.cache/cargo/target/debug/build/pallet-contracts-fixtures-35d534f7ac3009e0/build-script-build` (exit status: 1)
        --- stderr
        Error: Failed to read "/tmp/.tmpiYwXfv/target/wasm32-unknown-unknown/release/dummy.wasm"
      
        Caused by:
            Can't read from the file: Os { code: 2, kind: NotFound, message: "No such file or directory" }
      ```
      
      The file was actually in
      `/home/nazar-pc/.cache/cargo/target/wasm32-unknown-unknown/release/dummy.wasm`.
      b4b523c8
    • Hero Bird's avatar
      contracts: Update weights (#2969) · f9bbe7db
      Hero Bird authored
      As demanded by @athei to run benchmarks via CI.
      Somehow I was not able to push a PR without commits.
      
      ---------
      
      Co-authored-by: command-bot <>
      f9bbe7db
    • Bastian Köcher's avatar
      pallet-contracts: Fix compilation on latest nightly (#2986) · 0e124a05
      Bastian Köcher authored
      Apparently they changed detection for visibility identifiers on traits,
      which broke more than it should. There is an issue open:
      https://github.com/rust-lang/rust/issues/119924 The easy solution for us
      is to move the declaration of the global variable outside of the trait.
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/2960
      0e124a05
    • Tsvetomir Dimitrov's avatar
      Filter votes from disabled validators in `BackedCandidates` in process_inherent_data (#2889) · f8954093
      Tsvetomir Dimitrov authored
      
      
      Backport of https://github.com/paritytech/polkadot-sdk/pull/1863 to
      master
      
      Extend candidate sanitation in paras_inherent by removing backing votes
      from disabled validators. Check
      https://github.com/paritytech/polkadot-sdk/issues/1592 for more details.
      
      This change is related to the disabling strategy implementation
      (https://github.com/paritytech/polkadot-sdk/pull/2226).
      
      ---------
      
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarMaciej <[email protected]>
      f8954093
  19. Jan 17, 2024
  20. 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
    • 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
  21. Jan 15, 2024
  22. Jan 12, 2024
  23. Jan 09, 2024
  24. Jan 08, 2024
  25. Jan 07, 2024
    • Bastian Köcher's avatar
      pallet-contracts-fixtures: Only build RISCV when the feature is enabled (#2870) · 745c02c5
      Bastian Köcher authored
      This disables building the RISCV fixtures by default. They still require
      a custom build rustc version. When there are actual tests for RISCV, the
      feature can be enabled in CI. Also fixes some unwraps that assume again
      that people are using rustup...
      745c02c5
    • 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
  26. Jan 04, 2024
  27. Dec 28, 2023