Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

pallet-simple-staking #28

Merged
merged 60 commits into from
Apr 19, 2021
Merged

pallet-simple-staking #28

merged 60 commits into from
Apr 19, 2021

Conversation

JesseAbram
Copy link
Contributor

@JesseAbram JesseAbram commented Apr 7, 2021

TODO

  • weights
  • test events
  • add split pooling function (aura)
  • add authorities to aura list (aura)
  • Properly protect functions with relay chain calls

@xlc
Copy link

xlc commented Apr 7, 2021

Any plan to make this into Substrate / Cumulus so each parachain team don't need to create their own copy of something similar?

pub mod pallet {
use frame_support::{dispatch::DispatchResultWithPostInfo, pallet_prelude::*, inherent::Vec, traits::{Currency, ReservableCurrency}};
use frame_system::{pallet_prelude::*, ensure_root};
use frame_system::Config as SystemConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not substrate-idomatic IMO, but not a big deal.

JesseAbram and others added 6 commits April 8, 2021 09:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
@@ -793,8 +819,14 @@ impl_runtime_apis! {
let params = (&config, &whitelist);

add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
add_benchmark!(params, batches, pallet_balances, Balances);
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
//TODO we should re run all benchmarks for used pallets together
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, but I was thinking it falls out of scope of this PR and to make an issue and do it after this is merged

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created issue #37

JesseAbram and others added 15 commits April 19, 2021 11:28
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
@joepetrowski
Copy link
Collaborator

I guess there won't be any election algorithm so all the authorship change will just applied on next session? There is no concept of Era in this pallet? Is pallet-session going to be integrated as well?

Even simpler than that, we will just make a Vec<AccountId> that gets updated every n blocks. We don't need sessions/eras at all.

Will there be implementation of slash / remove from authority due to offline? How about double sign / unnecessary forks?

It will eventually kick collators who don't produce a block for some time, but no slashing.

Right now, authors are first come first serve with limited available slots, how do you ensure later comers can also join?

Correct, short term, governance will either increase the number of slots or increase the bond requirement. Medium term, we will just rotate through candidates so that they will all get a chance in the set.

Any design docs for this? Is this almost completed or there are planned features to be implemented (e.g. slash)? It is very hard for me to figure how is this suppose to work without seeing the full picture.

It's meant to function for collator selection for a common good chain. Collation is not a secure operation, so it doesn't require that many features. It's called "simple staking" for a reason; there aren't many features.

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need followups, but okay for now.

@JesseAbram JesseAbram merged commit c9b95c5 into master Apr 19, 2021
@JesseAbram JesseAbram deleted the jesse-simple-staking branch April 19, 2021 12:11
@JesseAbram
Copy link
Contributor Author

We need followups, but okay for now.

yup using #9 to track, will add you to it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants