core/finality-grandpa: Minor refactorings (#3825)

* core/finality-grandpa: Improve code comments

* core/finality-grandpa: Rename VoteOrPrecommit to PrevoteOrPrecommit

According to the Grandpa paper [1]:

> A vote is a block hash, together with some metadata such as round
number and the type of vote, such as prevote or precommit, all signed
with a voter’s private key.

To reduce confusion this patch makes the code consistent with the
research paper.

[1] https://github.com/w3f/consensus/blob/master/pdf/grandpa.pdf

* core/finality-grandpa: Add comment for NetworkStream concept

* core/finality-grandpa: Improve round_communication doc comment

* core/finality-grandpa: Rename PrevoteOrPrecommit to Vote

* core/finality-grandpa: Represent NetworkStream state machine as enum

* core/finality-grandpa: Improve KeepTopics comment
This commit is contained in:
Max Inden
2019-10-18 16:01:14 +02:00
committed by André Silva
parent 31eebdf32b
commit abaaaaffbf
3 changed files with 59 additions and 31 deletions
@@ -52,7 +52,7 @@ pub type AuthorityWeight = u64;
/// The index of an authority.
pub type AuthorityIndex = u64;
/// The identifier of a GRANDPA set.
/// The monotonic identifier of a GRANDPA set of authorities.
pub type SetId = u64;
/// The round indicator.