mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
approval-distribution: a fix for out-of-view messages (#4908)
* approval-distribution: a fix for out-of-view messages * approval-distribution: trace logs * adjust the guide slightly * comments and nits
This commit is contained in:
@@ -241,12 +241,12 @@ Imports an approval signature referenced by block hash and candidate index:
|
||||
|
||||
#### `unify_with_peer(peer: PeerId, view)`:
|
||||
|
||||
1. Initialize a set `fresh_blocks = {}`
|
||||
1. Initialize a set `missing_knowledge = {}`
|
||||
|
||||
For each block in the view:
|
||||
2. Load the `BlockEntry` for the block. If the block is unknown, or the number is less than or equal to the view's finalized number go to step 6.
|
||||
3. Inspect the `known_by` set of the `BlockEntry`. If the peer is already present, go to step 6.
|
||||
4. Add the peer to `known_by` with a cloned version of `block_entry.knowledge`. and add the hash of the block to `fresh_blocks`.
|
||||
3. Inspect the `known_by` set of the `BlockEntry`. If the peer already knows all assignments/approvals, go to step 6.
|
||||
4. Add the peer to `known_by` and add the hash and missing knowledge of the block to `missing_knowledge`.
|
||||
5. Return to step 2 with the ancestor of the block.
|
||||
|
||||
6. For each block in `fresh_blocks`, send all assignments and approvals for all candidates in those blocks to the peer.
|
||||
6. For each block in `missing_knowledge`, send all assignments and approvals for all candidates in those blocks to the peer.
|
||||
|
||||
Reference in New Issue
Block a user