package tezos-p2p

  1. Overview
  2. Docs
val add : t -> Tezos_base.P2p_addr.t -> unit

add t addr adds addr to the address greylist.

val clear : t -> unit

clear t removes all address greylistings.

val gc : t -> unit

gc t removes some address greylistings (the oldest have a higher probability to be removed, yet due to the underlying probabilistic structure, recent greylistings can be dropped).

val mem : t -> Tezos_base.P2p_addr.t -> bool

mem t addr tells if addr is greylisted, but may return a false positive due to the underlying probabilistic structure.

val fill_percentage : t -> float

fill_percentage t returns the percentage (in the 0,1 interval) of bloom filter cells which are nonzero.

val life_expectancy_histogram : t -> int array

life_expectancy_histogram t returns the life expectancy distribution of cells (measured in gc calls) stored as an array: the value at index k stores the number of cells that are k calls to gc away from being removed from the greylist.

val list : t -> Tezos_base.P2p_addr.t list

list t if list_not_reliable_since t returns None, returns the list of currently greylisted IPs. Else it return the list of all ips greylisted since `list_not_reliable_since`

val list_not_reliable_since : t -> Tezos_base.Time.System.t option
OCaml

Innovation. Community. Security.