Skip to content
Snippets Groups Projects
  1. Mar 14, 2025
  2. Mar 12, 2025
  3. Mar 10, 2025
  4. Mar 07, 2025
  5. Mar 06, 2025
  6. Mar 05, 2025
    • Bastian Köcher's avatar
      pallet-scheduler: Put back postponed tasks into the agenda (#7790) · 00d8eea8
      Bastian Köcher authored
      
      Right now `pallet-scheduler` is not putting back postponed tasks into
      the agenda when the early weight check is failing. This pull request
      ensures that these tasks are put back into the agenda and are not just
      "lost".
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarGuillaume Thiolliere <gui.thiolliere@gmail.com>
      Co-authored-by: default avatarAlexandre R. Baldé <alexandre.balde@parity.io>
      00d8eea8
    • Alexander Samusev's avatar
      ci: update credentials for command-backport (#7798) · 945e5fe8
      Alexander Samusev authored
      close https://github.com/paritytech/ci_cd/issues/1114
      945e5fe8
    • Nathaniel Bajo's avatar
      [XCM] add generic location to account converter that also works with external ecosystems (#7313) · 1dbaeba9
      Nathaniel Bajo authored
      
      I added a new `ExternalConsensusLocationsConverterFor` struct to handle
      external global consensus locations and their child locations.
      This struct extends the functionality of existing converters
      (`GlobalConsensusParachainConvertsFor` and
      `EthereumLocationsConverterFor`) while maintaining backward
      compatibility.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/7129
      
      Polkadot address: 121HJWZtD13GJQPD82oEj3gSeHqsRYm1mFgRALu4L96kfPD1
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <adrian@parity.io>
      Co-authored-by: default avatarndk <ndk@parity.io>
      1dbaeba9
    • Oliver Tale-Yazdi's avatar
      [AHM] Make more stuff public (#7802) · a814f557
      Oliver Tale-Yazdi authored
      
      Make some more stuff public that will be useful for AHM to reduce code
      duplication.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      a814f557
    • Dmitry Markin's avatar
      Support adding extra request-response protocols to the node (#7708) · 9a8061e6
      Dmitry Markin authored
      
      Allow adding extra request-response protocols during polkadot service
      initialization. This is required to add a request-response protocol
      described in
      [RFC-0008](https://polkadot-fellows.github.io/RFCs/approved/0008-parachain-bootnodes-dht.html)
      to the relay chain side of the parachain node.
      
      ### Review notes
      The PR might look scary due to a lot of code being moved. It is easier
      to review it on a per-commit basis. The commits do not containing
      changes to the code logic are named accordingly.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      9a8061e6
    • Alexandru Vasile's avatar
      notifications/tests: Fix tests to avoid overflow on adding duration to instant (#7793) · 7db67f3b
      Alexandru Vasile authored
      
      The tokio instant timer produced an overflow when the `poll_tick` was
      called because the timer period was set to `u64::max`. The period is
      reduced to accommodate for the following tokio time addition:
      
      
      Source code
      [tokio/time/interval.rs](https://github.com/tokio-rs/tokio/blob/a2b12bd5799f06e912b32ac05a5ffb5cf1fe31cd/tokio/src/time/interval.rs#L478-L485):
      ```rust
              let next = if now > timeout + Duration::from_millis(5) {
                  self.missed_tick_behavior
                      .next_timeout(timeout, now, self.period)
              } else {
                  timeout
                      .checked_add(self.period)
                      .unwrap_or_else(Instant::far_future)
              };
      ```
      
      
      Detected by:
      https://github.com/paritytech/polkadot-sdk/actions/runs/13648141251/job/38150825582?pr=7790
      
      
      ```
      ──── TRY 1 STDERR:       sc-network protocol::notifications::tests::conformance::litep2p_disconnects_libp2p_substream
      thread 'protocol::notifications::tests::conformance::litep2p_disconnects_libp2p_substream' panicked at std/src/time.rs:417:33:
      overflow when adding duration to instant
      stack backtrace:
         0: rust_begin_unwind
         1: core::panicking::panic_fmt
         2: core::option::expect_failed
         3: <std::time::Instant as core::ops::arith::Add<core::time::Duration>>::add
         4: tokio::time::interval::Interval::poll_tick
         5: sc_network::protocol::notifications::tests::conformance::litep2p_disconnects_libp2p_substream::{{closure}}
         6: tokio::runtime::scheduler::current_thread::Context::enter
         7: tokio::runtime::context::scoped::Scoped<T>::set
         8: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
         9: tokio::runtime::runtime::Runtime::block_on
        10: sc_network::protocol::notifications::tests::conformance::litep2p_disconnects_libp2p_substream
        11: core::ops::function::FnOnce::call_once
      ```
      
      cc @paritytech/networking
      
      Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
      7db67f3b
    • Oliver Tale-Yazdi's avatar
      pallet revive: rpc build script should not panic (#7786) · 9100d249
      Oliver Tale-Yazdi authored
      
      This can error when you use `cargo remote` and probably also with `cargo
      vendor`.
      Still seeing two more build errors, but at least this one is fixed.
      
      Other one:
      ```pre
      error: set `DATABASE_URL` to use query macros online, or run `cargo sqlx prepare` to update the query cache
         --> substrate/frame/revive/rpc/src/receipt_provider/db.rs:123:17
          |
      123 |               let result = query!(
          |  __________________________^
      124 | |                 r#"
      125 | |                 INSERT OR REPLACE INTO transaction_hashes (transaction_hash, block_hash, transaction_index)
      126 | |                 VALUES ($1, $2, $3)
      ...   |
      130 | |                 transaction_index
      131 | |             )
      ```
      
      and (maybe Rust version related, this is 1.84.1)
      ```pre
      error[E0282]: type annotations needed
         --> substrate/frame/revive/rpc/src/receipt_provider/db.rs:102:34
          |
      102 |         let (tx_result, logs_result) = tokio::join!(delete_transaction_hashes, delete_logs);
          |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
          |
          = note: this error originates in the macro `$crate::join` which comes from the expansion of the macro `tokio::join` (in Nightly builds, run with -Z macro-backtrace for more info)
      ```
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      9100d249
    • huntbounty's avatar
      pallet-bridge-relayers - migrate benchmarks to v2 (#7531) · 22879e13
      huntbounty authored
      resolves #7491
      22879e13
  7. Mar 04, 2025
  8. Mar 03, 2025
    • polka.dom's avatar
      Add Serialize & Deserialize to umbrella crate derive module (#7764) · 9d9ae348
      polka.dom authored
      
      When working with storage types that are to be set in the genesis block,
      deriving serde::Serialize & serde::Deserialize is necessary (to my
      knowledge). This PR introduces Serialize and Deserialize into the
      umbrella crate derive (and indirectly prelude) module, allowing for
      similar access as the other storage value derives.
      
      ---------
      
      Co-authored-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      9d9ae348
    • clangenb's avatar
      [kitchensink] migrate to use genesis presets (#7741) · f9707b72
      clangenb authored
      
      Last subtask from
      https://github.com/paritytech/polkadot-sdk/issues/5704.
      
      Closes #5704.
      
      The substrate-node is not 100% free of the native runtime yet, but the
      code has become less convoluted and better documented. The final cleanup
      needs https://github.com/paritytech/polkadot-sdk/issues/7748.
      
      ---------
      
      Co-authored-by: default avatarMichal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
      f9707b72
    • Andrei Eres's avatar
      Fix unspecified Hash in NodeBlock (#7756) · df99fb94
      Andrei Eres authored
      # Description
      
      Working with https://github.com/paritytech/polkadot-sdk/pull/7556 I
      encountered an internal compiler error on polkadot-omni-node-lib: see
      bellow or [in
      CI](https://github.com/paritytech/polkadot-sdk/actions/runs/13521547633/job/37781894640).
      
      ```
      error: internal compiler error: compiler/rustc_traits/src/codegen.rs:45:13: Encountered error `SignatureMismatch(SignatureMismatchData { found_trait_ref: <{closure@sp_state_machine::trie_backend_essence::TrieBackendEssence<sc_service::Arc<dyn sp_state_machine::trie_backend_essence::Storage<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>, <<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing, sp_trie::cache::LocalTrieCache<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>, sp_trie::recorder::Recorder<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>::storage::{closure#1}} as std::ops::FnOnce<(std::option::Option<&mut dyn trie_db::TrieRecorder<sp_core::H256>>, std::option::Option<&mut dyn trie_db::TrieCache<sp_trie::node_codec::NodeCodec<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>>)>>, expected_trait_ref: <{closure@sp_state_machine::trie_backend_essence::TrieBackendEssence<sc_service::Arc<dyn sp_state_machine::trie_backend_essence::Storage<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>, <<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing, sp_trie::cache::LocalTrieCache<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>, sp_trie::recorder::Recorder<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>::storage::{closure#1}} as std::ops::FnOnce<(std::option::Option<&mut dyn trie_db::TrieRecorder<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hash>>, std::option::Option<&mut dyn trie_db::TrieCache<sp_trie::node_codec::NodeCodec<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>>)>>, terr: Sorts(ExpectedFound { expected: Alias(Projection, AliasTy { args: [Alias(Projection, AliasTy { args: [Alias(Projection, AliasTy { args: [NodeSpec/#0], def_id: DefId(0:410 ~ polkadot_omni_node_lib[7cce]::common::spec::BaseNodeSpec::Block), .. })], def_id: DefId(0:507 ~ polkadot_omni_node_lib[7cce]::common::NodeBlock::BoundedHeader), .. })], def_id: DefId(229:1706 ~ sp_runtime[5da1]::traits::Header::Hash), .. }), found: sp_core::H256 }) })` selecting `<{closure@sp_state_machine::trie_backend_essence::TrieBackendEssence<sc_service::Arc<dyn sp_state_machine::trie_backend_essence::Storage<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>, <<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing, sp_trie::cache::LocalTrieCache<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>, sp_trie::recorder::Recorder<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>::storage::{closure#1}} as std::ops::FnOnce<(std::option::Option<&mut dyn trie_db::TrieRecorder<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hash>>, std::option::Option<&mut dyn trie_db::TrieCache<sp_trie::node_codec::NodeCodec<<<<NodeSpec as common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader as sp_runtime::traits::Header>::Hashing>>>)>>` during codegen
      ```
      
      Trying to parse the error I found that TrieRecorder was not supposed to
      work with H256:
      - Expected: `&mut dyn TrieRecorder<<<<NodeSpec as
      common::spec::BaseNodeSpec>::Block as common::NodeBlock>::BoundedHeader
      as Header>::Hash>>`
      - Found: `&mut dyn TrieRecorder<sp_core::H256>>`
      
      The error happened because I added to
      `new_full_parts_with_genesis_builder` interaction with Trie Cache which
      eventually uses `TrieRecorder<H256>`. Here is the path:
      - In polkadot-omni-node-lib trait BaseNodeSpec defined with Block as
      `NodeBlock: BlockT<Hash = DbHash>`, where DbHash is H256.
      - BaseNodeSpec calls [new_full_parts_record_import::<Self::Block, …
      >](https://github.com/paritytech/polkadot-sdk/blob/75726c65/cumulus/polkadot-omni-node/lib/src/common/spec.rs#L184-L189)
      and eventually it goes to
      [new_full_parts_with_genesis_builder](https://github.com/paritytech/polkadot-sdk/blob/08b30246
      
      /substrate/client/service/src/builder.rs#L195).
      - In `new_full_parts_with_genesis_builder` we accessed storage,
      initiating TrieRecorder with H256 what never happened before.
      
      I believe the compiler found a mismatch checking types for TrieRecorder:
      NodeBlock inherits from the trait `Block<Hash = DbHash>`, but it uses
      BoundedHeader, which inherits from the trait Header with the default
      Hash.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      df99fb94
    • Alexander Theißen's avatar
      revive: Rework the instruction benchmark (#7721) · 4b39ff00
      Alexander Theißen authored
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/6157
      
      This fixes the last remaining benchmark that was not correct since it
      was too low level to be written in Rust. Instead, we opted.
      
      This PR changes the benchmark that determines the scaling from
      `ref_time` to PolkaVM `Gas` by benchmarking the absolute worst case of
      an instruction: One that causes two cache misses by touching two cache
      lines.
      
      The Contract itself is designed to be as simple as possible. It does
      random unaligned reads in a loop until the `r` (repetition) number is
      reached. The randomness is fully generated by the host and written to
      the guests memory before the benchmark is run. This allows the benchmark
      to determine the influence of one loop iteration via linear regression.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarxermicus <cyrill@parity.io>
      Co-authored-by: default avatarPG Herveou <pgherveou@gmail.com>
      4b39ff00