Module Subconfig.Message

type t
include Tezos_base.TzPervasives.PRINTABLE with type t := t
val pp : Stdlib.Format.formatter -> t -> unit
include Tezos_base.TzPervasives.COMPARABLE with type t := t
val (=) : t -> t -> bool

x = y iff compare x y = 0

val (<>) : t -> t -> bool

x <> y iff compare x y <> 0

val (<) : t -> t -> bool

x < y iff compare x y < 0

val (<=) : t -> t -> bool

x <= y iff compare x y <= 0

val (>=) : t -> t -> bool

x >= y iff compare x y >= 0

val (>) : t -> t -> bool

x > y iff compare x y > 0

val compare : t -> t -> int

compare an alias for the functor parameter's compare function

val equal : t -> t -> bool

equal x y iff compare x y = 0

val max : t -> t -> t

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

val min : t -> t -> t

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

val valid : ?message:t -> message_id:Message_id.t -> unit -> [ `Valid | `Unknown | `Outdated | `Invalid ]

valid performs an application layer-level validity check on a message id and a message if given.

The message id (and message if any) could either be `Valid in the current context or `Invalid, meaning that it is/they are not valid (in the present time, in the past and in the future). The application layer could also return `Outdated or `Unknown if the message id is outdated or if the application doesn't care about validity. In this case, the application might omit some costly validity checks.

val valid_batch : (Peer.t * Topic.t * Message_id.t * t * Peer.Set.t) list -> [ `Valid | `Unknown | `Outdated | `Invalid ] list

valid_batch performs an application layer-level validity check on a message batch.

If the message_handling field of the gossipsub worker is Sequentially, this function is never called. This function is called when the field is In_batches. However, valid is still called even in this case: since message ids are not batched and valid_batch cannot be called without providing a message, valid remains used when processing message ids without the message, especially the IHave events.

The output is a list of the same length as the input, containing the result for each message of the batch.