Skip to content
Snippets Groups Projects
  1. Mar 11, 2025
    • Serban Iorga's avatar
      Fix XCM decoding inconsistencies (#7856) · 2a239206
      Serban Iorga authored
      This PR includes:
      
      - deduplicating some XCM decoding logic
      - making use of `decode_with_depth_limit` consistently for
      `VersionedXcm`
      - some cleanup
    • Sebastian Kunert's avatar
      slot-based-collator: Allow multiple blocks per slot (#7569) · 8ddb0714
      Sebastian Kunert authored
      **Summary:** This PR enables authoring of multiple blocks in one AURA
      slot in the slot-based collator and stabilizes the slot-based collator.
      
      ## CLI Changes
      The flag `--experimental-use-slot-based` is now marked as deprecated. I
      opted to introduce `--authoring slot-based` instead of just removing the
      `experimental` prefix. By introducing the `authoring` variant, we get
      some future-proofing in case we want to introduce further options.
      
      ## Change Description
      With elastic-scaling, we are able to author multiple blocks with a
      single relay-chain parent. In the initial iteration, the interval
      between two blocks was determined by the `slot_duration` of the
      parachain. This PR introduces a more flexible model, where we try to
      author multiple blocks in a single slot if the runtime allows it.
      
      The block authoring loop is largely the same. The
      [`SlotTimer`](https://github.com/paritytech/polkadot-sdk/blob/f1935bd9/cumulus/cli...
  2. Mar 10, 2025
  3. Mar 07, 2025
    • girazoki's avatar
      Make pallet-transaction-payment-benchmark work with ed 0 (#7820) · 6b980646
      girazoki authored
      # Description
      
      Chains like moonbeam work with an ED deposit of 0 (insecure-ed-0) which
      is unsable with the current pallet-transaction-payment benchmark. This
      PR adds an if-else case in case the existential deposit found is 0.
    • Alexandru Gheorghe's avatar
      Bump trie-db to latest version (#7847) · d532437a
      Alexandru Gheorghe authored
      
      Bumping trie-db to latest version to pick up
      https://github.com/paritytech/trie/pull/216
      
      Signed-off-by: default avatarAlexandru Gheorghe <alexandru.gheorghe@parity.io>
    • PG Herveou's avatar
      [revive-rpc] allow using legacy data field (#7827) · 725816f1
      PG Herveou authored
      Allow using the legacy data field for GenericTransaction
    • Michal Kucharczyk's avatar
      `fatxpool`: improved handling of finality stalls (#7639) · 24a4b55e
      Michal Kucharczyk authored
      #### PR Description
      
      This pull request introduces measures to handle finality stalls by :
      - notifying outdated transactions with a
      [`FinalityTimeout`](https://github.com/paritytech/polkadot-sdk/blob/d821c84d/substrate/client/transaction-pool/api/src/lib.rs#L145-L147)
      event.
      - removing outdated views from the `view_store`
      
      An item is considered _outdated_ when the difference between its
      associated block and the current block exceeds a pre-defined threshold.
      
      #### Note for Reviewers
      The core logic is provided in the following small commits:
      - `ViewStore`: new method
      [`finality_stall_view_cleanup`](https://github.com/paritytech/polkadot-sdk/blob/d821c84d/substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs#L869-L903)
      for removing stale views was added: 64267000
      - `ForkAwareTransactionPool`: core logic for tracking finality stalls
      added here: 7b37ea6f. Entry point in
      [`finality_stall_cleanup`](https://github.com/paritytech/polkadot-sdk/blob/d821c84d/substrate/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs#L1096-L1136)
      - Some related renaming was made to better reflect purpose/shorten the
      names: 1a3a1284, a511601f. Also new method
      [`transactions_finality_timeout`](https://github.com/paritytech/polkadot-sdk/blob/a511601f/substrate/client/transaction-pool/src/fork_aware_txpool/multi_view_listener.rs#L771-L790)
      for triggering external events was added for `MultiViewListener`.
      - `included_transactions` which basically is mapping `block hash ->
      included transactions hashes`, is also used to find to included
      transactions.
      
      I also sneaked in some minor improvements:
      - fixed per-transaction logging: 1572f721
      - `handle_pre_finalized` method was removed, it was some old leftover
      which is no longer needed: a6f84ad0
      
      ,
      
      closes: #5482
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      Co-authored-by: default avatarSebastian Kunert <skunert49@gmail.com>
      Co-authored-by: default avatarIulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
    • Iulian Barbu's avatar
      `fatxpool`: add heavy load tests based on zombienet (#7257) · ff2e5091
      Iulian Barbu authored
      # Description
      
      Builds up towards addressing #5497 by creating some zombienet-sdk code
      infra that can be used to spin regular networks, as described in the
      fork aware transaction pool testing setup added here #7100. It will be
      used for developing tests against such networks, and to also spawn them
      on demand locally through tooling that will be developed in follow ups.
      
      ## Integration
      
      Node/runtime developers can run tests based on the zombienet-sdk infra
      that spins frequently used networks which can be used for analyzing
      behavior of various node related components, like fork aware transaction
      pool.
      
      ## Review Notes
      
      - Uses ttxt API implemented here:
      https://github.com/michalkucharczyk/tx-test-tool/pull/22/files
      - currently, only two test scenarios are considered: 10k future & 10k
      ready txs are sent to two separate networks - one parachain and one
      relaychain, asserting at the end on the finalization of all 20k txs on
      both networks.
      
      ---------
      
      Sign...
    • Bastian Köcher's avatar
      `apply_authorized_upgrade`: Remote authorization if the version check fails (#7812) · 6ce9948e
      Bastian Köcher authored
      
      This pr ensures that we remove the `authorization` for a runtime upgrade
      if the version check failed. If that check is failing, it means that the
      runtime upgrade is invalid and the check will never succeed.
      
      Besides that the pr is doing some clean ups.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  4. Mar 06, 2025
  5. Mar 05, 2025
  6. Mar 04, 2025
  7. 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>
    • 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>
    • 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>
    • 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>
    • Matteo Muraca's avatar
      Remove `pallet::getter` usage from `pallet-nft-fractionalization` (#7124) · 3798ff7f
      Matteo Muraca authored
      
      Description
      Part of #3326
      As per title, `pallet::getter` usage has been removed from
      `pallet-nft-fractionalization`.
      
      ---------
      
      Co-authored-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>