Module Mavryk_p2p_services.Peer_metadata

All the (persistent) metadata associated to a peer.

type t
val encoding : t Mavryk_base.TzPervasives.Data_encoding.t
val empty : unit -> t
val distributed_db_score : t -> float

the aggregate score function computed from the metadata collected for a peer

val prevalidation_score : t -> float
val score : t -> float
type requests_kind =
  1. | Branch
  2. | Head
  3. | Block_header
  4. | Operations
  5. | Protocols
  6. | Operation_hashes_for_block
  7. | Operations_for_block
  8. | Checkpoint
  9. | Protocol_branch
  10. | Predecessor_header
  11. | Other
type resource_kind =
  1. | Block
  2. | Operations
  3. | Protocol
type advertisement =
  1. | Head
  2. | Branch
type metadata =
  1. | Received_request of requests_kind
  2. | Sent_request of requests_kind
  3. | Failed_request of requests_kind
  4. | Scheduled_request of requests_kind
  5. | Received_response of requests_kind
  6. | Sent_response of requests_kind
  7. | Unexpected_response
  8. | Unactivated_chain
  9. | Inactive_chain
  10. | Future_block
  11. | Unadvertised of resource_kind
  12. | Sent_advertisement of advertisement
  13. | Received_advertisement of advertisement
  14. | Outdated_response
  15. | Valid_blocks
  16. | Old_heads
  17. | Cannot_download
  18. | Cannot_parse
  19. | Refused_by_prefilter
  20. | Refused_by_postfilter
  21. | Applied
  22. | Branch_delayed
  23. | Branch_refused
  24. | Refused
  25. | Duplicate
  26. | Outdated
val incr : t -> metadata -> unit

incr score counters . Used to compute the final score for a peer

val update_requests : t -> requests_kind -> bool -> unit
val update_responses : t -> requests_kind -> bool -> unit