Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
adjust the guide slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Feb 11, 2022
1 parent fff5a84 commit a14a2d3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit a14a2d3

Please sign in to comment.