Using taplo, fixes all our broken and inconsistent toml formatting and
adds CI to keep them tidy.
If people want we can customise the format rules as described here
https://taplo.tamasfe.dev/configuration/formatter-options.html
@ggwpez, I suggest zepter is used only for checking features are
propagated, and leave formatting for taplo to avoid duplicate work and
conflicts.
TODO
- [x] Use `exclude = [...]` syntax in taplo file to ignore zombienet
tests instead of deleting the dir
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
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: Javier Viola <javier@parity.io>
Co-authored-by: Ross Bulat <ross@parity.io>
Co-authored-by: command-bot <>
The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
crates.io as someone as squatted `xcm`. The problem with this rename is
that the `TypeInfo` includes the crate name which ultimately lands in
the metadata. The metadata is consumed by downstream users like
`polkadot-js` or people building on top of `polkadot-js`. These people
are using the entire `path` to find the type in the type registry. Thus,
their code would break as the type path would now be [`staging_xcm`,
`VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
fixes this by renaming the path segment `staging_xcm` to `xcm`.
This requires: https://github.com/paritytech/scale-info/pull/197
---------
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
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
What does this PR do?
- Introduced the TotalValueLocked storage for nomination-pools.
- introduced a slashing api in mock.rs
- additional test for tracking a slashing event towards a pool without
sub-pools
- migration for the nomination-pools (V6 to V7) with
`VersionedMigration`
Why are these changes needed?
this is the continuation of the work by @kianenigma in this
[PR](https://github.com/paritytech/substrate/pull/13319)
How were these changes implemented and what do they affect?
- It's an extra StorageValue that's modified whenever funds flow in or
out of staking for any of the `bonded_account` of `BondedPools`
- The `PoolSlashed`event is now emitted even when no `SubPools` are
found
Closes https://github.com/paritytech/polkadot-sdk/issues/155
KSM: HHEEgVzcqL3kCXgsxSfJMbsTy8dxoTctuXtpY94n4s8F4pS
---------
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: Ankan <ankan.anurag@gmail.com>
Co-authored-by: command-bot <>
* Fix std, runtime-benchmarks and try-runtime features
zepter lint propagate-feature --feature try-runtime --left-side-feature-missing=ignore --workspace --fix --feature-enables-dep="try-runtime:frame-try-runtime"
zepter lint propagate-feature --feature runtime-benchmarks --left-side-feature-missing=ignore --workspace --fix --feature-enables-dep="runtime-benchmarks:frame-benchmarking"
zepter lint propagate-feature --feature std --left-side-feature-missing=ignore --workspace --fix
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add propagate feature CI check
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Test CI by adding an error
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use --locked
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add help msg
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Revert "Test CI by adding an error"
This reverts commit cf4ff6cc0632269b0a109e547686e5e3314b02de.
* Test CI by adding an error
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* No newline in help msg
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Revert "Test CI by adding an error"
This reverts commit 5daa06ada8e01f5bebafb9d1c76804dd79bc1006.
* Test CI by adding an error
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Revert "Test CI by adding an error"
This reverts commit ca15de5729507a564f140a10ec2e87b19516ec4c.
* Fix msg
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Revert back to master
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Re-do with Zepter v0.7.4
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update Zepter to 0.7.4
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Disable rococo try-runtime check
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de>
* More review fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
* frame-benchmarking-cli: Remove native dispatch requirement
No need for this, we can just use the `WasmExecutor` directly.
* Fixes
* Pass benchmarking host functions
* Ensure we can pass custom host functions
* 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
* 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
* 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
* 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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/mock.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* 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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Parity Bot <admin@parity.io>
* fix a few more things with nomination pools
* add bench
* use weight fn
* 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
* allow real root to also set roles
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* move out of the closure
* fix a few more things
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* 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: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* 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: Zeke Mostov <z.mostov@gmail.com>
* 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: kianenigma <kian@parity.io>
* 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: Zeke Mostov <z.mostov@gmail.com>
Co-authored-by: emostov <32168567+emostov@users.noreply.github.com>
* 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: Zeke Mostov <z.mostov@gmail.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* add benchmarks
* remove the min logic of bond_extra
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* FMT
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* make it compile end to end
* Update some type viz
* Update kick terminology
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* 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: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update docs for pool withdraw unbonded
* Update docs for unbond
* Improve Doc
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/Cargo.toml
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* 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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* 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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* 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: Zeke Mostov <z.mostov@gmail.com>
* Update frame/nomination-pools/src/tests.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* Update frame/nomination-pools/src/tests.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* remove pub
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* undo
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* 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: Zeke Mostov <z.mostov@gmail.com>
* 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: Zeke Mostov <z.mostov@gmail.com>
* Update frame/nomination-pools/src/lib.rs
* last self-review
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* 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: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* staking: Proportional ledger slashing
* Some comment cleanup
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* 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: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: kianenigma <kian@parity.io>
* Upgraded dependencies
* Adapting code to scale v3
* Empty commit to trigger CI
* Triggering CI
* Fixing UI test
* Remove superfluous dev-dep added by #9228
* Cryout for CI
* Offence implementations can disable offenders independently from slashing
* Fix build on CI
* Run cargo fmt
* Fixes based on review comments
* Make parameter naming consistent
* Fix migration and some English
* Fix migration - again
* cargo fmt
* Cover 2 new cases with a test
* 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: André Silva <andrerfosilva@gmail.com>
* mark template and utils as non-publish
* switch to development version for testing
* activate unleash check
* maybe if I disable all rules...
* Fix isolated compilation of `max-encoded-len-derive` with `syn`
error[E0369]: binary operation `==` cannot be applied to type `syn::Path`
--> src/lib.rs:88:29
|
88 | .filter(|attr| attr.path == parse_quote!(max_encoded_len_crate))
| --------- ^^ ----------------------------------- _
| |
| syn::Path
error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
Error: could not compile `max-encoded-len-derive`
* WIP: bump changes crates since v3 tag to next breaking
cargo unleash version bump-breaking --changed-since v3.0.0
cargo unleash version set-pre dev --changed-since v3.0.0
FIXME: Don't modify crates that are not yet released, e.g.
`max-encoded-len-derive`
* Update lockfile
* WIP: Bump sp-transaction-pool as well
* WIP: Bump sp-offchain as well
* WIP: Bump frame-system-rpc-runtime-api as well
* WIP: Bump sp-authority-discovery as well
* Manually deactivate dev-deps before `cargo unleash check`
Otherwise we run into `Cycle detected` error.
* Bump sp-consensus-slots
* Add missing Cargo.lock change
* Bump sp-consensus-vrf as well
* Bump sp-keyring as well
* Bump sp-consensus-pow as well
* Try to speed up the `unleash-check` job
Previously, the job took 106 minutes - let's see if explicitly
specifying a `CARGO_TARGET_DIR` will help
* fixup: Ensure the temp target dir exists for unleash check
* Bump pallet-transaction-payment-rpc-runtime-api as well
Needed for Polkadot
* Bump pallet-transaction-payment-rpc as well
Needed for Polkadot
* Try updating crates after patching in the Polkadot CI job
* Use another approach to update patched Substrate crates
* Try to update all sp-core versions in Polkadot CI job
* Simplify sp-core version checking
* Apply another shellcheck lint
* Just do the simplest thing I guess
* Welp don't do --offline then
* Clean up `unleash-check` job triggers
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
* Fix a note in unleash-check cache step
* Add a note about temporary optimization in cargo-unleash
* Pin a newer version of cargo-unleash
Co-authored-by: Igor Matuszewski <xanewok@gmail.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>