Skip to content
Snippets Groups Projects
Commit bf817938 authored by Hugo Trentesaux's avatar Hugo Trentesaux Committed by Hugo Trentesaux
Browse files

improve authority doc

parent ab47075d
No related branches found
No related tags found
1 merge request!122Documentation in readme
Pipeline #18703 skipped
# Duniter authority members pallet # Duniter authority members pallet
Duniter authorities are not selected with staking but thanks the the "smith" web of trust. A member of the smith WoT can join or leave the set of authorities whenever he or she wants. In a permissioned network, we have to define the set of authorities, and among these authorities, the ones taking part in the next session. That's what authority members pallet does. In practice:
- it manages a `Members` set with some custom rules
- it implements the `SessionManager` trait from the session frame pallet
## Entering the set of authorities
To become part of Duniter authorities, one has to complete these steps:
1. become member of the main web of trust
1. request membership to the smith sub wot
1. get enough certs to get smith membership
1. claim membership to the set of authorities
Then one can "go online" and "go offline" to enter or leave two sessions after.
## Staying in the set of authorities
If a smith is offline more than `MaxOfflineSessions`, he leaves the set of authorities.
\ No newline at end of file
...@@ -521,6 +521,7 @@ impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> { ...@@ -521,6 +521,7 @@ impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> {
if members_ids_to_add.is_empty() { if members_ids_to_add.is_empty() {
if members_ids_to_del.is_empty() { if members_ids_to_del.is_empty() {
// when no change to the set of autorities, return None
return None; return None;
} else { } else {
for member_id in &members_ids_to_del { for member_id in &members_ids_to_del {
...@@ -540,6 +541,7 @@ impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> { ...@@ -540,6 +541,7 @@ impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> {
Self::deposit_event(Event::IncomingAuthorities(members_ids_to_add.clone())); Self::deposit_event(Event::IncomingAuthorities(members_ids_to_add.clone()));
} }
// updates the list of OnlineAuthorities and returns the list of their key
Some( Some(
OnlineAuthorities::<T>::mutate(|members_ids| { OnlineAuthorities::<T>::mutate(|members_ids| {
for member_id in members_ids_to_del { for member_id in members_ids_to_del {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment