Tezos_raw_protocol_alpha.Dal_storageval save_parameters :
Raw_context.t ->
Constants_parametric_previous_repr.dal ->
next_protocol_activation:Raw_level_repr.t ->
Raw_context.t Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.tsave_parameters ctxt constants_previous ~next_protocol_activation is called when a new protocol is activated, that is at the end of the last block of its previous protocol. Therefore next_protocol_activation is the level of the last block of the previous protocol, alongside the protocol constants used for this protocol: constant_previous.
The activation level and the parameters are saved in the context. Note that it transforms Constants_parametric_previous_repr.dal to Constants_parametric_repr.dal, therefore it assumes that it can be transformed at migration time. If for a given protocol it's not possible, retrocompatible encoding needs to be introduced.
val parameters :
Raw_context.t ->
Raw_level_repr.t ->
Constants_parametric_repr.dal
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.tparameters ctxt level returns the constants used for a given level. When level is a migration level, it returns the constants of the protocol that ends at that level. If the level is greater than any protocol migration level, it returns the current protocol constants.