1. Apr 12, 2024
  2. Apr 11, 2024
  3. Apr 10, 2024
    • PG Herveou's avatar
      Contracts: Remove ED from base deposit (#3536) · 643aa2be
      PG Herveou authored
      - Update internal logic so that the storage_base_deposit does not
      include ED
      - add v16 migration to update ContractInfo struct with this change
      
      Before:
      <img width="820" alt="Screenshot 2024-03-21 at 11 23 29"
      src="https://github.com/paritytech/polkadot-sdk/assets/521091/a0a8df0d-e743-42c5-9e16-cf2ec1aa949c">
      
      After:
      ![Screenshot 2024-03-21 at 11 23
      42](https://github.com/paritytech/polkadot-sdk/assets/521091/593235b0-b866-4915-b653-2071d793228b
      
      )
      
      ---------
      
      Co-authored-by: default avatarCyrill Leutwiler <[email protected]>
      Co-authored-by: command-bot <>
      643aa2be
    • Milos Kriz's avatar
      Amend chainspecs for `people-westend` and add IBP bootnodes (#4072) · d21a41f2
      Milos Kriz authored
      Dear team, dear @NachoPal @joepetrowski @bkchr @ggwpez
      
      ,
      
      This is a retry of #3957, after merging master as advised!,
      
      Many thanks!
      
      **_Milos_**
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      d21a41f2
    • PG Herveou's avatar
      Contracts: Reuse module when validating (#3789) · 1da8d12d
      PG Herveou authored
      Reuse wasmi Module when validating.
      Prepare the code for 0.32 and the addition of Module::new_unchecked
      1da8d12d
    • Alexandru Vasile's avatar
      net/strategy: Log bad peerId from on_validated_block_announce (#4051) · cd010925
      Alexandru Vasile authored
      This tiny PR extends the `on_validated_block_announce` log with the bad
      PeerID.
      Used to identify if the peerID is malicious by correlating with other
      logs (ie peer-set).
      
      While at it, have removed the `\n` from a multiline log, which did not
      play well with
      [sub-triage-logs](https://github.com/lexnv/sub-triage-logs/tree/master
      
      ).
      
      cc @paritytech/networking
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      cd010925
    • PG Herveou's avatar
      Contracts: Only exec parsed code in benchmarks (#3915) · 0d71753e
      PG Herveou authored
      [Weights
      compare](https://weights.tasty.limo/compare?unit=weight&ignore_errors=true&threshold=10&method=asymptotic&repo=polkadot-sdk&old=master&new=pg%2Fbench_tweaks&path_pattern=substrate%2Fframe%2F**%2Fsrc%2Fweights.rs%2Cpolkadot%2Fruntime%2F*%2Fsrc%2Fweights%2F**%2F*.rs%2Cpolkadot%2Fbridges%2Fmodules%2F*%2Fsrc%2Fweights.rs%2Ccumulus%2F**%2Fweights%2F*.rs%2Ccumulus%2F**%2Fweights%2Fxcm%2F*.rs%2Ccumulus%2F**%2Fsrc%2Fweights.rs)
      
      Note: Raw weights change does not mean much here, as this PR reduce the
      scope of what is benchmarked, they are therefore decreased by a good
      margin. One should instead print the Schedule using
      
      cargo test --features runtime-benchmarks bench_print_schedule --
      --nocapture
      or following the instructions from the
      [README](https://github.com/paritytech/polkadot-sdk/tree/pg/bench_tweaks/substrate/frame/contracts#schedule)
      for looking at the Schedule of a specific runtime
      
      ---------
      
      Co-authored-by: command-bot <>
      0d71753e
    • Matteo Muraca's avatar
      Removed `pallet::getter` usage from Polkadot Runtime pallets (#3660) · 92e14255
      Matteo Muraca authored
      Part of #3326 
      
      @Kianenigma @ggwpez
      
       
      
      polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp
      
      ---------
      
      Signed-off-by: default avatarMatteo Muraca <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      92e14255
    • Bulat Saifullin's avatar
      Convert chainspec to raw (#4057) · d96a9752
      Bulat Saifullin authored
      The plain `people-kusama` and `coretime-kusama` chainspecs were uploaded
      at https://github.com/paritytech/polkadot-sdk/pull/3961. Only binaries
      with compatible runtime versions can run with plain chainspec. For
      example:
      
      One of the latest master builds fails:
      
      ```
      docker run paritypr/polkadot-parachain-debug:master-216509db --chain coretime-kusama
      ...
      Error: Service(Client(Storage("wasm call error Other: Exported method GenesisBuilder_get_preset is not found"))
      ```
      
      Master build from 5 days ago:
      
      ```
      docker run paritypr/polkadot-parachain-debug:master-68cdb126 --chain coretime-kusama
      ...
      2024-04-08 16:51:02 [Parachain] 🔨 Initializing Genesis block/state (state: 0xc418…889c, header-hash: 0x638c…d050)
      2024-04-08 16:51:03 [Relaychain] 🔨 Initializing Genesis block/state (state: 0xb000…ef6b, header-hash: 0xb0a8…dafe)
      2024-04-08 16:51:03 [Relaychain] 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
      2024-04-08 16:51:03 [Relaychain] 👶 Creating empty BABE epoch changes on what appears to be first startup.
      2024-04-08 16:51:03 [Relaychain] 🏷 Local node identity is: 12D3KooWQEp2uPow3FnngGmy9dYQ3qxY1GkmumS5MqBWEQscwTyy
      2024-04-08 16:51:03 [Relaychain] 📦 Highest known block at #0
      ...
      ```
      
      ## Changes:
      
      1. Rename:
      ```
      coretime-kusama.json -> coretime-kusama-genesis.json
      people-kusama.json -> people-kusama-genesis.json
      ```
      
      2. Generate raw chainspec:
      
      ```
      docker run --rm -v $(pwd):/dir paritypr/polkadot-parachain-debug:master-68cdb126 build-spec --raw --chain /dir/people-kusama-genesis.json > people-kusama.json 
      docker run --rm -v $(pwd):/dir paritypr/polkadot-parachain-debug:master-68cdb126 build-spec --raw --chain /dir/coretime-kusama-genesis.json > coretime-kusama.json
      ```
      
      ## Tests:
      
      New chainspec can run on the latest master build:
      
      ```
      docker run -it --rm -v $(pwd):/dir paritypr/polkadot-parachain-debug:master-216509db --chain /dir/coretime-kusama.json
      ...
      2024-04-09 16:44:39 [Relaychain] ️ Syncing, target=#22665488 (8 peers), best: #2371 (0x19f8…5f3a), finalized #2048 (0xede6…f879),  388.6kiB/s  87.0kiB/s
      2024-04-09 16:44:39 [Parachain] 💤 Idle (6 peers), best: #0 (0x638c…d050), finalized #0 (0x638c…d050),  6.3kiB/s  2.8kiB/s
      ```
      
      Plain chainspec will fail:
      
      ```
      docker run -it --rm -v $(pwd):/dir paritypr/polkadot-parachain-debug:master-216509db --chain /dir/coretime-kusama-genesis.json
      ... 
      Error: Service(Client(Storage("wasm call error Other: Exported method GenesisBuilder_get_preset is not found")))
      ```
      d96a9752
    • Serban Iorga's avatar
      Reapply lost changes · b8956fe1
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      b8956fe1
    • Serban Iorga's avatar
      Fix chain_spec_as_json_fails_with_invalid_config · fb84c461
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      fb84c461
    • Serban Iorga's avatar
      Leftovers · a230a377
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      a230a377
    • Serban Iorga's avatar
      diener workspacify · 4ad46c81
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      4ad46c81
    • Serban Iorga's avatar
      Backport changes from polakdot-sdk (#2920) · 6be88982
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      * Migrate fee payment from `Currency` to `fungible` (#2292)
      
      Part of https://github.com/paritytech/polkadot-sdk/issues/226
      Related https://github.com/paritytech/polkadot-sdk/issues/1833
      
      - Deprecate `CurrencyAdapter` and introduce `FungibleAdapter`
      - Deprecate `ToStakingPot` and replace usage with `ResolveTo`
      - Required creating a new `StakingPotAccountId` struct that implements
      `TypedGet` for the staking pot account ID
      - Update parachain common utils `DealWithFees`, `ToAuthor` and
      `AssetsToBlockAuthor` implementations to use `fungible`
      - Update runtime XCM Weight Traders to use `ResolveTo` instead of
      `ToStakingPot`
      - Update runtime Transaction Payment pallets to use `FungibleAdapter`
      instead of `CurrencyAdapter`
      - [x] Blocked by https://github.com/paritytech/polkadot-sdk/pull/1296,
      needs the `Unbalanced::decrease_balance` fix
      
      (cherry picked from commit bda4e75a
      
      )
      
      * Upgrade `trie-db` from `0.28.0` to `0.29.0` (#3982)
      
      - What does this PR do?
      1. Upgrades `trie-db`'s version to the latest release. This release
      includes, among others, an implementation of `DoubleEndedIterator` for
      the `TrieDB` struct, allowing to iterate both backwards and forwards
      within the leaves of a trie.
      2. Upgrades `trie-bench` to `0.39.0` for compatibility.
      3. Upgrades `criterion` to `0.5.1` for compatibility.
      - Why are these changes needed?
      Besides keeping up with the upgrade of `trie-db`, this specifically adds
      the functionality of iterating back on the leafs of a trie, with
      `sp-trie`. In a project we're currently working on, this comes very
      handy to verify a Merkle proof that is the response to a challenge. The
      challenge is a random hash that (most likely) will not be an existing
      leaf in the trie. So the challenged user, has to provide a Merkle proof
      of the previous and next existing leafs in the trie, that surround the
      random challenged hash.
      
      Without having DoubleEnded iterators, we're forced to iterate until we
      find the first existing leaf, like so:
      ```rust
              // ************* VERIFIER (RUNTIME) *************
              // Verify proof. This generates a partial trie based on the proof and
              // checks that the root hash matches the `expected_root`.
              let (memdb, root) = proof.to_memory_db(Some(&root)).unwrap();
              let trie = TrieDBBuilder::<LayoutV1<RefHasher>>::new(&memdb, &root).build();
      
              // Print all leaf node keys and values.
              println!("\nPrinting leaf nodes of partial tree...");
              for key in trie.key_iter().unwrap() {
                  if key.is_ok() {
                      println!("Leaf node key: {:?}", key.clone().unwrap());
      
                      let val = trie.get(&key.unwrap());
      
                      if val.is_ok() {
                          println!("Leaf node value: {:?}", val.unwrap());
                      } else {
                          println!("Leaf node value: None");
                      }
                  }
              }
      
              println!("RECONSTRUCTED TRIE {:#?}", trie);
      
              // Create an iterator over the leaf nodes.
              let mut iter = trie.iter().unwrap();
      
              // First element with a value should be the previous existing leaf to the challenged hash.
              let mut prev_key = None;
              for element in &mut iter {
                  if element.is_ok() {
                      let (key, _) = element.unwrap();
                      prev_key = Some(key);
                      break;
                  }
              }
              assert!(prev_key.is_some());
      
              // Since hashes are `Vec<u8>` ordered in big-endian, we can compare them directly.
              assert!(prev_key.unwrap() <= challenge_hash.to_vec());
      
              // The next element should exist (meaning there is no other existing leaf between the
              // previous and next leaf) and it should be greater than the challenged hash.
              let next_key = iter.next().unwrap().unwrap().0;
              assert!(next_key >= challenge_hash.to_vec());
      ```
      
      With DoubleEnded iterators, we can avoid that, like this:
      ```rust
              // ************* VERIFIER (RUNTIME) *************
              // Verify proof. This generates a partial trie based on the proof and
              // checks that the root hash matches the `expected_root`.
              let (memdb, root) = proof.to_memory_db(Some(&root)).unwrap();
              let trie = TrieDBBuilder::<LayoutV1<RefHasher>>::new(&memdb, &root).build();
      
              // Print all leaf node keys and values.
              println!("\nPrinting leaf nodes of partial tree...");
              for key in trie.key_iter().unwrap() {
                  if key.is_ok() {
                      println!("Leaf node key: {:?}", key.clone().unwrap());
      
                      let val = trie.get(&key.unwrap());
      
                      if val.is_ok() {
                          println!("Leaf node value: {:?}", val.unwrap());
                      } else {
                          println!("Leaf node value: None");
                      }
                  }
              }
      
              // println!("RECONSTRUCTED TRIE {:#?}", trie);
              println!("\nChallenged key: {:?}", challenge_hash);
      
              // Create an iterator over the leaf nodes.
              let mut double_ended_iter = trie.into_double_ended_iter().unwrap();
      
              // First element with a value should be the previous existing leaf to the challenged hash.
              double_ended_iter.seek(&challenge_hash.to_vec()).unwrap();
              let next_key = double_ended_iter.next_back().unwrap().unwrap().0;
              let prev_key = double_ended_iter.next_back().unwrap().unwrap().0;
      
              // Since hashes are `Vec<u8>` ordered in big-endian, we can compare them directly.
              println!("Prev key: {:?}", prev_key);
              assert!(prev_key <= challenge_hash.to_vec());
      
              println!("Next key: {:?}", next_key);
              assert!(next_key >= challenge_hash.to_vec());
      ```
      - How were these changes implemented and what do they affect?
      All that is needed for this functionality to be exposed is changing the
      version number of `trie-db` in all the `Cargo.toml`s applicable, and
      re-exporting some additional structs from `trie-db` in `sp-trie`.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      (cherry picked from commit 4e73c0fc
      
      )
      
      * Update polkadot-sdk refs
      
      * Fix Cargo.lock
      
      ---------
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarFacundo Farall <[email protected]>
      6be88982
    • Serban Iorga's avatar
      ckb-merkle-mountain-range -> 0.5.2 (#2911) · 3f1a9279
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      3f1a9279
    • Serban Iorga's avatar
      Address migration comments (#2910) · 8f26000e
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      * Use workspace.[authors|edition]
      
      * Add repository.workspace = true
      
      * Upgrade dependencies to the polkadot-sdk versions
      
      * Upgrade async-std version
      
      * Update jsonrpsee version
      
      * cargo update
      
      * use ci-unified image
      8f26000e
    • Svyatoslav Nikolsky's avatar
      Some relayer improvments (#2902) · 018d6d8d
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      * added CLI arguments: full WS URI + separate for WS path URI component + additional log
      
      * URI -> URL?
      
      * added TODO
      
      * fmt
      018d6d8d
    • dependabot[bot]'s avatar
      Bump tokio from 1.36.0 to 1.37.0 · 30a03387
      dependabot[bot] authored and Bastian Köcher's avatar Bastian Köcher committed
      Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.36.0 to 1.37.0.
      - [Release notes](https://github.com/tokio-rs/tokio/releases)
      - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.36.0...tokio-1.37.0
      
      )
      
      ---
      updated-dependencies:
      - dependency-name: tokio
        dependency-type: direct:production
        update-type: version-update:semver-minor
      ...
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      30a03387
    • dependabot[bot]'s avatar
      Bump scale-info from 2.11.0 to 2.11.1 · e489f5f5
      dependabot[bot] authored and Bastian Köcher's avatar Bastian Köcher committed
      Bumps [scale-info](https://github.com/paritytech/scale-info) from 2.11.0 to 2.11.1.
      - [Release notes](https://github.com/paritytech/scale-info/releases)
      - [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md)
      - [Commits](https://github.com/paritytech/scale-info/compare/v2.11.0...v2.11.1
      
      )
      
      ---
      updated-dependencies:
      - dependency-name: scale-info
        dependency-type: direct:production
        update-type: version-update:semver-patch
      ...
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      e489f5f5
    • Serban Iorga's avatar
      Fix polkadot-sdk CI failures (#2901) · de37ffd5
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      * taplo
      
      * markdown
      
      * publish = false
      
      * feature propagation
      de37ffd5
    • Serban Iorga's avatar
      Leftover (#2900) · aeb34383
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      aeb34383
    • Serban Iorga's avatar
      Backport changes from polkadot-sdk (#2899) · 1dba7e05
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      * Fix spelling mistakes across the whole repository (#3808)
      
      **Update:** Pushed additional changes based on the review comments.
      
      **This pull request fixes various spelling mistakes in this
      repository.**
      
      Most of the changes are contained in the first **3** commits:
      
      - `Fix spelling mistakes in comments and docs`
      
      - `Fix spelling mistakes in test names`
      
      - `Fix spelling mistakes in error messages, panic messages, logs and
      tracing`
      
      Other source code spelling mistakes are separated into individual
      commits for easier reviewing:
      
      - `Fix the spelling of 'authority'`
      
      - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
      
      - `Fix the spelling of 'prev_enqueud_messages'`
      
      - `Fix the spelling of 'endpoint'`
      
      - `Fix the spelling of 'children'`
      
      - `Fix the spelling of 'PenpalSiblingSovereignAccount'`
      
      - `Fix the spelling of 'PenpalSudoAccount'`
      
      - `Fix the spelling of 'insufficient'`
      
      - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
      
      - `Fix the spelling of 'subtracted'`
      
      - `Fix the spelling of 'CandidatePendingAvailability'`
      
      - `Fix the spelling of 'exclusive'`
      
      - `Fix the spelling of 'until'`
      
      - `Fix the spelling of 'discriminator'`
      
      - `Fix the spelling of 'nonexistent'`
      
      - `Fix the spelling of 'subsystem'`
      
      - `Fix the spelling of 'indices'`
      
      - `Fix the spelling of 'committed'`
      
      - `Fix the spelling of 'topology'`
      
      - `Fix the spelling of 'response'`
      
      - `Fix the spelling of 'beneficiary'`
      
      - `Fix the spelling of 'formatted'`
      
      - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
      
      - `Fix the spelling of 'succeeded'`
      
      - `Fix the spelling of 'reopened'`
      
      - `Fix the spelling of 'proposer'`
      
      - `Fix the spelling of 'InstantiationNonce'`
      
      - `Fix the spelling of 'depositor'`
      
      - `Fix the spelling of 'expiration'`
      
      - `Fix the spelling of 'phantom'`
      
      - `Fix the spelling of 'AggregatedKeyValue'`
      
      - `Fix the spelling of 'randomness'`
      
      - `Fix the spelling of 'defendant'`
      
      - `Fix the spelling of 'AquaticMammal'`
      
      - `Fix the spelling of 'transactions'`
      
      - `Fix the spelling of 'PassingTracingSubscriber'`
      
      - `Fix the spelling of 'TxSignaturePayload'`
      
      - `Fix the spelling of 'versioning'`
      
      - `Fix the spelling of 'descendant'`
      
      - `Fix the spelling of 'overridden'`
      
      - `Fix the spelling of 'network'`
      
      Let me know if this structure is adequate.
      
      **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
      `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
      as it is.
      
      ~~**Note:** In some places the term `Receival` is used to refer to
      message reception, IMO `Reception` is the correct word here, but I left
      it as it is.~~
      
      ~~**Note:** In some places the term `Overlayed` is used instead of the
      more acceptable version `Overlaid` but I also left it as it is.~~
      
      ~~**Note:** In some places the term `Applyable` is used instead of the
      correct version `Applicable` but I also left it as it is.~~
      
      **Note:** Some usage of British vs American english e.g. `judgement` vs
      `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
      are both present in different places, but I suppose that's
      understandable given the number of contributors.
      
      ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
      triggers errors in CI when I make changes to it, so I left it as it
      is.~~
      
      (cherry picked from commit 002d9260
      
      )
      
      * Fix
      
      ---------
      
      Co-authored-by: default avatarDcompoze <[email protected]>
      1dba7e05
    • Serban Iorga's avatar
      Remove test dependecies on specific relay clients (#2898) · f6e48f65
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      f6e48f65
    • Serban Iorga's avatar
      polkadot-sdk backport leftovers (#2896) · 4aa9594d
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      4aa9594d
    • Svyatoslav Nikolsky's avatar
      relayer waits until chain spec version matches the configured in Client... · cc22d231
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      relayer waits until chain spec version matches the configured in Client constructor/reconnect (#2894)
      
      cc22d231
    • Serban Iorga's avatar
      Move relay clients to separate folder (#2893) · 449ea7b5
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      449ea7b5