1. Apr 26, 2024
  2. Apr 20, 2024
    • Ankan's avatar
      Allow privileged virtual bond in Staking pallet (#3889) · e504c41a
      Ankan authored
      This is the first PR in preparation for
      https://github.com/paritytech/polkadot-sdk/issues/454.
      
      ## Follow ups:
      - https://github.com/paritytech/polkadot-sdk/pull/3904.
      - https://github.com/paritytech/polkadot-sdk/pull/3905.
      
      Overall changes are documented here (lot more visual 😍):
      https://hackmd.io/@ak0n/454-np-governance
      
      [Maybe followup](https://github.com/paritytech/polkadot-sdk/issues/4217)
      with migration of storage item `VirtualStakers` as a bool or enum in
      `Ledger`.
      
      ## Context
      We want to achieve a way for a user (`Delegator`) to delegate their
      funds to another account (`Agent`). Delegate implies the funds are
      locked in delegator account itself. Agent can act on behalf of delegator
      to stake directly on Staking pallet.
      
      The delegation feature is added to Staking via another pallet
      `delegated-staking` worked on
      [here](https://github.com/paritytech/polkadot-sdk/pull/3904).
      
      ## Introduces:
      ### StakingUnchecked Trait
      As the name implies, this trait allows unchecked (non-locked) mutation
      of staking ledger. These apis are only meant to be used by other pallets
      in the runtime and should not be exposed directly to user code path.
      Also related: https://github.com/paritytech/polkadot-sdk/issues/3888.
      
      ### Virtual Bond
      Allows other pallets to stake via staking pallet while managing the
      locks on these accounts themselves. Introduces another storage
      `VirtualStakers` that whitelist these accounts.
      
      We also restrict virtual stakers to set reward account as themselves.
      Since the account has no locks, we cannot support compounding of
      rewards. Conservatively, we require them to set a separate account
      different from the staker. Since these are code managed, it should be
      easy for another pallet to redistribute reward and rebond them.
      
      ### Slashes
      Since there is no actual lock maintained by staking-pallet for virtual
      stakers, this pallet does not apply any slashes. It is then important
      for pallets managing virtual stakers to listen to slashing events and
      apply necessary slashes.
      e504c41a
  3. Mar 26, 2024
    • Dcompoze's avatar
      Fix spelling mistakes across the whole repository (#3808) · 002d9260
      Dcompoze authored
      **Update:** Pushed additional changes based on the review comments.
      
      **This pull request fixes various spelling mistakes in this
      repository.**
      
      Most of the changes are contained in the first **3** commits:
      
      - `Fix spelling mistakes in comments and docs`
      
      - `Fix spelling mistakes in test names`
      
      - `Fix spelling mistakes in error messages, panic messages, logs and
      tracing`
      
      Other source code spelling mistakes are separated into individual
      commits for easier reviewing:
      
      - `Fix the spelling of 'authority'`
      
      - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
      
      - `Fix the spelling of 'prev_enqueud_messages'`
      
      - `Fix the spelling of 'endpoint'`
      
      - `Fix the spelling of 'children'`
      
      - `Fix the spelling of 'PenpalSiblingSovereignAccount'`
      
      - `Fix the spelling of 'PenpalSudoAccount'`
      
      - `Fix the spelling of 'insufficient'`
      
      - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
      
      - `Fix the spelling of 'subtracted'`
      
      - `Fix the spelling of 'CandidatePendingAvailability'`
      
      - `Fix the spelling of 'exclusive'`
      
      - `Fix the spelling of 'until'`
      
      - `Fix the spelling of 'discriminator'`
      
      - `Fix the spelling of 'nonexistent'`
      
      - `Fix the spelling of 'subsystem'`
      
      - `Fix the spelling of 'indices'`
      
      - `Fix the spelling of 'committed'`
      
      - `Fix the spelling of 'topology'`
      
      - `Fix the spelling of 'response'`
      
      - `Fix the spelling of 'beneficiary'`
      
      - `Fix the spelling of 'formatted'`
      
      - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
      
      - `Fix the spelling of 'succeeded'`
      
      - `Fix the spelling of 'reopened'`
      
      - `Fix the spelling of 'proposer'`
      
      - `Fix the spelling of 'InstantiationNonce'`
      
      - `Fix the spelling of 'depositor'`
      
      - `Fix the spelling of 'expiration'`
      
      - `Fix the spelling of 'phantom'`
      
      - `Fix the spelling of 'AggregatedKeyValue'`
      
      - `Fix the spelling of 'randomness'`
      
      - `Fix the spelling of 'defendant'`
      
      - `Fix the spelling of 'AquaticMammal'`
      
      - `Fix the spelling of 'transactions'`
      
      - `Fix the spelling of 'PassingTracingSubscriber'`
      
      - `Fix the spelling of 'TxSignaturePayload'`
      
      - `Fix the spelling of 'versioning'`
      
      - `Fix the spelling of 'descendant'`
      
      - `Fix the spelling of 'overridden'`
      
      - `Fix the spelling of 'network'`
      
      Let me know if this structure is adequate.
      
      **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
      `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
      as it is.
      
      ~~**Note:** In some places the term `Receival` is used to refer to
      message reception, IMO `Reception` is the correct word here, but I left
      it as it is.~~
      
      ~~**Note:** In some places the term `Overlayed` is used instead of the
      more acceptable version `Overlaid` but I also left it as it is.~~
      
      ~~**Note:** In some places the term `Applyable` is used instead of the
      correct version `Applicable` but I also left it as it is.~~
      
      **Note:** Some usage of British vs American english e.g. `judgement` vs
      `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
      are both present in different places, but I suppose that's
      understandable given the number of contributors.
      
      ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
      triggers errors in CI when I make changes to it, so I left it as it
      is.~~
      002d9260
  4. Mar 18, 2024
    • Squirrel's avatar
      sp-std removal from substrate/primitives (#3274) · 1b5f4243
      Squirrel authored
      
      
      This PR removes sp-std crate from substrate/primitives sub-directories.
      
      For now crates that have `pub use` of sp-std or export macros that would
      necessitate users of the macros to `extern crate alloc` have been
      excluded from this PR.
      
      There should be no breaking changes in this PR.
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      1b5f4243
  5. Feb 08, 2024
    • Gonçalo Pestana's avatar
      Fixes `TotalValueLocked` out of sync in nomination pools (#3052) · aac07af0
      Gonçalo Pestana authored
      The `TotalLockedValue` storage value in nomination pools pallet may get
      out of sync if the staking pallet does implicit withdrawal of unlocking
      chunks belonging to a bonded pool stash. This fix is based on a new
      method in the `OnStakingUpdate` traits, `on_withdraw`, which allows the
      nomination pools pallet to adjust the `TotalLockedValue` every time
      there is an implicit or explicit withdrawal from a bonded pool's stash.
      
      This PR also adds a migration that checks and updates the on-chain TVL
      if it got out of sync due to the bug this PR fixes.
      
      **Changes to `trait OnStakingUpdate`**
      
      In order for staking to notify the nomination pools pallet that chunks
      where withdrew, we add a new method, `on_withdraw` to the
      `OnStakingUpdate` trait. The nomination pools pallet filters the
      withdraws that are related to bonded pool accounts and updates the
      `TotalValueLocked` accordingly.
      
      **Others**
      - Adds try-state checks to the EPM/staking e2e tests
      - Adds tests for auto withdrawing in the context of nomination pools
      
      **To-do**
      - [x] check if we need a migration to fix the current `TotalValueLocked`
      (run try-runtime)
      - [x] migrations to fix the current on-chain TVL value 
      
        **Kusama**:
      ```
      TotalValueLocked: 99.4559 kKSM
      TotalValueLocked (calculated) 99.4559 kKSM
      ```
      ️ **Westend**:
      ```
      TotalValueLocked: 18.4060 kWND
      TotalValueLocked (calculated) 18.4050 kWND
      ```
      **Polkadot**: TVL not released yet.
      
      Closes https://github.com/paritytech/polkadot-sdk/issues/3055
      
      
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      aac07af0
  6. Nov 01, 2023
    • Ankan's avatar
      [NPoS] Paging reward payouts in order to scale rewardable nominators (#1189) · 00b85c51
      Ankan authored
      helps https://github.com/paritytech/polkadot-sdk/issues/439.
      closes https://github.com/paritytech/polkadot-sdk/issues/473.
      
      PR link in the older substrate repository:
      https://github.com/paritytech/substrate/pull/13498.
      
      # Context
      Rewards payout is processed today in a single block and limited to
      `MaxNominatorRewardedPerValidator`. This number is currently 512 on both
      Kusama and Polkadot.
      
      This PR tries to scale the nominators payout to an unlimited count in a
      multi-block fashion. Exposures are stored in pages, with each page
      capped to a certain number (`MaxExposurePageSize`). Starting out, this
      number would be the same as `MaxNominatorRewardedPerValidator`, but
      eventually, this number can be lowered through new runtime upgrades to
      limit the rewardeable nominators per dispatched call instruction.
      
      The changes in the PR are backward compatible.
      
      ## How payouts would work like after this change
      Staking exposes two calls, 1) the existing `payout_stakers` and 2)
      `payout_stakers_by_page`.
      
      ### payout_stakers
      This remains backward compatible with no signature change. If for a
      given era a validator has multiple pages, they can call `payout_stakers`
      multiple times. The pages are executed in an ascending sequence and the
      runtime takes care of preventing double claims.
      
      ### payout_stakers_by_page
      Very similar to `payout_stakers` but also accepts an extra param
      `page_index`. An account can choose to payout rewards only for an
      explicitly passed `page_index`.
      
      **Lets look at an example scenario**
      Given an active validator on Kusama had 1100 nominators,
      `MaxExposurePageSize` set to 512 for Era e. In order to pay out rewards
      to all nominators, the caller would need to call `payout_stakers` 3
      times.
      
      - `payout_stakers(origin, stash, e)` => will pay the first 512
      nominators.
      - `payout_stakers(origin, stash, e)` => will pay the second set of 512
      nominators.
      - `payout_stakers(origin, stash, e)` => will pay the last set of 76
      nominators.
      ...
      - `payout_stakers(origin, stash, e)` => calling it the 4th time would
      return an error `InvalidPage`.
      
      The above calls can also be replaced by `payout_stakers_by_page` and
      passing a `page_index` explicitly.
      
      ## Commission note
      Validator commission is paid out in chunks across all the pages where
      each commission chunk is proportional to the total stake of the current
      page. This implies higher the total stake of a page, higher will be the
      commission. If all the pages of a validator's single era are paid out,
      the sum of commission paid to the validator across all pages should be
      equal to what the commission would have been if we had a non-paged
      exposure.
      
      ### Migration Note
      Strictly speaking, we did not need to bump our storage version since
      there is no migration of storage in this PR. But it is still useful to
      mark a storage upgrade for the following reasons:
      
      - New storage items are introduced in this PR while some older storage
      items are deprecated.
      - For the next `HistoryDepth` eras, the exposure would be incrementally
      migrated to its corresponding paged storage item.
      - Runtimes using staking pallet would strictly need to wait at least
      `HistoryDepth` eras with current upgraded version (14) for the migration
      to complete. At some era `E` such that `E >
      era_at_which_V14_gets_into_effect + HistoryDepth`, we will upgrade to
      version X which will remove the deprecated storage items.
      In other words, it is a strict requirement that E<sub>x</sub> -
      E<sub>14</sub> > `HistoryDepth`, where
      E<sub>x</sub> = Era at which deprecated storages are removed from
      runtime,
      E<sub>14</sub> = Era at which runtime is upgraded to version 14.
      - For Polkadot and Kusama, there is a [tracker
      ticket](https://github.com/paritytech/polkadot-sdk/issues/433) to clean
      up the deprecated storage items.
      
      ### Storage Changes
      
      #### Added
      - ErasStakersOverview
      - ClaimedRewards
      - ErasStakersPaged
      
      #### Deprecated
      The following can be cleaned up after 84 eras which is tracked
      [here](https://github.com/paritytech/polkadot-sdk/issues/433).
      
      - ErasStakers.
      - ErasStakersClipped.
      - StakingLedger.claimed_rewards, renamed to
      StakingLedger.legacy_claimed_rewards.
      
      ### Config Changes
      - Renamed MaxNominatorRewardedPerValidator to MaxExposurePageSize.
      
      ### TODO
      - [x] Tracker ticket for cleaning up the old code after 84 eras.
      - [x] Add companion.
      - [x] Redo benchmarks before merge.
      - [x] Add Changelog for pallet_staking.
      - [x] Pallet should be configurable to enable/disable paged rewards.
      - [x] Commission payouts are distributed across pages.
      - [x] Review documentation thoroughly.
      - [x] Rename `MaxNominatorRewardedPerValidator` ->
      `MaxExposurePageSize`.
      - [x] NMap for `ErasStakersPaged`.
      - [x] Deprecate ErasStakers.
      - [x] Integrity tests.
      
      ### Followup issues
      [Runtime api for deprecated ErasStakers storage
      item](https://github.com/paritytech/polkadot-sdk/issues/426
      
      )
      
      ---------
      
      Co-authored-by: default avatarJavier Viola <[email protected]>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: command-bot <>
      00b85c51
  7. Oct 15, 2023
    • Gonçalo Pestana's avatar
      Refactor staking ledger (#1484) · 8ee4042c
      Gonçalo Pestana authored
      This PR refactors the staking ledger logic to encapsulate all reads and
      mutations of `Ledger`, `Bonded`, `Payee` and stake locks within the
      `StakingLedger` struct implementation.
      
      With these changes, all the reads and mutations to the `Ledger`, `Payee`
      and `Bonded` storage map should be done through the methods exposed by
      StakingLedger to ensure the data and lock consistency of the operations.
      The new introduced methods that mutate and read Ledger are:
      
      - `ledger.update()`: inserts/updates a staking ledger in storage;
      updates staking locks accordingly (and ledger.bond(), which is synthatic
      sugar for ledger.update())
      - `ledger.kill()`: removes all Bonded and StakingLedger related data for
      a given ledger; updates staking locks accordingly;
      `StakingLedger::get(account)`: queries both the `Bonded` and `Ledger`
      storages and returns a `Option<StakingLedger>`. The pallet impl exposes
      fn ledger(account) as synthatic sugar for `StakingLedger::get(account)`.
      
      Retrieving a ledger with `StakingLedger::get()` can be done by providing
      either a stash or controller account. The input must be wrapped in a
      `StakingAccount` variant (Stash or Controller) which is treated
      accordingly. This simplifies the caller API but will eventually be
      deprecated once we completely get rid of the controller account in
      staking. However, this refactor will help with the work necessary when
      completely removing the controller.
      
      Other goals:
      
      - No logical changes have been introduced in this PR;
      - No breaking changes or updates in wallets required;
      - No new storage items or need to perform storage migrations;
      - Centralise the changes to bonds and ledger updates to simplify the
      OnStakingUpdate updates to the target list (related to
      https://github.com/paritytech/polkadot-sdk/issues/443)
      
      Note: it would be great to prevent or at least raise a warning if
      `Ledger<T>`, `Payee<T>` and `Bonded<T>` storage types are accessed
      outside the `StakingLedger` implementation. This PR should not get
      blocked by that feature, but there's a tracking issue here
      https://github.com/paritytech/polkadot-sdk/issues/149
      
      Related and step towards
      https://github.com/paritytech/polkadot-sdk/issues/443
      8ee4042c
  8. Oct 01, 2023
  9. Aug 30, 2023
  10. Jul 09, 2023
  11. Jun 29, 2023
  12. Jun 01, 2023
    • Michal Kucharczyk's avatar
      frame: support for serde added (#14261) · dc716127
      Michal Kucharczyk authored
      
      
      * frame: support for serde added
      
      - enabled `serde` features in dependent crates, no gate feature introduced, linker should do the job and strip unused code.
      
      - frame::staking: added impl of `serde::Serialize, serde::Deserialize` for `enum Forcing`
      
      - primitives::runtime: impl_opaque_keys macro provides `Serialize/Deserialize` impl if `serde` is enabled
      
      - primitives::staking: added impl of `serde::Serialize`, `serde::Deserialize` for `enum StakerStatus`
      
      * frame::support: serde for pallets' GenesisConfig enabled in no-std
      
      * Cargo.lock updated
      
      * Update primitives/staking/Cargo.toml
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * fix
      
      * Cargo.lock update + missed serde/std in beefy
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      dc716127
  13. Apr 27, 2023
  14. Apr 15, 2023
  15. 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
  16. Feb 21, 2023
    • Vivek Pandya's avatar
      Remove years from copyright notes. (#13415) · bc53b9a0
      Vivek Pandya authored
      * Change copyright year to 2023 from 2022
      
      * Fix incorrect update of copyright year
      
      * Remove years from copy right header
      
      * Fix remaining files
      
      * Fix typo in a header and remove update-copyright.sh
      bc53b9a0
  17. Dec 13, 2022
    • Bastian Köcher's avatar
      Fixup some wrong dependencies (#12899) · c0c8d630
      Bastian Köcher authored
      * Fixup some wrong dependencies
      
      Dev dependencies should not appear in the feature list. If features are required, they should be
      directly enabled for the `dev-dependency`.
      
      * More fixups
      
      * Fix fix
      
      * Remove deprecated feature
      
      * Make all work properly and nice!!
      
      * FMT
      
      * Fix formatting
      c0c8d630
  18. Oct 29, 2022
  19. Aug 02, 2022
  20. Jun 13, 2022
    • Kian Paimani's avatar
      Allow nomination pools to chill + fix dismantle scenario (#11426) · ad1d1716
      Kian Paimani authored
      
      
      * make pool roles optional
      
      * undo lock file changes?
      
      * add migration
      
      * add the ability for pools to chill themselves
      
      * boilerplate of tests
      
      * somewhat stable, but I think I found another bug as well
      
      * Fix it all
      
      * Add more more sophisticated test + capture one more bug.
      
      * Update frame/staking/src/lib.rs
      
      * reduce the diff a little bit
      
      * add some test for the slashing bug
      
      * cleanup
      
      * fix lock file?
      
      * Fix
      
      * fmt
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/src/mock.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Fix build
      
      * fix some fishy tests..
      
      * add one last integrity check for MinCreateBond
      
      * remove bad assertion -- needs to be dealt with later
      
      * nits
      
      * fix tests and add benchmarks for chill
      
      * remove stuff
      
      * fix benchmarks
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * remove defensive
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      ad1d1716
  21. May 10, 2022
  22. Apr 27, 2022
    • Zeke Mostov's avatar
      Nomination Pools (#10694) · 247f33dc
      Zeke Mostov authored
      
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Add admin roles and make some calls permissionless
      
      * Destroy pool in withdraw unbonded
      
      * Add docs on pool admin
      
      * Fixup tests
      
      * Test unbond_other permissionless scenarios
      
      * Test withdraw unbonded permissionless
      
      * Test only can join open pools
      
      * Move unsafe set state to mock
      
      * Test: nominate_works
      
      * Add bounds: MinJoinBond, MinCreateBond, MaxPools
      
      * Test MinCreateBond, MinJoinBond, MaxPools
      
      * Add post checks to tests
      
      * Remove some TODOs
      
      * Setup weight infrastructure
      
      * Benchmark claim_payout
      
      * Benchmark create
      
      * Benchmark nominate
      
      * Benchmark join
      
      * Benchmark unbond_other
      
      * Refactor join benchmark to use scenario setup
      
      * Clean up and address warnings
      
      * Basic withdraw unbonded benchmarks
      
      * Refactor nominate benchmark
      
      * Refactor claim payout
      
      * Add feature sp-staking/runtime-benchmarks
      
      * Get node runtime to compile
      
      * Get node to run
      
      * Make claim_payout bench work with node
      
      * Make pool_withdraw_unbonded bench work with node
      
      * Make withdraw_unbonded_other work with node runtime'
      
      * Make create benchmark work with node
      
      * Make nominate benchmark work with node runtime
      
      * WiP new benchmark crate
      
      * Implement initial mock for benchmarks
      
      * Establish benchmark setup logic
      
      * Get claim payout and nominate benchmarks working
      
      * Remove pool bench utils; make struct fields pub insteaad
      
      * Get more benchmarks to work; trim interface trait
      
      * Some more top level docs
      
      * Finish tranistion benchmarks to crate
      
      * Hook up benchmark pallet to node runtime
      
      * Get benches to work with node runtime
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Benchmark withdraw_unbonded_other_kill
      
      * Delete old benchmarking files
      
      * Refunds for withdraw_unbonded
      
      * Remove some TODOs
      
      * 'Don't return an option for the current_era'
      
      * Streamline extrinsic docs
      
      * small docs tweaks
      
      * Refactor ledger::slash
      
      * Add on_slash impl for nomination pools
      
      * slash refactor wip
      
      * WIP slash working
      
      * DRY Ledger::stash
      
      * Fix slash saturation
      
      * Remove unused param from slash
      
      * Docs and warnings
      
      * Test ledger::slash
      
      * save progress
      
      * Introduce counter for delegators
      
      * Add tests for max delegator errors
      
      * Reproducible account ids
      
      * Adapt tests to new account id format
      
      * Simplify create_accounts api
      
      * Fix staking tests
      
      * Save PerBill slash impl before removing
      
      * Rever ledger slash test
      
      * Get node runtime to work
      
      * Organize sub pools by unbond era, not curren era
      
      * staking: Proportional ledger slashing
      
      * Some comment cleanup
      
      * Add more test post checks
      
      * Update frame/staking/src/pallet/mod.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Tests: account for storing unbond era
      
      * Improve docs for staking interface
      
      * Add events Created, Destroyed
      
      * withdraw_unbonded: Remove useless withdraw dust check
      
      * Test: withdraw_unbonded_other_handles_faulty_sub_pool_accounting
      
      * Add extrinsics: set_state_other, set_metadata
      
      * Test: set_state_other_works
      
      * Test: set_metadata_works
      
      * Add benchmarks for set_state_other, set_metadata
      
      * Fix benchmarks
      
      * Add weight info for new extrinsics
      
      * Some feedback
      
      * duo feedback
      
      * Incorporate some more feedback
      
      * integrate more kian feedback
      
      * integrate more kian feedback
      
      * More improvements
      
      * Add destroying_mul
      
      * Make do_reward_payout take refs
      
      * Remove some TODOs
      
      * Add test for saturating
      
      * feedback
      
      * Fix join test
      
      * use `inner` for nested types in nomination pools (#11030)
      
      * Use nested inner type for pool
      
      * make tests and benchmarks work
      
      * remove feat
      
      * all tests work now
      
      * fix node-runtime
      
      * nomination-pools: update benches for new account format (#11033)
      
      * Update benches to new account format
      
      * More sensible seeds
      
      * bring back rward account sanity check
      
      * Comment
      
      * Add extrinsic set_configs (#11038)
      
      * Better sanity checks for nomination pools  (#11042)
      
      * new sanity checks, few other changes
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * nomination-pools: Fix state event regression + benches (#11045)
      
      * new sanity checks, few other changes
      
      * Fix benches, improve sanity check
      
      * Remove useless clear storage in benchmarking
      
      * Set state
      
      * Save
      
      * Doc
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarkianenigma <[email protected]>
      
      * FMT
      
      * Try fill in all staking configs
      
      * Fix build
      
      * More changes to nomination pools (#11050)
      
      * new sanity checks, few other changes
      
      * some last touches as a whole
      
      * Apply suggestions from code review
      
      * Remove redundant event
      
      * Improve unbond_other error handling
      
      * Remove comment
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      Co-authored-by: default avataremostov <[email protected]>
      
      * Remove sanity module and some TODOs
      
      * round of feedback and imp from kian
      
      * Add TODO for ED QoL at reward pool creation
      
      * Make sure reward pool never gets dusted
      
      * Improve error type
      
      * demonstrate per_thing usage
      
      * Update sanity check & fix create_works
      
      * Improve test ext pool creation & fix some more tests
      
      * Try revert
      
      * Revert "Try revert"
      
      This reverts commit c044c94730e1a370eecd8f5b2c4f632835913063.
      
      * Revert "Improve test ext pool creation & fix some more tests"
      
      This reverts commit 1e862a64a7423479260c6e5ad1bd4c8c95651f3a.
      
      * Revert "Update sanity check & fix create_works"
      
      This reverts commit 568a7b727687e4d585e2796afc638df97b83c632.
      
      Roll back reward account funding
      
      * Revert "Improve error type"
      
      This reverts commit 4b993ee601a037e7a44e4a49bbfd60cf45b38b78.
      
      * Revert "Make sure reward pool never gets dusted"
      
      This reverts commit e7a3eb45bdfd156d3f6d94d194e988032ebbc593.
      
      revert
      
      * Update some tests
      
      * FMT
      
      * Test that era offset works correctly
      
      * Update mocks
      
      * Remove unnescary docs
      
      * Doc updates
      
      * Update calculate_delegator_payout_works_with_a_pool_of_1
      
      * Fix test: claim_payout_works
      
      * do_reward_payout_correctly_sets_pool_state_to_destroying
      
      * Remove test do_reward_payout_errors_correctly
      
      * Fix test: do_reward_payout_works
      
      * Fix test: create_errors_correctly
      
      * Fix test: create works
      
      * Fix test: unbond_other_of_3_works
      
      * Ensure that ED is transferred into reward pool upon creation
      
      * WIP pool lifecycle test
      
      * Fix benchmarks
      
      * Add sanity check for ED + reward pools
      
      * `bond_extra` for nomination pools (#11100)
      
      * bond_extra for nomination pools
      
      * Update frame/nomination-pools/src/lib.rs
      
      * Update frame/nomination-pools/src/lib.rs
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * add benchmarks
      
      * remove the min logic of bond_extra
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * FMT
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * make it compile end to end
      
      * Update some type viz
      
      * Update kick terminology
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      * Cache bonded account when creating pool
      
      * Add bond extra weight stuff
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update docs for pool withdraw unbonded
      
      * Update docs for unbond
      
      * Improve Doc
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/Cargo.toml
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Improve Docs
      
      * Some docs improvements
      
      * fmt
      
      * Remove unlock_era
      
      * Fix accidental frame-support regression
      
      * Fix issue with transactions in tests
      
      * Fix doc links
      
      * Make sure result in test is used
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Fix can toggle state
      
      * Account for new_funds in ok to be open
      
      * Update docs: ok_to_withdraw_unbonded_other_with
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Remove some staking comments
      
      * Rename SubPoolsWithEra to UnbondingPoolsWithEra
      
      * Use validators length for benchmarks
      
      * Use metadata length for benchmarks
      
      * Remove debug assert eq
      
      * docs
      
      * Fix test: withdraw_unbonded_other_errors_correctly
      
      * Fix check for having enough balance to create the pool
      
      * Bond event for pool creation
      
      * Ok to be open
      
      * FMT
      
      * Remove _other postfix
      
      * Update frame/staking/src/lib.rs
      
      * Adjust tests to account for only remove when < ED
      
      * Remove stale TODOs
      
      * Remove dupe test
      
      * Fix build
      
      * Make sure to convert to u256 so we don't saturate
      
      * Refund depositor with reward pool fee
      
      * FMT
      
      * Remove reachable defensive
      
      * Use compact encoding for relevant extrinsics
      
      * Remove unnescary make_free_be for cleaning reward account
      
      * Add not to maintainers for reward account accounting
      
      * Remove note to maintainers from public doc
      
      * Make sure all configs have currency balance
      
      * Avoid saturation in balance_to_unbond
      
      * Partial Unbonding for Nomination Pools (#11212)
      
      * first draft of partial unbonding for pools
      
      * remove option
      
      * Add some more tests and fix issues
      
      * Fix all tests
      
      * simplify some tests
      
      * Update frame/nomination-pools/src/mock.rs
      
      * remove clone
      
      * rename to delegator_unbonding_eras
      
      * Update frame/nomination-pools/src/tests.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Update frame/nomination-pools/src/tests.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Update frame/nomination-pools/src/tests.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * remove pub
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * undo
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * leftovers
      
      * fix invariant
      
      * Fix the depositor assumption
      
      * round of self-review
      
      * little bit more cleanup
      
      * Update frame/nomination-pools/src/mock.rs
      
      * Apply suggestions from code review
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Fix interpretation of MinCreateBond
      
      * controvesial refactor
      
      * rename
      
      * make everything build
      
      * add TODO about killing the reward account
      
      * Update frame/nomination-pools/src/lib.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Update frame/nomination-pools/src/lib.rs
      
      * last self-review
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * Update Cargo.lock
      
      * Rename Delegator to PoolMember
      
      * fmt
      
      * Get runtime to build with runtime-benchmarks feature
      
      * Update Cargo.lock
      
      * Fix asserts to work in more scenarios
      
      * gte not gt
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Update frame/staking/src/mock.rs
      
      * Update frame/nomination-pools/src/lib.rs
      
      * Update frame/staking/src/slashing.rs
      
      * Apply suggestions from code review
      
      * fmt
      
      * Fix some tests
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      247f33dc
  23. Apr 21, 2022
    • Zeke Mostov's avatar
      staking: Proportional ledger slashing (#10982) · e0bf4f36
      Zeke Mostov authored
      
      
      * staking: Proportional ledger slashing
      
      * Some comment cleanup
      
      * Update frame/staking/src/pallet/mod.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Fix benchmarks
      
      * FMT
      
      * Try fill in all staking configs
      
      * round of feedback and imp from kian
      
      * demonstrate per_thing usage
      
      * Update some tests
      
      * FMT
      
      * Test that era offset works correctly
      
      * Update mocks
      
      * Remove unnescary docs
      
      * Remove unlock_era
      
      * Update frame/staking/src/lib.rs
      
      * Adjust tests to account for only remove when < ED
      
      * Remove stale TODOs
      
      * Remove dupe test
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      e0bf4f36
  24. Jan 17, 2022
  25. Jan 03, 2022
  26. Nov 17, 2021
  27. Sep 15, 2021
    • Andrew Jones's avatar
      Enrich metadata with type information (#8615) · 49b6dfd2
      Andrew Jones authored
      
      
      * Cargo.lock after merge
      
      * Restore scale-info feature
      
      * Fully qualify TypeInfo derive
      
      * Skip PendingSwap T
      
      * Add missing skip_type_params attr
      
      * metadata docs features
      
      * Reduce pallet event attribute to struct
      
      * Cargo.lock
      
      * Update frame/balances/src/tests_composite.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Line widths check
      
      * Cargo.lock
      
      * Add scale-info/std
      
      * Update frame/system/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Use `skip_type_params` to remove `TypeInfo` requirements on checks
      
      * Revert "Remove unused Call metadata stuff"
      
      This reverts commit 41311f85
      
      * Skip BalanceSwapAction type parameter
      
      * Remove unused event metadata macro
      
      * Update frame-metadata
      
      * Update primitives/npos-elections/compact/src/codec.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Manual TypeInfo for Header
      
      * Remove TypeInfo requirement for consts in BoundedVec etc.
      
      * Another TypeInfo bound removed
      
      * review: fix indentation
      
      * TypeInfo impls for Identity types
      
      * Add some todos to add custom TypeInfo impls
      
      * Update frame/support/procedural/src/pallet/expand/pallet_struct.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Add some todos to add custom TypeInfo impls
      
      * Add a test for manual Data TypeInfo impl
      
      * Add custom TypeInfo impl for Vote
      
      * Era custom TypeInfo crimes
      
      * Revert finality-grandpa version to 0.14.z
      
      * review: renamed module to pallet_constants_metadata
      
      * New line at end of file
      
      * Add missing scale-info/std
      
      * Update frame/support/src/storage/types/mod.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Remove StorageEntryType::Map unused flag
      
      * Add missing scale-info dependency after merge
      
      * SignedExtension::AdditionalSigned metadata
      
      * Update frame-metadata, use abbreviated docs and args fields
      
      * Update frame/example/Cargo.toml
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Add scale_info/std and remove unused scale-info dependency
      
      * Remove scale-info dependency
      
      * Remove treasury pallet::metadata
      
      * Remove redundant Event test
      
      * Add back scale-info as dev dependency
      
      * fix error metadata when no error defined in decl_module
      
      * Add Module3 to tests
      
      * Fix metadata test
      
      * Add docs feature to frame-support test
      
      * WIP fixing pallet metadata test
      
      * Remove redundant FunctionMetadata, FunctionArgumentMetadata as per https://github.com/paritytech/frame-metadata/pull/20
      
      * Use main branch of frame-metadata
      
      * Use patch of scale-info for latest changes
      
      * Use latest patched scale-info
      
      * Manual TypeInfo for DigestItem
      
      * Manual TypeInfo for DigestItem
      
      * Update scale-info
      
      * Skip __Ignore variants for Error, depends on https://github.com/paritytech/scale-info/pull/117
      
      
      
      * Named fields for FRAME v2 pallet Call variants
      
      * Named fields for FRAME v1 pallet Call variants
      
      * Add missing scale-info dependency
      
      * WIP expand benchmark call variant
      
      * fix benchmark with new function
      
      create a new function for each variant of a pallet call.
      This function is called by benchmarking macro in order not to break call
      creation with unnamed argument
      
      * fix tests
      
      * more fix
      
      * Fix staking tests
      
      * Fix offchain workers calls
      
      * Cherry pick rustfmt.toml from master
      
      * cargo +nightly-2021-06-22 fmt --all
      
      * Update to new call variant structs
      
      * More call variant struct updates
      
      * Remove unused import
      
      * More call variant structs
      
      * More call variant structs
      
      * Even more call variant structs
      
      * Mooar variant structs
      
      * Evermore variant structs
      
      * Call variant structs ad infinitum
      
      * Fmt
      
      * More call variants
      
      * Last call variant
      
      * Call variants all done?
      
      * Fix SS58Prefix type
      
      * Potential workaround for BitFlags<IdentityFields> TypeInfo
      
      * Enable docs capturing for Call, Event, and Error types
      
      * Fix IdentityFields TypeInfo
      
      * Remove metadata-docs feature
      
      * Add capture_docs = true for legacy Call, Event and Error types
      
      * Fmt
      
      * Fix metadata test type
      
      * Update benchmarks with call struct variants
      
      * Fmt
      
      * More test fixes
      
      * Fmt
      
      * Fix benches
      
      * Use latest capture_docs attr
      
      * Latest scale_info
      
      * Fmt
      
      * review: change &Vec to &[]
      
      * Remove pallet metadata attr
      
      * review: remove commented out test code
      
      * review: skip_type_params trailing comma suggestion
      
      * Update to scale-info 0.10.0
      
      * Update construct_runtime ui tests, different because of metadata TypeInfo impls
      
      * Add some TypeInfo derives for UI tests
      
      * Update storage ensure span ui stderrs
      
      * Update call argument bound ui tests
      
      Possibly changed because change from tuple to struct variants?
      
      * Add scale-info dev dependency
      
      * Update to latest finality-grandpa release
      
      * review: missing newline
      
      * review: missing scale-info/std
      
      * review: remove duplicate scale-info/std
      
      * review: remove fully qualified TypeInfo
      
      * review: add missing scale-info/std
      
      * review: remove unnecessary imports.
      
      * Fmt
      
      * Use crates.io RC version of frame-metadata
      
      * Remove scale-info/std because it is a dev dependency
      
      * Add missing scale_info dev-dependency for test
      
      * Delete empty metadata folder
      
      * Fix sp_std import
      
      * review: improve manual UncheckedExtrinsic TypeInfo impl
      
      * review: use full scale-info for dev-dependency
      
      * Remove DefaultByteGetter impl
      
      * review: derive TypeInfo for generic header
      
      * Fmt
      
      * Update primitives/runtime/src/generic/unchecked_extrinsic.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Update primitives/runtime/src/generic/unchecked_extrinsic.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Update bin/node/executor/Cargo.toml
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update frame/identity/src/types.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update frame/support/src/dispatch.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Remove redundant derive
      
      * Simplify scale-info dependency
      
      * Strip underscore prefix from call variant struct names
      
      * Another underscore field
      
      * More underscore fields
      
      * Another underscore field
      
      * Update to frame-metadata 14.0.0-rc.2 with combined StorageEntryType::Map
      
      * Fmt
      
      * Revert weights formatting
      
      * Fix up some tests
      
      * Fix up some tests for StorageEntryTypeMetadata
      
      * scale-info dev dependency
      
      * Fix test error
      
      * Add missing TypeInfo derives
      
      * Add back missing scale-info dependency
      
      * Add back missing scale-info dependency
      
      * Fix npos compact impls
      
      * Cargo.lock
      
      * Fmt
      
      * Fix errors
      
      * Fmt
      
      * Fix renamed raw_solution field
      
      * Fix error
      
      * Fmt
      
      * Fix some benchmarks
      
      * Fmt
      
      * Stray R
      
      * Fix
      
      * Add missing TypeInfos
      
      * ui test fix
      
      * Fix line widths
      
      * Revert "ui test fix"
      
      This reverts commit 2d15ec058a216e3f92d713f1174603a2bb1eac65.
      
      * Upgrade to scale-info 0.11.0
      
      * Revert "Upgrade to scale-info 0.11.0"
      
      This reverts commit 047bb179085a0059c36cd20ab405f55cf0867e28.
      
      * Add Runtime type
      
      * Update to scale-info 0.12
      
      * Update to scale-info 1.0
      
      * Update frame-metadata to version 14.0.0
      
      * Patch finality-grandpa until release available
      
      * Fix metadata tests
      
      * Fix metadata tests
      
      * Fmt
      
      * Remove patched finality-grandpa
      
      * Fix tests, use scale_info imports
      
      * Fix pallet tests
      
      * Add BlockNumber TypeInfo bound
      
      * ui test fix
      
      * Cargo.lock
      
      * Remove pallet metadata
      
      * Cargo.lock
      
      * Add missing scale-info dependency
      
      * Remove pallet event metadata
      
      * Fix error
      
      * Fix collective errors
      
      * Semicolol
      
      * Fmt
      
      * Remove another metadata attribute
      
      * Add new variant to custom digest TypeInfo
      
      * Fmt
      
      * Cargo.lock from master
      
      * Remove comma lol
      
      * Fix example call error
      
      * Fix example call error properly
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      49b6dfd2
  28. Jul 21, 2021
    • Bastian Köcher's avatar
      Run cargo fmt on the whole code base (#9394) · 7b56ab15
      Bastian Köcher authored
      * Run cargo fmt on the whole code base
      
      * Second run
      
      * Add CI check
      
      * Fix compilation
      
      * More unnecessary braces
      
      * Handle weights
      
      * Use --all
      
      * Use correct attributes...
      
      * Fix UI tests
      
      * AHHHHHHHHH
      
      * 🤦
      
      * Docs
      
      * Fix compilation
      
      * 🤷
      
      * Please stop
      
      * 🤦
      
       x 2
      
      * More
      
      * make rustfmt.toml consistent with polkadot
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      7b56ab15
  29. May 03, 2021
    • Lohann Paterno Coutinho Ferreira's avatar
      Remove Offence delay (#8414) · ffca28ba
      Lohann Paterno Coutinho Ferreira authored
      
      
      * Removed can_report api from OnOffenceHandler
      
      * Removed DeferredOffences and create a storage migration
      
      * Removed missing comments
      
      * Mock set_deferred_offences and deferred_offences methods
      
      * OnOffenceHandler::on_offence always succeed
      
      * Fix benchmark tests
      
      * Fix runtime-benchmark cfg methods
      
      * Removed 'applied' attribute from Offence event
      
      * refactor deprecated deferred offences getter
      
      * Validate if offences are submited after on_runtime_upgrade
      
      * update changelog
      
      * Remove empty lines
      
      * Fix remove_deferred_storage weights
      
      * Remove Offence::on_runtime_upgrade benchmark
      
      * Revert CHANGELOG.md update
      
      * Deprecate DeferredOffenceOf type
      
      * Update copyright
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Add migration logs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Fix migration log
      
      * Remove unused import
      
      * Add migration tests
      
      * rustfmt
      
      * use generate_storage_alias! macro
      
      * Refactor should_resubmit_deferred_offences test
      
      * Replace spaces by tabs
      
      * Refactor should_resubmit_deferred_offences test
      
      * Removed WeightSoftLimit
      
      * Removed WeightSoftLimit from tests and mocks
      
      * Remove unused imports
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      ffca28ba
  30. Jan 04, 2021
    • Bastian Köcher's avatar
      Happy new year (#7814) · e3e651f7
      Bastian Köcher authored
      * Happy new year
      
      Updates the copyright years and fixes wrong license headers.
      
      * Fix the template
      
      * Split HEADER into HEADER-APACHE & HEADER-GPL
      e3e651f7
  31. Jul 04, 2020
    • André Silva's avatar
      babe: report equivocations (#6362) · a9c21b8b
      André Silva authored
      * slots: create primitives crate for consensus slots
      
      * offences: add method to check if an offence is unknown
      
      * babe: initial equivocation reporting implementation
      
      * babe: organize imports
      
      * babe: working equivocation reporting
      
      * babe: add slot number to equivocation proof
      
      * session: move duplicate traits to session primitives
      
      * babe: move equivocation stuff to its own file
      
      * offences: fix test
      
      * session: don't have primitives depend on frame_support
      
      * babe: use opaque type for key owner proof
      
      * babe: cleanup client equivocation reporting
      
      * babe: cleanup equivocation code in pallet
      
      * babe: allow sending signed equivocation reports
      
      * node: fix compilation
      
      * fix test compilation
      
      * babe: return bool on check_equivocation_proof
      
      * babe: add test for equivocation reporting
      
      * babe: add more tests
      
      * babe: add test for validate unsigned
      
      * babe: take slot number in generate_key_ownership_proof API
      
      * babe: add benchmark for equivocation proof checking
      
      * session: add benchmark for membership proof checking
      
      * offences: fix babe benchmark
      
      * babe: add weights based on benchmark results
      
      * babe: adjust weights after benchmarking on reference hardware
      
      * babe: reorder checks in check_and_report_equivocation
      a9c21b8b
  32. May 21, 2020
  33. May 15, 2020
  34. May 06, 2020
    • Tomasz Drwięga's avatar
      Benchmarks for offences pallet. (#5851) · 66c02fe6
      Tomasz Drwięga authored
      
      
      * really rough mock runtime
      
      * start to work on offences
      
      * Make sure to start the session.
      
      * Update to latest master.
      
      * Add verify.
      
      * Fix on_initialize benchmark.
      
      * Add grandpa offence.
      
      * Add Babe offence benchmarking.
      
      * Enable babe test.
      
      * Address review grumbles.
      
      * Address review grumbles.
      
      * Address review grumbles part 1/2
      
      * use currency trait
      
      * features
      
      * Check events explicitly.
      
      * Auto-impl tuple converter.
      
      * Removed dead code.
      
      * add test feature flag
      
      * dont use std
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      66c02fe6
  35. Mar 26, 2020
    • Kian Paimani's avatar
      Offchain Phragmén BREAKING. (#4517) · 970c5f94
      Kian Paimani authored
      * Initial skeleton for offchain phragmen
      
      * Basic compact encoding decoding for results
      
      * add compact files
      
      * Bring back Self::ensure_storage_upgraded();
      
      * Make staking use compact stuff.
      
      * First seemingly working version of reduce, full of todos
      
      * Everything phragmen related works again.
      
      * Signing made easier, still issues.
      
      * Signing from offchain compile fine 😎
      
      * make compact work with staked asssignment
      
      * Evaluation basics are in place.
      
      * Move reduce into crate. Document stuff
      
      * move reduce into no_std
      
      * Add files
      
      * Remove other std deps. Runtime compiles
      
      * Seemingly it is al stable; cycle implemented but not integrated.
      
      * Add fuzzing code.
      
      * Cleanup reduce a bit more.
      
      * a metric ton of tests for staking; wip 🔨
      
      * Implement a lot more of the tests.
      
      * wip getting the unsigned stuff to work
      
      * A bit gleanup for unsigned debug
      
      * Clean and finalize compact code.
      
      * Document reduce.
      
      * Still problems with signing
      
      * We officaly duct taped the transaction submission stuff. 🤓
      
      * Deadlock with keys again
      
      * Runtime builds
      
      * Unsigned test works 🙌
      
      * Some cleanups
      
      * Make all the tests compile and stuff
      
      * Minor cleanup
      
      * fix more merge stuff
      
      * Most tests work again.
      
      * a very nasty bug in reduce
      
      * Fix all integrations
      
      * Fix more todos
      
      * Revamp everything and everything
      
      * Remove bogus test
      
      * Some review grumbles.
      
      * Some fixes
      
      * Fix doc test
      
      * loop for submission
      
      * Fix cli, keyring etc.
      
      * some cleanup
      
      * Fix staking tests again
      
      * fix per-things; bring patches from benchmarking
      
      * better score prediction
      
      * Add fuzzer, more patches.
      
      * Some fixes
      
      * More docs
      
      * Remove unused generics
      
      * Remove max-nominator footgun
      
      * Better fuzzer
      
      * Disable it 
      
      
      
      * Bump.
      
      * Another round of self-review
      
      * Refactor a lot
      
      * More major fixes in perThing
      
      * Add new fuzz file
      
      * Update lock
      
      * fix fuzzing code.
      
      * Fix nominator retain test
      
      * Add slashing check
      
      * Update frame/staking/src/tests.rs
      
      Co-Authored-By: default avatarJoshy Orndorff <[email protected]>
      
      * Some formatting nits
      
      * Review comments.
      
      * Fix cargo file
      
      * Almost all tests work again
      
      * Update frame/staking/src/tests.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Fix review comments
      
      * More review stuff
      
      * Some nits
      
      * Fix new staking / session / babe relation
      
      * Update primitives/phragmen/src/lib.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Update primitives/phragmen/src/lib.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Update primitives/phragmen/compact/src/lib.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Some doc updates to slashing
      
      * Fix derive
      
      * Remove imports
      
      * Remove unimplemented tests
      
      * nits
      
      * Remove dbg
      
      * Better fuzzing params
      
      * Remove unused pref map
      
      * Deferred Slashing/Offence for offchain Phragmen  (#5151)
      
      * Some boilerplate
      
      * Add test
      
      * One more test
      
      * Review comments
      
      * Fix build
      
      * review comments
      
      * fix more
      
      * fix build
      
      * Some cleanups and self-reviews
      
      * More minor self reviews
      
      * Final nits
      
      * Some merge fixes.
      
      * opt comment
      
      * Fix build
      
      * Fix build again.
      
      * Update frame/staking/fuzz/fuzz_targets/submit_solution.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update frame/staking/src/slashing.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update frame/staking/src/offchain_election.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Fix review comments
      
      * fix test
      
      * === 🔑
      
       Revamp without staking key.
      
      * final round of changes.
      
      * Fix cargo-deny
      
      * Update frame/staking/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarthiolliere <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      970c5f94
  36. Mar 02, 2020
  37. Jan 05, 2020
  38. Dec 11, 2019
    • Benjamin Kampmann's avatar
      Fix folder names in primitives (#4358) · df133d6b
      Benjamin Kampmann authored
      * sr-arithmetic -> arithmetic
      
      * sr-sandbox -> sandbox
      
      * primitives/sr-staking-primitives -> primitives/staking
      
      * primitives/sr-version -> primitives/version
      
      * primitives/block-builder/runtime-api -> primitives/block-builder
      df133d6b