mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-20 09:15:42 +00:00
Markdown linter (#1309)
* Add markdown linting - add linter default rules - adapt rules to current code - fix the code for linting to pass - add CI check fix #1243 * Fix markdown for Substrate * Fix tooling install * Fix workflow * Add documentation * Remove trailing spaces * Update .github/.markdownlint.yaml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix mangled markdown/lists * Fix captalization issues on known words
This commit is contained in:
@@ -1,30 +1,29 @@
|
||||
A set of election algorithms to be used with a substrate runtime, typically within the staking
|
||||
sub-system. Notable implementation include:
|
||||
# sp-npos-elections
|
||||
|
||||
- [`seq_phragmen`]: Implements the Phragmén Sequential Method. An un-ranked, relatively fast
|
||||
election method that ensures PJR, but does not provide a constant factor approximation of the
|
||||
maximin problem.
|
||||
- [`phragmms`]: Implements a hybrid approach inspired by Phragmén which is executed faster but
|
||||
it can achieve a constant factor approximation of the maximin problem, similar to that of the
|
||||
MMS algorithm.
|
||||
- [`balance_solution`]: Implements the star balancing algorithm. This iterative process can push
|
||||
a solution toward being more `balanced`, which in turn can increase its score.
|
||||
A set of election algorithms to be used with a Substrate runtime, typically within the staking sub-system. Notable
|
||||
implementation include:
|
||||
|
||||
### Terminology
|
||||
- [`seq_phragmen`]: Implements the Phragmén Sequential Method. An un-ranked, relatively fast election method that
|
||||
ensures PJR, but does not provide a constant factor approximation of the maximin problem.
|
||||
- [`phragmms`]: Implements a hybrid approach inspired by Phragmén which is executed faster but it can achieve a constant
|
||||
factor approximation of the maximin problem, similar to that of the MMS algorithm.
|
||||
- [`balance_solution`]: Implements the star balancing algorithm. This iterative process can push a solution toward being
|
||||
more `balanced`, which in turn can increase its score.
|
||||
|
||||
This crate uses context-independent words, not to be confused with staking. This is because the
|
||||
election algorithms of this crate, while designed for staking, can be used in other contexts as
|
||||
well.
|
||||
## Terminology
|
||||
|
||||
`Voter`: The entity casting some votes to a number of `Targets`. This is the same as `Nominator`
|
||||
in the context of staking. `Target`: The entities eligible to be voted upon. This is the same as
|
||||
`Validator` in the context of staking. `Edge`: A mapping from a `Voter` to a `Target`.
|
||||
This crate uses context-independent words, not to be confused with staking. This is because the election algorithms of
|
||||
this crate, while designed for staking, can be used in other contexts as well.
|
||||
|
||||
`Voter`: The entity casting some votes to a number of `Targets`. This is the same as `Nominator` in the context of
|
||||
staking. `Target`: The entities eligible to be voted upon. This is the same as `Validator` in the context of staking.
|
||||
`Edge`: A mapping from a `Voter` to a `Target`.
|
||||
|
||||
The goal of an election algorithm is to provide an `ElectionResult`. A data composed of:
|
||||
- `winners`: A flat list of identifiers belonging to those who have won the election, usually
|
||||
ordered in some meaningful way. They are zipped with their total backing stake.
|
||||
- `assignment`: A mapping from each voter to their winner-only targets, zipped with a ration
|
||||
denoting the amount of support given to that particular target.
|
||||
- `winners`: A flat list of identifiers belonging to those who have won the election, usually ordered in some meaningful
|
||||
way. They are zipped with their total backing stake.
|
||||
- `assignment`: A mapping from each voter to their winner-only targets, zipped with a ration denoting the amount of
|
||||
support given to that particular target.
|
||||
|
||||
```rust
|
||||
// the winners.
|
||||
@@ -44,16 +43,14 @@ let election_result = ElectionResult { winners, assignments };
|
||||
|
||||
```
|
||||
|
||||
The `Assignment` field of the election result is voter-major, i.e. it is from the perspective of
|
||||
the voter. The struct that represents the opposite is called a `Support`. This struct is usually
|
||||
accessed in a map-like manner, i.e. keyed by voters, therefore it is stored as a mapping called
|
||||
`SupportMap`.
|
||||
The `Assignment` field of the election result is voter-major, i.e. it is from the perspective of the voter. The struct
|
||||
that represents the opposite is called a `Support`. This struct is usually accessed in a map-like manner, i.e. keyed by
|
||||
voters, therefore it is stored as a mapping called `SupportMap`.
|
||||
|
||||
Moreover, the support is built from absolute backing values, not ratios like the example above.
|
||||
A struct similar to `Assignment` that has stake value instead of ratios is called an
|
||||
`StakedAssignment`.
|
||||
Moreover, the support is built from absolute backing values, not ratios like the example above. A struct similar to
|
||||
`Assignment` that has stake value instead of ratios is called an `StakedAssignment`.
|
||||
|
||||
|
||||
More information can be found at: https://arxiv.org/abs/2004.12990
|
||||
|
||||
License: Apache-2.0
|
||||
License: Apache-2.0
|
||||
|
||||
Reference in New Issue
Block a user