Skip to content
Snippets Groups Projects
  1. Jul 05, 2024
    • Sebastian Kunert's avatar
      Stabilize elastic-scaling pov-recovery test (#4958) · 95c7e4f0
      Sebastian Kunert authored
      Timing issues in container startup have made this test flaky. We now
      wait for 20 and then register the parachain.
      This makes sure that the parachain node has the ability to see all relay
      chain notifications it needs.
      95c7e4f0
    • Alexander Samusev's avatar
      [ci] Increase timeout for ci jobs (#4950) · 299aacb5
      Alexander Samusev authored
      Related to recent discussion. PR makes timeout less strict.
      
      cc https://github.com/paritytech/ci_cd/issues/996
      299aacb5
    • Sebastian Kunert's avatar
      Introduce basic slot-based collator (#4097) · e44f61af
      Sebastian Kunert authored
      
      Part of #3168 
      On top of #3568
      
      ### Changes Overview
      - Introduces a new collator variant in
      `cumulus/client/consensus/aura/src/collators/slot_based/mod.rs`
      - Two tasks are part of that module, one for block building and one for
      collation building and submission.
      - Introduces a new variant of `cumulus-test-runtime` which has 2s slot
      duration, used for zombienet testing
      - Zombienet tests for the new collator
      
      **Note:** This collator is considered experimental and should only be
      used for testing and exploration for now.
      
      ### Comparison with `lookahead` collator
      - The new variant is slot based, meaning it waits for the next slot of
      the parachain, then starts authoring
      - The search for potential parents remains mostly unchanged from
      lookahead
      - As anchor, we use the current best relay parent
      - In general, the new collator tends to be anchored to one relay parent
      earlier. `lookahead` generally waits for a new relay block to arrive
      before it attempts to build a block. This means the actual timing of
      parachain blocks depends on when the relay block has been authored and
      imported. With the slot-triggered approach we are authoring directly on
      the slot boundary, were a new relay chain block has probably not yet
      arrived.
      
      ### Limitations
      - Overall, the current implementation focuses on the "happy path"
      - We assume that we want to collate close to the tip of the relay chain.
      It would be useful however to have some kind of configurable drift, so
      that we could lag behind a bit.
      https://github.com/paritytech/polkadot-sdk/issues/3965
      - The collation task is pretty dumb currently. It checks if we have
      cores scheduled and if yes, submits all the messages we have received
      from the block builder until we have something submitted for every core.
      Ideally we should do some extra checks, i.e. we do not need to submit if
      the built block is already too old (build on a out of range relay
      parent) or was authored with a relay parent that is not an ancestor of
      the relay block we are submitting at.
      https://github.com/paritytech/polkadot-sdk/issues/3966
      - There is no throttling, we assume that we can submit _velocity_ blocks
      every relay chain block. There should be communication between the
      collator task and block-builder task.
      - The parent search and ConsensusHook are not yet properly adjusted. The
      parent search makes assumptions about the pending candidate which no
      longer hold. https://github.com/paritytech/polkadot-sdk/issues/3967
      - Custom triggers for block building not implemented.
      
      ---------
      
      Co-authored-by: default avatarDavide Galassi <davxy@datawok.net>
      Co-authored-by: default avatarAndrei Sandu <54316454+sandreim@users.noreply.github.com>
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      Co-authored-by: default avatarJavier Viola <363911+pepoviola@users.noreply.github.com>
      Co-authored-by: command-bot <>
      e44f61af
  2. Jul 03, 2024
    • polka.dom's avatar
      Remove getter macro from pallet-insecure-randomness-collective-flip (#4839) · 924728cf
      polka.dom authored
      
      As per #3326, removes pallet::getter macro usage from the
      pallet-insecure-randomness-collective-flip. The syntax `StorageItem::<T,
      I>::get()` should be used instead.
      
      Explicitly implements the getters that were removed as well, following
      #223
      
      Also makes the storage values public and converts some syntax to turbo
      
      cc @muraca
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      Co-authored-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      924728cf
    • Axay Sagathiya's avatar
      rename the candidate backing message from `GetBackedCandidates` to `GetBackableCandidates` (#4921) · 51e98273
      Axay Sagathiya authored
      
      **Backable Candidate**: If a candidate receives enough supporting
      Statements from the Parachain Validators currently assigned, that
      candidate is considered backable.
      **Backed Candidate**: A Backable Candidate noted in a relay-chain block
      
      ---
      
      When the candidate backing subsystem receives the `GetBackedCandidates`
      message, it sends back **backable** candidates, not **backed**
      candidates. So we should rename this message to `GetBackableCandidates`
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      51e98273
    • Deepak Chaudhary's avatar
      Remove pallet::getter usage from all pallet-tips (#4871) · 60849232
      Deepak Chaudhary authored
      
      ### ISSUE
      Link to the issue:
      https://github.com/paritytech/polkadot-sdk/issues/3326
      cc @muraca 
      
      Deliverables
       - [Deprecation] remove pallet::getter usage from all pallet-tips
       
      
      ### Test Outcomes
      ___
      Successful tests by running `cargo test -p pallet-tips --features
      runtime-benchmarks`
      
      
      
      running 26 tests
      test tests::__construct_runtime_integrity_test::runtime_integrity_tests
      ... ok
      test benchmarking::bench_retract_tip ... ok
      test tests::equal_entries_invariant ... ok
      test benchmarking::bench_tip ... ok
      test tests::finders_fee_invariant ... ok
      test tests::genesis_config_works ... ok
      test tests::genesis_funding_works ... ok
      test benchmarking::bench_slash_tip ... ok
      test tests::reasons_invariant ... ok
      test benchmarking::bench_report_awesome ... ok
      test tests::close_tip_works ... ok
      test tests::report_awesome_from_beneficiary_and_tip_works ... ok
      test tests::test_genesis_config_builds ... ok
      test tests::test_last_reward_migration ... ok
      test benchmarking::bench_tip_new ... ok
      test benchmarking::bench_close_tip ... ok
      test tests::test_migration_v4 ... ok
      test tests::slash_tip_works ... ok
      test tests::report_awesome_and_tip_works_second_instance ... ok
      test tests::report_awesome_and_tip_works ... ok
      test tests::tip_changing_works ... ok
      test tests::zero_base_deposit_prohibited - should panic ... ok
      test tests::tip_median_calculation_works ... ok
      test tests::tip_new_cannot_be_used_twice ... ok
      test tests::tip_large_should_fail ... ok
      test tests::retract_tip_works ... ok
      
      test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.02s
      
         Doc-tests pallet_tips
      
      running 0 tests
      
      test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.00s
      
      ---
      
      Polkadot Address: 16htXkeVhfroBhL6nuqiwknfXKcT6WadJPZqEi2jRf9z4XPY
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      60849232
    • Ankan's avatar
      [Staking] Delegators can stake but stakers can't delegate (#4904) · 282eaaa5
      Ankan authored
      Related: https://github.com/paritytech/polkadot-sdk/pull/4804.
      Fixes the try state error in Westend:
      https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6564522.
      Passes here:
      https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6580393
      
      ## Context
      Currently in Kusama and Polkadot, an account can do both, directly
      stake, and join a pool.
      
      With the migration of pools to `DelegateStake` (See
      https://github.com/paritytech/polkadot-sdk/pull/3905), the funds of pool
      members are locked in a different way than for direct stakers.
      - Pool member funds uses `holds`.
      - `pallet-staking` uses deprecated locks (analogous to freeze) which can
      overlap with holds.
      
      An existing delegator can stake directly since pallet-staking only uses
      free balance. But once an account becomes staker, we cannot allow them
      to be delegator as this risks an account to use already staked (frozen)
      funds in pools.
      
      When an account gets into a situation where it is participating in both
      pools and staking, it would no longer would be able to add any extra
      bond to the pool but they can still withdraw funds.
      
      ## Changes
      - Add test for the above scenario.
      - Removes the assumption that a delegator cannot be a staker.
      282eaaa5
    • Serban Iorga's avatar
      [BEEFY] Add runtime support for reporting fork voting (#4522) · b6f18232
      Serban Iorga authored
      Related to https://github.com/paritytech/polkadot-sdk/issues/4523
      
      Extracting part of https://github.com/paritytech/polkadot-sdk/pull/1903
      (credits to @Lederstrumpf
      
       for the high-level strategy), but also
      introducing significant adjustments both to the approach and to the
      code. The main adjustment is the fact that the `ForkVotingProof` accepts
      only one vote, compared to the original version which accepted a
      `vec![]`. With this approach more calls are needed in order to report
      multiple equivocated votes on the same commit, but it simplifies a lot
      the checking logic. We can add support for reporting multiple signatures
      at once in the future.
      
      There are 2 things that are missing in order to consider this issue
      done, but I would propose to do them in a separate PR since this one is
      already pretty big:
      - benchmarks/computing a weight for the new extrinsic (this wasn't
      present in https://github.com/paritytech/polkadot-sdk/pull/1903 either)
      - exposing an API for generating the ancestry proof. I'm not sure if we
      should do this in the Mmr pallet or in the Beefy pallet
      
      Co-authored-by: default avatarRobert Hambrock <roberthambrock@gmail.com>
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <adrian@parity.io>
      b6f18232
    • gupnik's avatar
      Fixes warnings in `frame-support-procedural` crate (#4915) · e5791a56
      gupnik authored
      This PR fixes the unused warnings in `frame-support-procedural` crate,
      raised by the latest stable rust release.
      e5791a56
    • Alexandru Gheorghe's avatar
      approval-voting: Make tests deterministic (#3899) · 33324fe0
      Alexandru Gheorghe authored
      
      With random connectivity and latency is hard to actually figure it out a
      delta in the benchmarking, so disable them in order to get full
      deterministic behaviour when measuring performance.
      
      At least on my machine with this configuration the results for
      approval-throughput are really similar between subsequent runs:
      
      ```
      CPU usage, seconds                     total   per block
      
      approval-distribution                36.9025      3.6902
      approval-distribution                36.7579      3.6758
      approval-distribution                37.0418      3.7042
      approval-distribution                37.0339      3.7034
      approval-distribution                36.9342      3.6934
      approval-distribution                36.7177       3.6718
      
      
      
      approval-voting                      52.7756      5.2776
      approval-voting                      52.5999      5.2600
      approval-voting                      53.2158      5.3216
      approval-voting                      53.2493      5.3249
      approval-voting                      52.8524      5.2852
      approval-voting                      52.8611      5.2861
      approval-voting                      52.8210      5.2821
      ```
      
      ---------
      
      Signed-off-by: default avatarAlexandru Gheorghe <alexandru.gheorghe@parity.io>
      33324fe0
    • Adrian Catangiu's avatar
      bridge tests: send bridged assets from random parachain to bridged asset hub (#4870) · 98ce675a
      Adrian Catangiu authored
      
      - Send bridged WNDs: Penpal Rococo -> AH Rococo -> AH Westend
      - Send bridged ROCs: Penpal Westend -> AH Westend -> AH Rococo
      
      The tests send both ROCs and WNDs, for each direction the native asset
      is only used to pay for the transport fees on the local AssetHub, and
      are not sent over the bridge.
      
      Including the native asset won't be necessary anymore once we get #4375.
      
      ---------
      
      Signed-off-by: default avatarAdrian Catangiu <adrian@parity.io>
      Co-authored-by: command-bot <>
      98ce675a
    • Alexandru Vasile's avatar
      litep2p: Increment random walk metrics (#4929) · 6b9d14a1
      Alexandru Vasile authored
      
      This PR exposes the `RandomKademliaStarted` event from the litep2p
      network backend, and then increments the appropriate metrics.
      
      This is part of: https://github.com/paritytech/polkadot-sdk/issues/4681.
      However, it is more of an effort to debug low peer count 
      
      ### Testing Done
      - Started a node and fetched queries:
      `substrate_sub_libp2p_kademlia_random_queries_total` produces results
      for litep2p backend
      
      cc @paritytech/networking
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
      6b9d14a1
    • Sebastian Kunert's avatar
      `polkadot-parachain`: Unify asset-hub authoring codepath with general AURA (#4932) · b31880c5
      Sebastian Kunert authored
      Recently thought about the special handling we have for asset-hub
      chains. They started with relay chain consensus and transitioned to AURA
      at some point. However, nobody should be authoring with relay chain
      consensus on these chains anymore, the transition is long done.
      
      I propose to remove this special handling, allowing us to unify one more
      execution path.
      b31880c5
    • Alexandru Gheorghe's avatar
      Fix markdown lint step (#4933) · 62b955e9
      Alexandru Gheorghe authored
      
      CI required markdown step seems to start failing after
      https://github.com/paritytech/polkadot-sdk/pull/4806
      
      Signed-off-by: default avatarAlexandru Gheorghe <alexandru.gheorghe@parity.io>
      62b955e9
    • Kian Paimani's avatar
  3. Jul 01, 2024
  4. Jun 28, 2024
  5. Jun 27, 2024
  6. Jun 26, 2024
  7. Jun 25, 2024
    • gupnik's avatar
      Use real rust type for pallet alias in `runtime` macro (#4769) · 2f3a1bf8
      gupnik authored
      Fixes https://github.com/paritytech/polkadot-sdk/issues/4723. Also,
      closes https://github.com/paritytech/polkadot-sdk/issues/4622
      
      As stated in the linked issue, this PR adds the ability to use a real
      rust type for pallet alias in the new `runtime` macro:
      ```rust
      #[runtime::pallet_index(0)]
      pub type System = frame_system::Pallet<Runtime>;
      ```
      
      Please note that the current syntax still continues to be supported.
      
      CC: @shawntabrizi @Kianenigma
      
      
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      2f3a1bf8
    • Aaro Altonen's avatar
      Upgrade libp2p to 0.52.4 (#1631) · 414a8fc2
      Aaro Altonen authored
      Upgrade libp2p to 0.52.4, including a fix: 
      
      * Set Kademlia to server mode
      (https://github.com/paritytech/substrate/pull/14703)
      
      ### TODO
      - [x] Fix 3 zombienet tests failing:
        - [x] `zombienet-substrate-0002-validators-warp-sync`
      - [ ]
      ~`zombienet-polkadot-functional-0005-parachains-disputes-past-session`~
      The test is also flaky in other PRs and is not required for CI to
      succeed.
        - [x] `zombienet-polkadot-functional-0009-approval-voting-coalescing`
      - [x] Uncomment and update to the actual libp2p API tests in
      [`substrate/client/network/src/protocol/notifications/handler.rs`](https://github.com/paritytech/polkadot-sdk/blob/7331f179/substrate/client/network/src/protocol/notifications/handler.rs#L1009).
      - [x] When upgrading `multihash` crate as part of libp2p upgrade to
      version v0.19.1, uncomment the conversion code at
      https://github.com/paritytech/polkadot-sdk/blob/7547c494
      
      /substrate/client/network/types/src/multihash.rs#L159
      - [x] Perform a burn-in.
      
      ---------
      
      Co-authored-by: default avatarAnton <anton.kalyaev@gmail.com>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarDmitry Markin <dmitry@markin.tech>
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      414a8fc2