Octez_baking_common.Signing_delayEnforce that if the environment variable signing_delay_env_var is set, then signing delay is allowed in the current configuration.
If not, print an error message and exit the program with code 1.
module Events : sig ... endartificial_delay_opt is None if no artificial delay is configured, or Some d where d is a random delay in seconds to wait before signing.
The environment variable TEZOS_SIGN_DELAY_I_KNOW_WHAT_I_AM_DOING can be set to configure an artificial delay. Its value must be either:
d, in which case the delay will be a random value uniformly distributed in 0, d;d1, d2 separated by a comma, with d1 <= d2, in which case the delay will be a random value uniformly distributed in d1, d2.If the environment variable is set but has an invalid value, then no delay is configured and an error message is printed.
val sign_with_minimum_duration :
(module Tezos_profiler.Profiler.GLOBAL_PROFILER) ->
(unit -> 'a Lwt.t) ->
'a Lwt.tsign_with_minimum_duration (module Profiler) sign_f runs sign_f () and ensures the call takes at least the configured artificial delay. A profiler module is needed to ensure correct profiling of the signature.
If artificial_delay_opt = Some d, it runs sign_f () and waits for a delay of d seconds concurrently. The function returns the result of the signing only after both the signing operation and the delay have elapsed. This makes the total duration of the call at least d seconds.
If no delay is configured, it just runs sign_f ().