1. Mar 15, 2023
    • Ross Bulat's avatar
      Nomination Pool Commission (#13128) · 20d5e358
      Ross Bulat authored
      
      
      * + nomination pool commission
      
      * fmt
      
      * use register_update()
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      
      * fmt
      
      * amend comments
      
      * + test for set_commission
      
      * fix
      
      * Update frame/nomination-pools/fuzzer/src/call.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * rm comment
      
      * use PalletError
      
      * some feedback item amendments
      
      * update weights
      
      * revert PalletError stuff
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * make pool_events_since_last_call more modular
      
      * fmt
      
      * fix call indexes + test
      
      * add payout teste
      
      * add event to max_commisson updating current
      
      * begin refactor
      
      * some debugging
      
      * update
      
      * more tests
      
      * rewardpol not working
      
      * commission refactor
      
      * pending rewards returns commission
      
      * fmt
      
      * add claim_commission call
      
      * + claim_commission
      
      * fix benchmarks
      
      * weight 0 for now
      
      * + claim_commission benchmark
      
      * fmt
      
      * apply commission to benchmarks
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nomination_pools
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * clippy
      
      * + pending
      
      * add RewardPool.total_rewards_acounted
      
      * fixes
      
      * println
      
      * more logs
      
      * Fix plus cleanups
      
      * fix assert
      
      * tidy up
      
      * tests work + tidy up
      
      * rm unused
      
      * clippy fix
      
      * persist reward_pool update
      
      * claim_commission_works tests
      
      * .
      
      * some test formatting
      
      * add high level docs
      
      * add calls
      
      * docs
      
      * rename
      
      * rename
      
      * docs
      
      * rename
      
      * fmt
      
      * use matches!
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      
      * Update frame/nomination-pools/src/tests.rs
      
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      
      * comment
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      
      * .
      
      * weights order
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nomination_pools
      
      * use from_parts
      
      * comment
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * revert clippy suggestions on old migrations
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nomination_pools
      
      * add InitialGlobalMaxCommission
      
      * fix migration
      
      * reward counter comments & explanations
      
      * format
      
      * add commission implementation note
      
      * fmt
      
      * revert InitialGlobalMaxCommission
      
      * global max commission migration generic
      
      * text
      
      * 100% commission no payout test
      
      * add commission_accumulates_on_multiple_rewards
      
      * non-zero fuzzer GlobalMaxCommission
      
      * add last_recorded_total_payouts_needs_commission
      
      * commission event fix + claim commission test
      
      ---------
      
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      20d5e358
  2. Mar 14, 2023
  3. Mar 13, 2023
    • Alexandru Vasile's avatar
      Metadata V15: Expose pallet documentation (#13452) · 4cbf855e
      Alexandru Vasile authored
      
      
      * frame/proc: Helpers to parse pallet documentation attributes
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * frame/proc: Expand pallet with runtime metadata documentation
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * frame/dispatch: Implement doc function getter for dispatch
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * frame/tests: Check exposed runtime metadata documentation
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * frame/tests: Add UI tests for `pallet_doc` attribute
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * frame/proc: Document pallet_doc attribute
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * frame/support: Use `derive_syn_parse`
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      * Update frame/support/procedural/src/lib.rs
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * frame/support: Improve documentation
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      4cbf855e
    • Dino Pačandi's avatar
      Pallet assets improvements (#13543) · efd5d98e
      Dino Pačandi authored
      efd5d98e
    • Vivek Pandya's avatar
      Remove use of trait Store from all pallets and deprecate it. (#13535) · 2009821c
      Vivek Pandya authored
      * Remove use of trait Store from staking pallet
      
      * Remove use of trait Store from bounties pallet
      
      * Remove use of trait Store from collective pallet
      
      * Remove use of trait Store from babe pallet
      
      * Remove use of trait Store from assets pallet
      
      * Remove use of trait Store from grandpa pallet
      
      * Remove use of trait Store from balances pallet
      
      * Remove use of trait Store from authorship pallet
      
      * Remove use of trait Store from authority-discovery pallet
      
      * Remove use of trait Store from atomic-swap pallet
      
      * Remove use of trait Store from sudo pallet
      
      * Remove use of trait Store from scheduler pallet
      
      * Remove use of trait Store from scored-pool pallet
      
      * Remove use of trait Store from society pallet
      
      * Remove use of trait Store from lottery pallet
      
      * Remove use of trait Store from executive pallet
      
      * Remove use of trait Store from democracy pallet
      
      * Remove use of trait Store from elections-phragmen pallet
      
      * Remove use of trait Store from indices pallet
      
      * Remove use of trait Store from identity pallet
      
      * Remove use of trait Store from multisig pallet
      
      * Remove use of trait Store from merkle-mountain-range pallet
      
      * Remove use of trait Store from im-online pallet
      
      * Remove use of trait Store from membership pallet
      
      * Remove use of trait Store from nicks pallet
      
      * Remove use of trait Store from session pallet
      
      * Remove use of trait Store from transaction-payment pallet
      
      * Remove use of trait Store from utility pallet
      
      * Remove use of trait Store from child-bounties pallet
      
      * Remove use of trait Store from nis pallet
      
      * Remove use of trait Store from nfts pallet
      
      * Remove use of trait Store from conviction-voting pallet
      
      * Remove use of trait Store from treasury pallet
      
      * Remove use of trait Store from vesting pallet
      
      * Remove use of trait Store from preimage pallet
      
      * Remove use of trait Store from uniques pallet
      
      * Remove use of trait Store from ranked-collective pallet
      
      * Remove use of trait Store from beefy-mmr pallet
      
      * Remove use of trait Store from referenda pallet
      
      * Remove use of trait Store from whitelist pallet
      
      * Remove use of trait Store from alliance pallet
      
      * Remove use of trait Store from nomination-pools pallet
      
      * Remove use of trait Store from state-trie-migration pallet
      
      * Remove use of trait Store from message-queue pallet
      
      * Remove use of trait Store from root-offences pallet
      
      * Remove use of trait Store from root-testing pallet
      
      * Remove use of trait Store from timestamps pallet
      
      * Remove use of trait Store from system pallet
      
      * Remove use of trait Store from offences pallet
      
      * Remove use of trait Store from recovery pallet
      
      * Remove use of trait Store from node-authorization pallet
      
      * Remove use of trait Store from proxy pallet
      
      * Remove use of trait Store from benchmarking pallet
      
      * Remove use of trait Store from bags-list pallet
      
      * Add deprecated warning in store_trait
      
      * Change warning message
      
      * Run cargo fmt
      
      * Fix warning and update tests
      
      * Remove unnecessary allow deprecated
      
      * Remove use of trait Store
      
      * Fix mismatch in expected output
      
      * Minor update to warning message for deprecation of generate_store with Store trait attribute
      
      * Fixes as per review comments
      
      * Fixes as per review suggestions
      
      * Remove use of Store trait from core-fellowship pallet
      
      * Fix type in store_trait.rs
      
      * Fixes as pre review comment
      2009821c
    • Jegor Sidorenko's avatar
      [NFTs] Rework permissions model (#13482) · f6b9e056
      Jegor Sidorenko authored
      * Disallow admin to transfer or burn items he doesn't own
      
      * lock_collection should be accessible by collection's owner only
      
      * Allow admin to access lock_item_properties()
      
      * Fix do_lock_item_properties
      
      * Move update_mint_settings() to Issuer
      
      * Rename check_owner to check_origin
      
      * Typo
      
      * Make admin to be in charge of managing the metadata
      
      * Make admin the main attributes manager
      
      * offchain mint should be signed by Issuer
      
      * Remove the special case when the Issuer calls the mint() function
      
      * Rework burn and destroy methods
      
      * Return back item_metadatas
      
      * Don't repatriate the deposit on transfer
      
      * A bit more tests
      
      * One more test
      
      * Add migration
      
      * Chore
      
      * Clippy
      
      * Rename to owned_item
      
      * Address comments
      
      * Replace .filter_map with .find_map
      
      * Improve version validation in pre_upgrade()
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts
      
      ---------
      
      Co-authored-by: parity-processbot <>
      f6b9e056
  4. Mar 11, 2023
  5. Mar 10, 2023
  6. Mar 09, 2023
  7. Mar 07, 2023
    • Davide Galassi's avatar
      Offences report system rework (#13425) · 9dd10d13
      Davide Galassi authored
      * Experiments with common equivocation trait
      
      * Improved equivocation trait
      
      * Fix grandpa equivocation implementation
      
      * Remove some cruft
      
      * Remove some more cruft
      
      * More generic naming
      
      * Simplification of offences manipilation
      
      * More refactory
      
      * Some prograss with the encapsulation of offence report system
      
      * Finally unit type works as a universal null report system
      
      * Align substrate node code
      
      * Further simplification
      
      * Fix test utils
      
      * Remove not required associated type
      
      * Fix benches
      
      * Rollback to prev field name
      
      * Box big params
      
      * Fix typo
      
      * Remove new tag computation
      
      * Remove default implementations
      
      * Better docs
      
      * Return 'Result' instead of bool
      
      * Change offence report system return types
      
      * Some renaming and documentation
      
      * Improve documentation
      
      * More abstract offence report system
      
      * Rename 'consume_evidence' to 'process_evidence'
      
      * Further docs refinements
      
      * Doc for dummy offence report
      
      * Fix rustdoc
      
      * Fix after master merge
      
      * Apply code review suggestions
      
      * Improve docs
      9dd10d13
    • Oliver Tale-Yazdi's avatar
      `MessageQueue`: unknit permanently overweight books (#13528) · e16f1511
      Oliver Tale-Yazdi authored
      
      
      * Unknit permanently overweight books
      
      A book with only permanently overweight messages should be unkit
      from the ready ring. This does currently not happen since perm.
      overweight messages are not counted as "processed" and therefore
      not increase the "total_processed" counter.
      
      This is only a problem when the next and only message that is
      processed is overweight. Eventually this should resolve itself
      when another non-overweight message is enqueued and processed.
      But for correctness it should be unknitted.
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Add tests
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * fmt
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * One more tests
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet-message-queue
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: command-bot <>
      e16f1511
    • afm's avatar
      Pub enum runtime to pub struct runtime (#13250) · d86a3263
      afm authored
      
      
      * pub enum Runtime -> pub struct Runtime
      
      * changing some more
      
      * fmt
      
      * updating *.stderr files
      
      * re-run trybuild after rust update
      
      * keep a test file for `pub enum Runtime`
      
      * Delete construct_runtime_2.rs
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: parity-processbot <>
      d86a3263
    • Koute's avatar
      Switch to the `blake2b_simd` crate in `sp-core-hashing` (#13548) · 03158cd4
      Koute authored
      * Switch to the `blake2b_simd` crate in `sp-core-hashing`
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev frame_benchmarking
      
      ---------
      
      Co-authored-by: command-bot <>
      03158cd4
  8. Mar 06, 2023
  9. Mar 04, 2023
  10. Mar 03, 2023
  11. Mar 02, 2023
  12. Mar 01, 2023
  13. Feb 28, 2023
  14. Feb 27, 2023
    • Bastian Köcher's avatar
      `pallet-treasury`: Ensure we respect `max_amount` for spend across batch calls (#13468) · 6aa4127a
      Bastian Köcher authored
      * `pallet-treasury`: Ensure we respect `max_amount` for spend across batch calls
      
      When calling `spend` the origin defines the `max_amount` of tokens it is allowed to spend. The
      problem is that someone can send a `batch(spend, spend)` to circumvent this restriction as we don't
      check across different calls that the `max_amount` is respected. This pull request fixes this
      behavior by introducing a so-called dispatch context. This dispatch context is created once per
      outer most `dispatch` call. For more information see the docs in this pr. The treasury then uses
      this dispatch context to attach information about already spent funds per `max_amount` (we assume
      that each origin has a different `max_amount` configured). So, a `batch(spend, spend)` is now
      checked to stay inside the allowed spending bounds.
      
      Fixes: https://github.com/paritytech/substrate/issues/13167
      
      * Import `Box` for wasm
      
      * FMT
      6aa4127a
    • Muharem Ismailov's avatar
      constructor for MemberRecord (#13473) · 85a5a5db
      Muharem Ismailov authored
      85a5a5db
    • Davide Galassi's avatar
      Move grandpa crates to consensus folder (#13458) · 40c36c0c
      Davide Galassi authored
      * Move grandpa under consensus dir
      * Rename grandpa folder
      * Finish grandpa renaming
      * Minor tweaks
      * Cargo fmt
      * Adjust path to chain spec
      40c36c0c
  15. Feb 25, 2023
  16. Feb 23, 2023
  17. Feb 22, 2023
    • Sam Johnson's avatar
      generation of real benchmark functions for benchmarking v2 (#13224) · 55ff791d
      Sam Johnson authored
      
      
      * function generation with _name working, need to modify signature
      
      * WIP
      
      * support custom BenchmarkResult<T> type
      
      * full support for BenchmarkResult<T> on benchmark function defs
      
      * support () return type for benchmark function defs that don't use ?
      
      * uncomment
      
      * fix where clause handling
      
      * fix benchmark function call bodies
      
      * proper parsing of return type
      
      * add UI tests for bad return type
      
      * fix detection of missing last_stmt with defined return type
      
      * UI tests covering missing last_stmt
      
      * properly detect and complain about empty benchmark function defs
      
      * fix missing Comma in Result<T, BenchmarkError> parsing + test
      
      * add additional UI test
      
      * allow complex path for BenchmarkResult and BenchmarkError in fn defs
      
      * add UI tests covering complex path for BenchmarkResult, BenchmarkError
      
      * retain doc comments and attributes
      
      * also add attributes to struct
      
      * add docs for benchmark function definition support
      
      * fix imports on benchmark example
      
      * fix issue with unused variables in extrinsic call fn def
      
      * fix up docs
      
      * remove support for v2::BenchmarkResult because it was confusing
      
      * fix typo
      
      * remove ability to use custom T for Result<T, BenchmarkError> in v2
      
      * use missing call error instead of empty_fn()
      
      * remove unneeded match statement
      
      * Add a proper QED
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * fix other QED
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * cargo fmt
      
      * add an explicit error for non TypePath as return type
      
      * tweak error warning and add a UI test for non TypePath return
      
      * remove comment
      
      * add docs about T and I generic params
      
      * improve docs referring to section "below"
      
      * pull out return type checking logic into its own function
      
      * pull out params parsing into its own function
      
      * pull out call_def parsing into its own function
      
      * add doc comment for missing_call()
      
      * replace spaces with tabs
      
      * add a result-based example to the benchmarking examples
      
      ---------
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      55ff791d