Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
guide: change statement distribution message types
  • Loading branch information
rphmeier committed Jun 14, 2020
commit 9f985ce859bda31688f360694de4cdef226e0efe
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ The Statement Distribution subsystem sends statements to peer nodes and detects
There is a very simple state machine which governs which messages we are willing to receive from peers. Not depicted in the state machine: on initial receipt of any [`SignedStatement`](/type-definitions.html#signed-statement-type), validate that the provided signature does in fact sign the included data. Note that each individual parablock candidate gets its own instance of this state machine; it is perfectly legal to receive a `Valid(X)` before a `Seconded(Y)`, as long as a `Seconded(X)` has been received.

A: Initial State. Receive `SignedStatement(Statement::Second)`: extract `Statement`, forward to Candidate Backing, proceed to B. Receive any other `SignedStatement` variant: drop it.
B: Receive any `SignedStatement`: extract `Statement`, forward to Candidate Backing. Receive `OverseerMessage::StopWork`: proceed to C.

B: Receive any `SignedStatement`: check signature, forward to Candidate Backing. Receive `OverseerMessage::StopWork`: proceed to C.

C: Receive any message for this block: drop it.

## Peer Knowledge Tracking
Expand Down
9 changes: 3 additions & 6 deletions roadmap/implementors-guide/src/type-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,9 @@ struct SignedStatement {

```rust
enum StatementDistributionMessage {
/// A peer has seconded a candidate and we need to double-check them
Peer(SignedStatement),
/// We have validated a candidate and want to share our judgment with our peers
///
/// The statement distribution subsystem is responsible for signing this statement.
Share(Statement),
/// We have originated a signed statement in the context of
/// given relay-parent hash and it should be distributed to other validators.
Share(Hash, SignedStatement),
}
```

Expand Down