Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staking todos #179

Closed
4meta5 opened this issue Jan 14, 2021 · 4 comments
Closed

staking todos #179

4meta5 opened this issue Jan 14, 2021 · 4 comments

Comments

@4meta5
Copy link
Contributor

4meta5 commented Jan 14, 2021

Here is a list of features I want for stakev1:

  • use FRAMEv2 macro syntax
  • change name to parachain-staking, change all instances of Validator to Collator. The Validators storage item should be renamed SelectedCandidates
  • add MinCollatorCandidateStk bond, as an associated type for Config trait and only use MinCollatorStk constant when selecting the SelectedCandidates
  • make BlocksPerRound a storage item and add runtime method for root to update it (using > instead of % for determining round transitions)
  • merge nominate_new and join_nominators into single nominate runtime method (see comment further above)
  • make collator fee a pallet constant (associated type Get<Perbill> for Config), instead of configurable per collator (as per our preferred design constraints)
  • remove swap_nominations logic, tis quadratic and can easily write code that calls successive runtime methods to achieve same functionality (also removes ~200 loc and puts the lib.rs under 1k loc again)

Prioritized features for future releases:

  • benchmarking => weights
  • nominations per collator should be top MaxNominationsPerCollator nominations instead of the first MaxNominationsPerCollator nominations
  • waitlist for nominations per collator
  • blocklist per collator to prevent specific accounts from nominating them if they suspect sabotage
  • replace ExitQueue with usage of pallet_scheduler

Other stuff to do:

  • integration tests with multiple validators and nominators
  • (optimization) want to use this polkadot-js type to make balance fields compact (like in frame/pallet-staking)
This was referenced Jan 14, 2021
@4meta5 4meta5 mentioned this issue Feb 9, 2021
1 task
@4meta5
Copy link
Contributor Author

4meta5 commented Feb 23, 2021

Right now, a nominator must call join_nominators for its first nomination and then nominate_new for every subsequent nomination. This is a bad interface -- move both into a nominate function that will choose which path to take based on whether there is an existing nomination associated with the caller.

@joelamouche
Copy link
Contributor

need to use this polkadot-js type in order to make balance fields compact (like in frame/pallet-staking)

what do you mean by that? Mimic the polkadot-js types in the rust code?

@4meta5
Copy link
Contributor Author

4meta5 commented Feb 26, 2021

@joelamouche The Rust code change requires annotating the struct fields that use Balance type with #[compact]. The corresponding polkadot-js type needs to use bn.js or it isn't decoded correctly.

Let's not prioritize this until we're sure we want to optimize this implementation.

@4meta5
Copy link
Contributor Author

4meta5 commented Mar 15, 2021

Mostly addressed in #285 and will be tracked elsewhere from now on

@4meta5 4meta5 closed this as completed Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants