package octez-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Automaton.ScoreSource

Module for peers scores

Sourcetype t

The type of peer scoring statistics.

Sourcetype value
Sourcetype span
Sourcetype time = Time.t
Sourcetype topic = Topic.t
Sourceval newly_connected : (topic, span) Gossipsub_intf.score_limits -> t

newly_connected params creates a fresh statistics record.

Sourceval value : t -> value

value ps evaluates the score of ps.

Sourceval penalty : t -> int -> t

penalty ps penalty increments the behavioural penalty of ps.

Sourceval set_connected : t -> t

set_connected ps marks ps as being associated to a connected peer.

Sourceval remove_peer : t -> retain_duration:span -> t option

remove_peer ps ~retain_duration will either return None if the peer statistics can be cleared, or Some ps' with ps' some statistics to be retained for at least retain_duration.

Sourceval expires : t -> time option

expires ps returns None if the score statistics has no expiration time or Some t if it expires at time t.

Sourceval graft : t -> topic -> t

graft ps topic allows to measure the time spent by the peer in the mesh. It is to be called upon grafting a peer to topic.

Sourceval prune : t -> topic -> t

prune ps topic allows to measure the time spent by the peer in the mesh. It is to be called upon pruning a peer from topic.

Sourceval first_message_delivered : t -> topic -> t

first_message_delivered ps topic increments the counter related to first message deliveries and mesh message deliveries on topic by the associated peer.

Sourceval duplicate_message_delivered : t -> topic -> time -> t

duplicate_message_delivered ps topic validated increments the counter related to near-first mesh message deliveries on topic by the associated peer. validated is the time at which the message was seen by the automaton for the first time.

Sourceval invalid_message_delivered : t -> topic -> t

invalid_message_delivered ps topic increments the counter related to invalid messages sent by the associated peer.

Sourceval set_application_score : t -> float -> t

set_application_score ps score sets the application-specific score. This score can be positive or negative.

Sourceval refresh : t -> t option

refresh ps returns Some ps' with ps' a refreshed score record or None if the score expired. Refreshing a ps allows to update time-dependent spects of the scoring statistics.

Sourceval zero : value

The zero score value, corresponding to a neutral score.

Sourceval of_float : float -> value

Convert a float into a score value.

include Tezos_stdlib.Compare.S with type t := value
Sourceval (=) : value -> value -> bool

x = y iff compare x y = 0

Sourceval (<>) : value -> value -> bool

x <> y iff compare x y <> 0

Sourceval (<) : value -> value -> bool

x < y iff compare x y < 0

Sourceval (<=) : value -> value -> bool

x <= y iff compare x y <= 0

Sourceval (>=) : value -> value -> bool

x >= y iff compare x y >= 0

Sourceval (>) : value -> value -> bool

x > y iff compare x y > 0

Sourceval compare : value -> value -> int

compare an alias for the functor parameter's compare function

Sourceval equal : value -> value -> bool

equal x y iff compare x y = 0

Sourceval max : value -> value -> value

max x y is x if x >= y otherwise it is y

Sourceval min : value -> value -> value

min x y is x if x <= y otherwise it is y

include Tezos_base.TzPervasives.PRINTABLE with type t := t
Sourceval pp : Format.formatter -> t -> unit
Sourceval pp_value : Format.formatter -> value -> unit
Sourcemodule Introspection : sig ... end
Sourcemodule Internal_for_tests : sig ... end
OCaml

Innovation. Community. Security.