mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
Integrate Approval Voting into Overseer / Service / GRANDPA (#2412)
* integrate approval voting into overseer * expose public API and make keystore arc * integrate overseer in service * guide: `ApprovedAncestor` returns block number * return block number along with hash from ApprovedAncestor * introduce a voting rule for reporting on approval checking * integrate the delay voting rule * Rococo configuration * fix compilation and add slack * fix web-wasm build * tweak parameterization * migrate voting rules to asycn * remove hack comment
This commit is contained in:
committed by
GitHub
parent
5c68e6f9cc
commit
4f21cc7e5c
@@ -218,9 +218,9 @@ On receiving a `CheckAndImportApproval(indirect_approval_vote, response_channel)
|
||||
|
||||
On receiving an `ApprovedAncestor(Hash, BlockNumber, response_channel)`:
|
||||
* Iterate over the ancestry of the hash all the way back to block number given, starting from the provided block hash.
|
||||
* Keep track of an `all_approved_max: Option<Hash>`.
|
||||
* Keep track of an `all_approved_max: Option<(Hash, BlockNumber)>`.
|
||||
* For each block hash encountered, load the `BlockEntry` associated. If any are not found, return `None` on the response channel and conclude.
|
||||
* If the block entry's `approval_bitfield` has all bits set to 1 and `all_approved_max == None`, set `all_approved_max = Some(current_hash)`.
|
||||
* If the block entry's `approval_bitfield` has all bits set to 1 and `all_approved_max == None`, set `all_approved_max = Some((current_hash, current_number))`.
|
||||
* If the block entry's `approval_bitfield` has any 0 bits, set `all_approved_max = None`.
|
||||
* After iterating all ancestry, return `all_approved_max`.
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ enum ApprovalVotingMessage {
|
||||
///
|
||||
/// It can also return the same block hash, if that is acceptable to vote upon.
|
||||
/// Return `None` if the input hash is unrecognized.
|
||||
ApprovedAncestor(Hash, BlockNumber, ResponseChannel<Option<Hash>>),
|
||||
ApprovedAncestor(Hash, BlockNumber, ResponseChannel<Option<(Hash, BlockNumber)>>),
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user