Module Mavryk_raw_protocol_alpha.Adaptive_issuance_storage

set_adaptive_issuance_enable ctxt sets the feature flag in the in-memory part of the context if the adaptive issuance feature has already launched. This means that the activation vote resulted in an approbation from the stakeholders and this happened sufficiently long ago.

load_reward_coeff ctxt loads the current cycle's reward coeff from the storage into the context

update_stored_rewards_at_cycle_end ctxt ~new_cycle updates Storage.Issuance_coeff with a new coefficient that will be applied consensus_rights_delay cycles after the given new_cycle. This new coefficient depends on the current Storage.Total_supply, and the total active stake for when this coefficient is computed.

This function also removes obsolete values from Storage.Issuance_coeff, and stores the current cycle's coefficient in the context for faster access.

init ctxt adds into the context an adaptive issuance vote EMA at 0, and adaptive issuance launch cycle at None.

update_ema ctxt ~vote returns the new context with the new EMA

launch_cycle ctxt reads from the context the cycle at which the adaptive issuance feature is set to activate.

If this function returns None, then it means the feature has not been voted to be activated (yet).

module For_RPC : sig ... end
module Internal_for_tests : sig ... end