package octez-libs
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a
doc/octez-libs.tezos-gossipsub/Tezos_gossipsub/Gossipsub_intf/index.html
Module Tezos_gossipsub.Gossipsub_intfSource
type 'span per_topic_score_limits = {time_in_mesh_weight : float;(*P1: The weight of the score associated to the time spent in the mesh.
*)time_in_mesh_cap : float;(*P1: The maximum value considered for the score associated to the time spent by a peer in the mesh.
*)time_in_mesh_quantum : 'span;(*P1: The score associated to the time spent
*)tin the mesh is(min t time_in_mesh_cap) / time_in_mesh_quantum.first_message_deliveries_weight : float;(*P2: The weight of the score associated to the number of first message deliveries.
*)first_message_deliveries_cap : int;(*P2: The maximum value considered during score computation for the number of first message deliveries.
*)first_message_deliveries_decay : float;(*P2: The score is multiplied by this factor every
*)score_cleanup_ticksheartbeat. This parameter must be in the unit interval.mesh_message_deliveries_weight : float;(*P3: The weight of the score associated to the number of first/near-first mesh message deliveries.
*)mesh_message_deliveries_window : 'span;(*P3: The delay added to the first delivery of a message to obtain the upper bound up to which a duplicate message is counted as nearly-first delivered.
*)mesh_message_deliveries_activation : 'span;(*P3: How long should a peer be in the mesh before we start evaluating P3.
*)mesh_message_deliveries_cap : int;(*P3: The maximum value considered during score computation for the number of first/near-first mesh message deliveries.
*)mesh_message_deliveries_threshold : int;(*P3: The number of messages received from a peer in the mesh in the associated topic above which the peer won't be penalized
*)mesh_message_deliveries_decay : float;(*P3: The score is multiplied by this factor every
*)score_cleanup_ticksheartbeat. This parameter must be in the unit interval.mesh_failure_penalty_weight : float;(*P3b: Penalty induced when a peer gets pruned with a non-zero mesh message delivery deficit.
*)mesh_failure_penalty_decay : float;(*P3b: The score is multiplied by this factor every
*)score_cleanup_ticksheartbeat. This parameter must be in the unit interval.invalid_message_deliveries_weight : float;(*P4: Penalty induced when a peer sends an invalid message.
*)invalid_message_deliveries_decay : float;(*P4: The score is multiplied by this factor every
*)score_cleanup_ticksheartbeat. This parameter must be in the unit interval.
}type ('topic, 'span) topic_score_limits = | Topic_score_limits_single of 'span per_topic_score_limits(*Use this constructor when the topic score parameters do not depend on the topic.
*)| Topic_score_limits_family of {all_topics : 'topic Tezos_base.TzPervasives.Seq.t;parameters : 'topic -> 'span per_topic_score_limits;weights : 'topic -> float;
}(*Use this constructor when the topic score parameters may depend on the topic.
*)
type ('topic, 'span) score_limits = {topics : ('topic, 'span) topic_score_limits;(*Per-topic score parameters.
*)topic_score_cap : float option;(*An optional cap on the total positive contribution of topics to the score of the peer. If not equal to
*)None, must be non-negative.behaviour_penalty_weight : float;(*P7: The weight of the score associated to the behaviour penalty. This parameter must be negative.
*)behaviour_penalty_threshold : float;(*P7: The threshold on the behaviour penalty counter above which we start penalizing the peer.
*)behaviour_penalty_decay : float;(*P7: The score is multiplied by a factor of
*)behaviour_penalty_decayeveryscore_cleanup_ticksheartbeat. This parameter must be in the unit interval.app_specific_weight : float;(*P5: Application-specific peer scoring
*)decay_zero : float;(*The minimum value under which a score is considered to be equal to 0 after applying decay. This parameter must be non-negative.
*)
}type ('topic, 'peer, 'message_id, 'span) limits = {max_recv_ihave_per_heartbeat : int;(*The maximum number of IHave control messages we can receive from a peer between two heartbeats. It is called
*)MaxIHaveMessagesin the Go implementation.max_sent_iwant_per_heartbeat : int;(*The maximum number of IWant control message ids we can send to a peer between two heartbeats. It is also the maximum number of message ids to include in an IHave message. It is called
*)MaxIHaveLengthin the Go implementation.max_gossip_retransmission : int;(*The maximum number of times the local peer allows a remote peer to request the same message id through IWant gossip before the local peer starts ignoring them. This is designed to prevent peers from spamming with requests.
*)degree_optimal : int;(*The optimal number of full connections per topic. For example, if it is 6, each peer will want to have about six peers in their mesh for each topic they're subscribed to. It should be set somewhere between
*)degree_lowanddegree_high.publish_threshold : float;(*The threshold value (as a score) from which we can publish a message to our peers.
*)gossip_threshold : float;(*The threshold value (as a score) for a peer to emit/accept gossip: if the remote peer score is below this threshold, the local peer won't emit or accept gossip from the remote peer.
*)do_px : bool;(*The flag controls whether peer exchange (PX) is enabled.
*)accept_px_threshold : float;(*The threshold value (as a score) from which we accept peer exchanges.
*)peers_to_px : int;(*The number of peers to include in prune Peer eXchange. (This is called
*)PrunePeersin the Go implementation.)unsubscribe_backoff : 'span;(*The duration that prevent reconnections after leaving a topic to our full connections.
*)graft_flood_threshold : 'span;(*If a graft comes before
*)graft_flood_thresholdhas elapsed since the last prune, then there is an extra score penalty applied to the peer through P7.prune_backoff : 'span;(*The duration added when we prune a peer.
*)retain_duration : 'span;(*The duration added to remove metadata about a disconnected peer.
*)fanout_ttl : 'span;(*
*)fanout_ttlcontrols how long we keep track of a fanout topic. If it's beenfanout_ttlsince we've published to a topic that we're not subscribed to, then we don't track that topic anymore, that is, we delete it from the fanout map.heartbeat_interval : 'span;(*The time between heartbeats.
*)backoff_cleanup_ticks : int;(*The number of heartbeat ticks setting the frequency at which the backoffs are checked and potentially cleared.
*)score_cleanup_ticks : int;(*
*)score_cleanup_ticksis the number of heartbeat ticks setting the frequency at which the scores are refreshed and potentially cleared.degree_low : int;(*The lower bound on the number of peers we keep in a topic mesh. If we have fewer than
*)degree_lowpeers, the heartbeat will attempt to graft some more into the mesh at the next heartbeat.degree_high : int;(*The upper bound on the number of peers we keep in a topic mesh. If there are more than
*)degree_highpeers, the heartbeat will select some to prune from the mesh at the next heartbeat.degree_score : int;(*
*)degree_scoreaffects how peers are selected when pruning a mesh due to over subscription. At leastdegree_scoreof the retained peers will be high-scoring, while the remainder are chosen randomly.degree_out : int;(*The number of outbound connections to maintain in a topic mesh. When the mesh is pruned due to over subscription, we make sure that we have outbound connections to at least
*)degree_outof the survivor peers. This prevents Sybil attackers from overwhelming our mesh with incoming connections.degree_outmust be set belowdegree_low, and must not exceeddegree_optimal / 2.degree_lazy : int;(*
*)degree_lazyaffects how many peers the local peer will emit gossip to at each heartbeat. The local peer will send gossip to at leastdegree_lazypeers outside its mesh or fanout. The actual number may be more, depending ongossip_factorand how many peers the local peer is connected to.gossip_factor : float;(*
*)gossip_factoraffects how many peers the local peer will emit gossip to at each heartbeat. The local peer will send gossip togossip_factor* (total number of non-mesh/non-fanout peers), ordegree_lazypeers, whichever is greater.history_length : int;(*The size of the message cache used for gossip. The message cache will remember messages for
*)history_lengthheartbeats.history_gossip_length : int;(*
*)history_gossip_lengthcontrols how many cached message ids the local peer will advertise in IHave gossip messages. When asked for its seen message ids, the local peer will return only those from the most recenthistory_gossip_lengthheartbeats. The slack betweenhistory_gossip_lengthandhistory_lengthallows the local peer to avoid advertising messages that will be expired by the time they're requested.history_gossip_lengthmust be less than or equal tohistory_length.opportunistic_graft_ticks : int64;(*The number of heartbeat ticks setting the frequency at which to attempt to improve the mesh with opportunistic grafting. Every
*)opportunistic_graft_ticks, if the median score of the mesh peers falls below theopportunistic_graft_threshold, then the local peer will select some high-scoring mesh peers to graft.opportunistic_graft_peers : int;(*The number of peers to opportunistically graft.
*)opportunistic_graft_threshold : float;(*The median mesh score threshold before triggering opportunistic grafting; this should have a small positive value.
*)score_limits : ('topic, 'span) score_limits;(*score-specific parameters.
*)seen_history_length : int;(*
*)seen_history_lengthcontrols the size of the message cache used for recording seen messages. The seen messages cache will remember messages forseen_history_lengthheartbeats.
}The SCORE module type describes primitives used to update the scores associated to each peer. Score computation is described in more details in the specification.