Skip to content
Snippets Groups Projects
  1. Jul 15, 2024
  2. Jul 12, 2024
  3. Jul 10, 2024
  4. Jul 07, 2024
    • Muharem Ismailov's avatar
      Assets: can_decrease/increase for destroying asset is not successful (#3286) · f7dd85d0
      Muharem Ismailov authored
      Functions `can_decrease` and `can_increase` do not return successful
      consequence results for assets undergoing destruction; instead, they
      return the `UnknownAsset` consequence variant.
      
      This update aligns their behavior with similar functions, such as
      `reducible_balance`, `increase_balance`, `decrease_balance`, and `burn`,
      which return an `AssetNotLive` error for assets in the process of being
      destroyed.
  5. Jul 06, 2024
    • Deepak Chaudhary's avatar
      remove getter from babe pallet (#4912) · d3cdfc44
      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-babe
      
      ### Test Outcomes
      ___
      Successful tests by running `cargo test -p pallet-babe --features
      runtime-benchmarks`
      
      
      running 32 tests
      test
      mock::__pallet_staking_reward_curve_test_module::reward_curve_piece_count
      ... ok
      test mock::__construct_runtime_integrity_test::runtime_integrity_tests
      ... ok
      test mock::test_genesis_config_builds ... ok
      2024-06-28T17:02:11.158812Z ERROR runtime::storage: Corrupted state at
      `0x1cb6f36e027abb2091cfb5110ab5087f9aab0a5b63b359512deee557c9f4cf63`:
      Error { cause: Some(Error { cause: None, desc: "Could not decode
      `NextConfigDescriptor`, variant doesn't exist" }), desc: "Could not
      decode `Option::Some(T)`" }
      2024-06-28T17:02:11.159752Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::add_epoch_configurations_migration_works ... ok
      test tests::author_vrf_output_for_secondary_vrf ... ok
      test benchmarking::bench_check_equivocation_proof ... ok
      2024-06-28T17:02:11.160537Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::can_estimate_current_epoch_progress ... ok
      test tests::author_vrf_output_for_primary ... ok
      test tests::authority_index ... ok
      2024-06-28T17:02:11.162327Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::empty_randomness_is_correct ... ok
      test tests::check_module ... ok
      2024-06-28T17:02:11.163492Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::current_slot_is_processed_on_initialization ... ok
      test tests::can_enact_next_config ... ok
      2024-06-28T17:02:11.164987Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.165007Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::can_predict_next_epoch_change ... ok
      test tests::first_block_epoch_zero_start ... ok
      test tests::initial_values ... ok
      2024-06-28T17:02:11.168430Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.168685Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.170982Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.171220Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::only_root_can_enact_config_change ... ok
      test tests::no_author_vrf_output_for_secondary_plain ... ok
      test tests::can_fetch_current_and_next_epoch_data ... ok
      2024-06-28T17:02:11.172960Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::report_equivocation_has_valid_weight ... ok
      2024-06-28T17:02:11.173873Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.177084Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::report_equivocation_after_skipped_epochs_works ...
      2024-06-28T17:02:11.177694Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.177703Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.177925Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.177927Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      ok
      2024-06-28T17:02:11.179678Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.181446Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.183665Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.183874Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.185732Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.185951Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.189332Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.189559Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.189587Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::generate_equivocation_report_blob ... ok
      test tests::disabled_validators_cannot_author_blocks - should panic ...
      ok
      2024-06-28T17:02:11.190552Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.192279Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.194735Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.196136Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.197240Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::skipping_over_epochs_works ... ok
      2024-06-28T17:02:11.202783Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.202846Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.203029Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.205242Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::tracks_block_numbers_when_current_and_previous_epoch_started
      ... ok
      2024-06-28T17:02:11.208965Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::report_equivocation_current_session_works ... ok
      test tests::report_equivocation_invalid_key_owner_proof ... ok
      2024-06-28T17:02:11.216431Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      2024-06-28T17:02:11.216855Z ERROR runtime::timestamp:
      `pallet_timestamp::UnixTime::now` is called at genesis, invalid value
      returned: 0
      test tests::report_equivocation_validate_unsigned_prevents_duplicates
      ... ok
      test tests::report_equivocation_invalid_equivocation_proof ... ok
      test tests::valid_equivocation_reports_dont_pay_fees ... ok
      test tests::report_equivocation_old_session_works ... ok
      test
      mock::__pallet_staking_reward_curve_test_module::reward_curve_precision
      ... ok
      
      test result: ok. 32 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.20s
      
         Doc-tests pallet-babe
      
      running 0 tests
      
      test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.00s
      
      ---
      
      Polkadot Address: 16htXkeVhfroBhL6nuqiwknfXKcT6WadJPZqEi2jRf9z4XPY
    • Deepak Chaudhary's avatar
      remove getter from transaction storage pallet (#4885) · d3a679d3
      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
      pallet-transaction-storage
      
      
      ### Test Outcomes
      ___
      cargo test -p pallet-transaction-storage --features runtime-benchmarks 
      
      running 9 tests
      test mock::test_genesis_config_builds ... ok
      test tests::burns_fee ... ok
      test mock::__construct_runtime_integrity_test::runtime_integrity_tests
      ... ok
      test tests::discards_data ... ok
      test tests::renews_data ... ok
      test benchmarking::bench_renew ... ok
      test benchmarking::bench_store ... ok
      test tests::checks_proof ... ok
      test benchmarking::bench_check_proof_max has been running for over 60
      seconds
      test benchmarking::bench_check_proof_max ... ok
      
      test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 72.57s
      
         Doc-tests pallet-transaction-storage
      
      running 0 tests
      
      test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.00s
      
      ---
      
      Polkadot Address: 16htXkeVhfroBhL6nuqiwknfXKcT6WadJPZqEi2jRf9z4XPY
    • Tomás Senovilla Polo's avatar
      Fix small typo in fungible token freeze docs (#4943) · 515a9f7a
      Tomás Senovilla Polo authored
      Hi!
      
      In the course of a talk with @shawntabrizi
      
       in Singapore, we realized the
      documentation related to freeze balances' a little bit confusing. It
      stated that a frozen amount is released at some specified block number,
      which isn't true in general.
      
      This PR fixes that typo and further specifies that the frozen balance
      may exceed the available balance, according to what we learned at the
      PBA. This feature was not specified in the documentation AFAIK.
      
      This is the first time I submit something to the polkadot SDK repo, so
      please feel free to rephrase the docs I added in case I messed up!
      
      ---------
      
      Co-authored-by: default avatarShawn Tabrizi <shawntabrizi@gmail.com>
      Co-authored-by: command-bot <>
  6. Jul 05, 2024
    • Deepak Chaudhary's avatar
      remove getter from vesting pallet (#4902) · 2b17cb8f
      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-vesting
       
      
      ### Test Outcomes
      ___
      Successful tests by running `cargo test -p pallet-vesting --features
      runtime-benchmarks`
      
      running 45 tests
      test benchmarking::bench_force_vested_transfer ... ok
      test benchmarking::bench_vest_other_locked ... ok
      test mock::__construct_runtime_integrity_test::runtime_integrity_tests
      ... ok
      test benchmarking::bench_not_unlocking_merge_schedules ... ok
      test benchmarking::bench_unlocking_merge_schedules ... ok
      test mock::test_genesis_config_builds ... ok
      test tests::build_genesis_has_storage_version_v1 ... ok
      test tests::check_vesting_status ... ok
      test benchmarking::bench_force_remove_vesting_schedule ... ok
      test tests::check_vesting_status_for_multi_schedule_account ... ok
      test benchmarking::bench_vest_locked ... ok
      test tests::extra_balance_should_transfer ... ok
      test tests::generates_multiple_schedules_from_genesis_config ... ok
      test tests::force_vested_transfer_allows_max_schedules ... ok
      test tests::force_vested_transfer_correctly_fails ... ok
      test tests::force_vested_transfer_works ... ok
      test tests::liquid_funds_should_transfer_with_delayed_vesting ... ok
      test tests::merge_finished_and_ongoing_schedules ... ok
      test benchmarking::bench_vest_unlocked ... ok
      test tests::merge_finished_and_yet_to_be_started_schedules ... ok
      test tests::merge_finishing_schedules_does_not_create_a_new_one ... ok
      test tests::merge_ongoing_and_yet_to_be_started_schedules ... ok
      test benchmarking::bench_vest_other_unlocked ... ok
      test tests::merge_ongoing_schedules ... ok
      test tests::merge_schedules_that_have_not_started ... ok
      test tests::merge_vesting_handles_per_block_0 ... ok
      test tests::per_block_works ... ok
      test tests::merge_schedules_throws_proper_errors ... ok
      test tests::multiple_schedules_from_genesis_config_errors - should panic
      ... ok
      test tests::merging_shifts_other_schedules_index ... ok
      test tests::non_vested_cannot_vest_other ... ok
      test tests::unvested_balance_should_not_transfer ... ok
      test tests::non_vested_cannot_vest ... ok
      test tests::vested_balance_should_transfer ... ok
      test tests::remove_vesting_schedule ... ok
      test tests::vested_transfer_correctly_fails ... ok
      test tests::vested_balance_should_transfer_with_multi_sched ... ok
      test tests::vested_balance_should_transfer_using_vest_other ... ok
      test tests::vested_transfer_less_than_existential_deposit_fails ... ok
      test tests::vesting_info_ending_block_as_balance_works ... ok
      test tests::vesting_info_validate_works ... ok
      test
      tests::vested_balance_should_transfer_using_vest_other_with_multi_sched
      ... ok
      test tests::vested_transfer_works ... ok
      test tests::vested_transfer_allows_max_schedules ... ok
      test benchmarking::bench_vested_transfer ... ok
      
      test result: ok. 45 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.10s
      
      ---
      
      Polkadot Address: 16htXkeVhfroBhL6nuqiwknfXKcT6WadJPZqEi2jRf9z4XPY
  7. 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>
    • 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>
    • 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.
    • 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>
    • 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.
  8. Jul 01, 2024
  9. Jun 27, 2024
  10. Jun 26, 2024
  11. 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>
  12. Jun 24, 2024
    • dashangcun's avatar
    • Muharem Ismailov's avatar
      treasury pallet: remove unused config parameters (#4831) · 5e62782d
      Muharem Ismailov authored
      Remove unused config parameters `ApproveOrigin` and `OnSlash` from the
      treasury pallet. Add `OnSlash` config parameter to the bounties and tips
      pallets.
      
      part of https://github.com/paritytech/polkadot-sdk/issues/3800
    • Muharem Ismailov's avatar
      pallet ranked collective: max member count per rank (#4807) · 0b11c27e
      Muharem Ismailov authored
      Configuration for the maximum member count per rank, with the option for
      no limit.
    • Oliver Tale-Yazdi's avatar
      Lift all dependencies (the big one) (#4716) · 8efa0544
      Oliver Tale-Yazdi authored
      
      After preparing in https://github.com/paritytech/polkadot-sdk/pull/4633,
      we can lift also all internal dependencies up to the workspace.
      
      This does not actually change anything, but uses `workspace = true` for
      all dependencies. You can check it with:
      ```bash
      git checkout -q $(git merge-base oty-lift-all-deps origin/master)
      cargo tree -e features > master.out
      
      git checkout -q oty-lift-all-deps
      cargo tree -e features > new.out
      diff master.out new.out
      ```
      
      It did not yet lift 100% of dependencies, some inside of `target.*` or
      some that had conflicting aliases introduced recently. But i will do
      these together in a follow-up with CI checks.
      
      Can be reproduced with [zepter](https://github.com/ggwpez/zepter/):
      `zepter transpose d lift-to-workspace "regex:.*" --version-resolver
      highest --skip-package "polkadot-sdk" --ignore-errors --fix`.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
    • Bastian Köcher's avatar
      Ensure earliest allowed block is at minimum the next block (#4823) · b7767168
      Bastian Köcher authored
      When `min_enactment_period == 0` and `desired == At(n)` where `n` is
      smaller than the current block number, the scheduling would fail. This
      happened for example here:
      https://collectives.subsquare.io/fellowship/referenda/126
      
      To ensure that this doesn't happen again, ensure that the earliest
      allowed block is at minimum the next block.
    • Deepak Chaudhary's avatar
      pallet-membership should implement ContainsLengthBound (#4865) · fed81f7e
      Deepak Chaudhary authored
      
      ### ISSUE
      Link to the issue:
      https://github.com/paritytech/polkadot-sdk/issues/1143
      
      Deliverables
       - Implement trait `ContainsLengthBound` for pallet-membership
       
      
      ### Test Outcomes
      ___
      Successful tests by running `cargo test -p pallet-membership --features
      runtime-benchmarks`
      
      
      
      running 22 tests
      test tests::__construct_runtime_integrity_test::runtime_integrity_tests
      ... ok
      test benchmark::bench_clear_prime ... ok
      test tests::add_member_works ... ok
      test tests::change_key_with_same_caller_as_argument_changes_nothing ...
      ok
      test tests::change_key_works ... ok
      test benchmark::bench_set_prime ... ok
      test benchmark::bench_remove_member ... ok
      test benchmark::bench_change_key ... ok
      test tests::change_key_works_that_does_not_change_order ... ok
      test benchmark::bench_reset_members ... ok
      test benchmark::bench_add_member ... ok
      test tests::genesis_build_panics_with_duplicate_members - should panic
      ... ok
      test benchmark::bench_swap_member ... ok
      test tests::query_membership_works ... ok
      test tests::prime_member_works ... ok
      test tests::test_genesis_config_builds ... ok
      test tests::remove_member_works ... ok
      test tests::migration_v4 ... ok
      test tests::swap_member_with_identical_arguments_changes_nothing ... ok
      test tests::swap_member_works_that_does_not_change_order ... ok
      test tests::swap_member_works ... ok
      test tests::reset_members_works ... ok
      
      test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.01s
      
         Doc-tests pallet_membership
      
      running 0 tests
      
      test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
      out; finished in 0.00s
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
    • Oliver Tale-Yazdi's avatar
  13. Jun 23, 2024
  14. Jun 22, 2024
    • Muharem Ismailov's avatar
      Frame: `Consideration` trait generic over `Footprint` and indicates zero cost (#4596) · 812dbff1
      Muharem Ismailov authored
      `Consideration` trait generic over `Footprint` and indicates zero cost
      for a give footprint.
      
      `Consideration` trait is generic over `Footprint` (currently defined
      over the type with the same name). This makes it possible to setup a
      custom footprint (e.g. current number of proposals in the storage).
      
      `Consideration::new` and `Consideration::update` return an
      `Option<Self>` instead `Self`, this make it possible to indicate a no
      cost for a specific footprint (e.g. if current number of proposals in
      the storage < max_proposal_count / 2 then no cost).
      
      These cases need to be handled for
      https://github.com/paritytech/polkadot-sdk/pull/3151
  15. Jun 21, 2024
  16. Jun 18, 2024
    • Tin Chung's avatar
      Add set_partial_params dispatchable function (#3843) · cc387132
      Tin Chung authored
      
      # ISSUE
      - Link to issue: https://github.com/paritytech/polkadot-sdk/issues/3617
      # Description
      > Any set parameter / update config call with multiple arguments should
      have each argument to be an Option field. Please put this to some best
      practice document. This allows new update config call does not need to
      duplicate the fields that does not need to update. It also makes
      concurrent votes of update call possible, otherwise there will be race
      condition. It also helps with review such proposal otherwise reviewers
      need to check the other fields should remain the same.
      - [ ] Concurrent call & race condition testing
      - [x] Each argument of the `ParamsType` is an `Option` field. Introduce
      through
      ```rust
      pub type PartialParamsOf<T, I> =
      		ParamsType<Option<<T as Config<I>>::Balance>, Option<BlockNumberFor<T>>, RANK_COUNT>;
      ```
      # Outcome
      ```rust
      let params = ParamsType {
      	active_salary: [None; 9],
      	passive_salary: [None; 9],
      	demotion_period: [None, Some(10), None, None, None, None, None, None, None],
      	min_promotion_period: [None; 9],
      	offboard_timeout: Some(1),
      };
      CoreFellowship::set_partial_params(signed(2), Box::new(params.clone())),
      ```
      Test coverage
      ```diff
      running 21 tests
      test tests::unit::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
      test tests::unit::basic_stuff ... ok
      test tests::integration::test_genesis_config_builds ... ok
      test tests::integration::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
      test tests::unit::auto_demote_offboard_works ... ok
      test tests::unit::auto_demote_works ... ok
      test tests::unit::get_salary_works ... ok
      test tests::unit::active_changing_get_salary_works ... ok
      test tests::integration::swap_bad_noops ... ok
      test tests::unit::promote_postpones_auto_demote ... ok
      test tests::unit::infinite_demotion_period_works ... ok
      test tests::unit::proof_postpones_auto_demote ... ok
      test tests::unit::induct_works ... ok
      test tests::unit::set_params_works ... ok
      test tests::unit::test_genesis_config_builds ... ok
      test tests::unit::offboard_works ... ok
      test tests::unit::sync_works ... ok
      + test tests::unit::set_partial_params_works ... ok
      test tests::integration::swap_exhaustive_works ... ok
      test tests::unit::promote_works ... ok
      test tests::integration::swap_simple_works ... ok
      
      test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
      
         Doc-tests pallet_core_fellowship
      
      running 0 tests
      
      test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
      ```
      
      polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J
      
      ---------
      
      Co-authored-by: default avatarDónal Murray <donalm@seadanda.dev>
      Co-authored-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
    • Tin Chung's avatar
      Remove deprecated treasury pallet calls (#3820) · 40677b64
      Tin Chung authored
      # ISSUE
      - Link to the issue:
      https://github.com/paritytech/polkadot-sdk/issues/3800
      # Deliverables
      - [x] remove deprecated calls;
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/d579b673)
      - [x] set explicit coded indexes for Error and Event enums, remove
      unused variants and keep the same indexes for the rest;
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/d579b673)
      - [x] remove unused Config's type parameters;
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/d579b673)
      - [x] remove irrelevant tests and adopt relevant using old api;
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/d579b673)
      - [x] remove benchmarks for removed calls;
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/1a3d5f1f)
      - [x] prdoc
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/d579b673)
      - [x] remove deprecated methods from the `treasury/README.md` and add
      up-to-date dispatchable functions documentation
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/d579b673)
      - [x] remove deprecated weight functions
      (https://github.com/paritytech/polkadot-sdk/pull/3820/commits/8f74134b)
      > ### Separated to other issues
      > - [ ] remove storage items like Proposals and ProposalCount, that are
      not used anymore
      
      Adjust all treasury pallet instances within polkadot-sdk
      - [x] `pallet_bounty`, `tip`, `child_bounties`:
      https://github.com/openguild-labs/polkadot-sdk/pull/3
      - [x] Remove deprecated treasury weight functions used in Westend and
      Rococo runtime `collective-westend`, `collective-rococo`
      
      Add migration for westend and rococo to clean the data from removed
      storage items
      - [ ] https://github.com/paritytech/polkadot-sdk/pull/3828
      # Test Outcomes
      Successful tests by running `cargo test --features runtime-benchmarks`
      ```
      running 38 tests
      test tests::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
      test benchmarking::benchmarks::bench_check_status ... ok
      test benchmarking::benchmarks::bench_payout ... ok
      test benchmarking::benchmarks::bench_spend_local ... ok
      test tests::accepted_spend_proposal_enacted_on_spend_period ... ok
      test benchmarking::benchmarks::bench_spend ... ok
      test tests::accepted_spend_proposal_ignored_outside_spend_period ... ok
      test benchmarking::benchmarks::bench_void_spend ... ok
      test benchmarking::benchmarks::bench_remove_approval ... ok
      test tests::genesis_funding_works ... ok
      test tests::genesis_config_works ... ok
      test tests::inexistent_account_works ... ok
      test tests::minting_works ... ok
      test tests::check_status_works ... ok
      test tests::payout_retry_works ... ok
      test tests::pot_underflow_should_not_diminish ... ok
      test tests::remove_already_removed_approval_fails ... ok
      test tests::spend_local_origin_permissioning_works ... ok
      test tests::spend_valid_from_works ... ok
      test tests::spend_expires ... ok
      test tests::spend_works ... ok
      test tests::test_genesis_config_builds ... ok
      test tests::spend_payout_works ... ok
      test tests::spend_local_origin_works ... ok
      test tests::spend_origin_works ... ok
      test tests::spending_local_in_batch_respects_max_total ... ok
      test tests::spending_in_batch_respects_max_total ... ok
      test tests::try_state_proposals_invariant_2_works ... ok
      test tests::try_state_proposals_invariant_1_works ... ok
      test tests::try_state_spends_invariant_2_works ... ok
      test tests::try_state_spends_invariant_1_works ... ok
      test tests::treasury_account_doesnt_get_deleted ... ok
      test tests::try_state_spends_invariant_3_works ... ok
      test tests::unused_pot_should_diminish ... ok
      test tests::void_spend_works ... ok
      test tests::try_state_proposals_invariant_3_works ... ok
      test tests::max_approvals_limited ... ok
      test benchmarking::benchmarks::bench_on_initialize_proposals ... ok
      
      test result: ok. 38 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s
      
         Doc-tests pallet_treasury
      
      running 2 tests
      test substrate/frame/treasury/src/lib.rs - (line 52) ... ignored
      test substrate/frame/treasury/src/lib.rs - (line 79) ... ignored
      
      test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s
      ```
      
      polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J
    • Andrei Sandu's avatar
      glutton: also increase parachain block length (#4728) · 1dc68de8
      Andrei Sandu authored
      
      Glutton currently is useful mostly for stress testing relay chain
      validators. It is unusable for testing the collator networking and block
      announcement and import scenarios. This PR resolves that by improving
      glutton pallet to also buff up the blocks, up to the runtime configured
      `BlockLength`.
      
      ### How it works
      Includes an additional inherent in each parachain block. The `garbage`
      argument passed to the inherent is filled with trash data. It's size is
      computed by applying the newly introduced `block_length` percentage to
      the maximum block length for mandatory dispatch class. After
      https://github.com/paritytech/polkadot-sdk/pull/4765 is merged, the
      length of inherent extrinsic will be added to the total block proof
      size.
      
      The remaining weight is burnt in `on_idle` as configured by the
      `storage` percentage parameter.
      
      
      TODO:
      - [x] PRDoc
      - [x] Readme update
      - [x] Add tests
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <andrei-mihail@parity.io>
  17. Jun 17, 2024
  18. Jun 14, 2024
  19. Jun 13, 2024