Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gossipsub: Unsubscribe backoff #383

Merged
merged 2 commits into from
Jun 3, 2022
Merged
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
19 changes: 12 additions & 7 deletions pubsub/gossipsub/gossipsub-v1.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ within the backoff period and extend it.
When a peer tries to regraft too early, the pruning peer may apply a behavioural penalty
for the action, and penalize the peer through P₇ (see [Peer Scoring](#peer-scoring) below).

When unsubscribing from a topic, the backoff period should be finished before subscribing to
the topic again, otherwise a healthy mesh will be difficult to reach.
A specific backoff period for unsubscribing should be set accordingly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean "resubscribing" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UnsubBackoff is sent to peers when we unsubscribe to allow us to resubscribe before the full PruneBackoff

So while this is meant to allow fast resub, I called it the unsubbackoff because why send it during unsub

It tried to explain this better in the doc, lgty?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg, thanks.


The recommended duration for the backoff period is 1 minute, while the recommended number of peers
to exchange is larger than `D_hi` so that the pruned peer can reliably form a full mesh.
In order to correctly synchronize the two peers, the pruning peer should include the backoff period
Expand Down Expand Up @@ -537,13 +541,14 @@ parameters. This section summarizes all the new parameters along with a brief de

The following parameters apply globally:

| Parameter | Type | Description | Reasonable Default |
|----------------|------------------|------------------------------------------------------------------------|--------------------|
| `PruneBackoff` | Duration | Time after pruning a mesh peer before we consider grafting them again. | `1 minute` |
| `FloodPublish` | Boolean | Whether to enable flood publishing | `true` |
| `GossipFactor` | Float [0.0, 1.0] | % of peers to send gossip to, if we have more than `D_lazy` available | `0.25` |
| `D_score` | Integer | Number of peers to retain by score when pruning because of oversubscription | 4 or 5 for a `D` of 6. |
| `D_out` | Integer | Number of outbound connections to keep in the mesh. Must be less than `D_lo` and at most `D/2` | 2 for a `D` of 6 |
| Parameter | Type | Description | Reasonable Default |
|----------------------|------------------|------------------------------------------------------------------------|--------------------|
| `PruneBackoff` | Duration | Time after pruning a mesh peer before we consider grafting them again. | `1 minute` |
| `UnsubscribeBackoff` | Duration | Backoff to use when unsuscribing from a topic. Should not resubscribe to this topic before it expired. | `10 seconds` |
| `FloodPublish` | Boolean | Whether to enable flood publishing | `true` |
| `GossipFactor` | Float [0.0, 1.0] | % of peers to send gossip to, if we have more than `D_lazy` available | `0.25` |
| `D_score` | Integer | Number of peers to retain by score when pruning because of oversubscription | 4 or 5 for a `D` of 6. |
| `D_out` | Integer | Number of outbound connections to keep in the mesh. Must be less than `D_lo` and at most `D/2` | 2 for a `D` of 6 |

The remaining parameters apply to [Peer Scoring](#peer-scoring). Because many parameters are
inter-related and may be application-specific, reasonable defaults are not shown here. See
Expand Down