@@ -87,22 +87,60 @@ namespace libp2p::protocol::gossip {
87
87
// / Sign published messages
88
88
bool sign_messages = false ;
89
89
90
+ // / Number of heartbeats to keep in the `memcache`
90
91
size_t history_length{5 };
91
92
93
+ // / Number of past heartbeats to gossip about (default is 3).
92
94
size_t history_gossip{3 };
93
95
96
+ // / Time to live for fanout peers (default is 60 seconds).
94
97
std::chrono::seconds fanout_ttl{60 };
95
98
99
+ // / Duplicates are prevented by storing message id's of known messages in an
100
+ // / LRU time cache. This settings sets the time period that messages are
101
+ // / stored in the cache. Duplicates can be received if duplicate messages
102
+ // / are sent at a time greater than this setting apart. The default is 1
103
+ // / minute.
96
104
std::chrono::seconds duplicate_cache_time{60 };
97
105
106
+ // / Controls the backoff time for pruned peers. This is how long
107
+ // / a peer must wait before attempting to graft into our mesh again after
108
+ // / being pruned. When pruning a peer, we send them our value of
109
+ // / `prune_backoff` so they know the minimum time to wait. Peers running
110
+ // / older versions may not send a backoff time, so if we receive a prune
111
+ // / message without one, we will wait at least `prune_backoff` before
112
+ // / attempting to re-graft. The default is one minute.
98
113
std::chrono::seconds prune_backoff{60 };
99
114
115
+ // / Controls the backoff time when unsubscribing from a topic.
116
+ // /
117
+ // / This is how long to wait before resubscribing to the topic. A short
118
+ // / backoff period in case of an unsubscribe event allows reaching a healthy
119
+ // / mesh in a more timely manner. The default is 10 seconds.
100
120
std::chrono::seconds unsubscribe_backoff{10 };
101
121
122
+ // / Number of heartbeat slots considered as slack for backoffs. This
123
+ // / guarantees that we wait at least backoff_slack heartbeats after a
124
+ // / backoff is over before we try to graft. This solves problems occurring
125
+ // / through high latencies. In particular if `backoff_slack *
126
+ // / heartbeat_interval` is longer than any latencies between processing
127
+ // / prunes on our side and processing prunes on the receiving side this
128
+ // / guarantees that we get not punished for too early grafting. The default
129
+ // / is 1.
102
130
size_t backoff_slack = 1 ;
103
131
132
+ // / Whether to do flood publishing or not. If enabled newly created messages
133
+ // / will always be
134
+ // / sent to all peers that are subscribed to the topic and have a good
135
+ // / enough score. The default is true.
104
136
bool flood_publish = true ;
105
137
138
+ // / The maximum number of messages to include in an IHAVE message.
139
+ // / Also controls the maximum number of IHAVE ids we will accept and request
140
+ // / with IWANT from a peer within a heartbeat, to protect from IHAVE floods.
141
+ // / You should adjust this value from the default if your system is pushing
142
+ // / more than 5000 messages in GossipSubHistoryGossip heartbeats; with the
143
+ // / defaults this is 1666 messages/s. The default is 5000.
106
144
size_t max_ihave_length = 5000 ;
107
145
108
146
ScoreConfig score;
0 commit comments