This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[Feature] StakeTracker P1 - VotersList #14073
Closed
ruseinov
wants to merge
111
commits into
paritytech:master
from
ruseinov:ru/feature/stake-tracker-voter
Closed
[Feature] StakeTracker P1 - VotersList #14073
ruseinov
wants to merge
111
commits into
paritytech:master
from
ruseinov:ru/feature/stake-tracker-voter
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original issue: paritytech/polkadot-sdk#443
Original PR: #13079
Splitting up #12744
polkadot companion: paritytech/polkadot#6527
Terminology
Approval stake - a sum of all the nominator/nomination pools stakes that are backing this validator + self-stake.
Goals
The original goal of this series of PR's is to introduce a list of validators sorted by their approval stake, therefore eliminating the need for Max Validator Intentions parameter. This way we'll be able to look into top x validators in the list to get a set of electable ones.
While doing that we also introduce a concept of EventListeners into Staking, that would allow us to hook into various staking methods acting upon emitted events. In this particular case this allows us to delegate the sorted list maintenance to a 3rd party EventListener.
Technical details
This PR introduces a new Staking-related abstraction called
OnStakingUpdate
that basically provides the ability to subscribe to certain events that Staking fires and act upon them.The first event listener implementing this interface, also introduced in this PR, is called
pallet-stake-tracker
which currently takes care of maintainingVoterList
(a sorted list of nominators and validator's self-stake), effectively moving this logic out of Staking. It's also supplying Staking with a read-only version of this list, which is currently implemented by adding some defensive checks intoinsert/updated/remove
methods.Some other things that were introduced in this PR include:
OnStakingUpdate
events are being fired with the right arguments.update/insert/remove
methods and only leavesunsafe
methods to allow for easier benchmarking/testing/migrations.CurrencyToVote
moved fromframe_support
toprimitives/staking
.