Tezos_raw_protocol_alpha.Constants_parametric_repr
Protocol-specific constants.
When the protocol is activated via migration from its predecessor (e.g. on mainnet, ghostnet, <proto-name>net), these constants are fully controlled by Raw_context.prepare_first_block
, which copies over the value from the previous protocol for most constants, but may also modify some of them and/or initialize new constants.
When the protocol is activated from Genesis, e.g. in most tests, constant values must be provided through a parameter file (or internal arguments, depending of the level of abstraction). Typical default values for various situations are available in lib_parameters/default_parameters.ml
.
Note that there are also "hard" constants (non-parametric: cannot be adjusted in tests) which are defined in Constants_repr
.
Documentation on individual constants can be found either in this file or in lib_parameters/default_parameters.ml
. Eventually, we would like to keep the constant's documentation mainly into lib_parameters/default_parameters.ml
as it allows it to be rights next to each constant's current value, no matter whether the constant has been updated in the current protocol or not (whereas only the values of modified constants can be found in Raw_context.prepare_first_block
, so it's not a good place to put the documentation).
In order to add or modify a protocol constant, you should therefore:
Raw_context.prepare_first_block
, in the branch of the pattern matching corresponding to alpha
's predecessor.lib_parameters/default_parameters.ml
.lib_parameters/default_parameters.ml
. If the constant is already documented elsewhere, please move the documentation there.(The CI will fail if you don't update default_parameters.ml
accordingly.)
type dal = {
feature_enable : bool;
incentives_enable : bool;
number_of_slots : int;
attestation_lag : int;
attestation_threshold : int;
cryptobox_parameters : Tezos_protocol_environment_alpha.Dal.parameters;
minimal_participation_ratio : Tezos_protocol_environment_alpha.Q.t;
rewards_ratio : Tezos_protocol_environment_alpha.Q.t;
traps_fraction : Tezos_protocol_environment_alpha.Q.t;
}
val dal_encoding : dal Tezos_protocol_environment_alpha.Data_encoding.t
type sc_rollup_reveal_activation_level = {
raw_data : sc_rollup_reveal_hashing_schemes;
metadata : Raw_level_repr.t;
dal_page : Raw_level_repr.t;
dal_parameters : Raw_level_repr.t;
dal_attested_slots_validity_lag : int;
}
Associates reveal kinds to their activation level.
type sc_rollup = {
arith_pvm_enable : bool;
origination_size : int;
challenge_window_in_blocks : int;
stake_amount : Tez_repr.t;
commitment_period_in_blocks : int;
max_lookahead_in_blocks : int32;
max_active_outbox_levels : int32;
max_outbox_messages_per_level : int;
number_of_sections_in_dissection : int;
timeout_period_in_blocks : int;
max_number_of_stored_cemented_commitments : int;
max_number_of_parallel_games : int;
reveal_activation_level : sc_rollup_reveal_activation_level;
private_enable : bool;
riscv_pvm_enable : bool;
}
type adaptive_rewards_params = {
issuance_ratio_final_min : Tezos_protocol_environment_alpha.Q.t;
issuance_ratio_final_max : Tezos_protocol_environment_alpha.Q.t;
issuance_ratio_initial_min : Tezos_protocol_environment_alpha.Q.t;
issuance_ratio_initial_max : Tezos_protocol_environment_alpha.Q.t;
initial_period : int;
transition_period : int;
max_bonus : Issuance_bonus_repr.max_bonus;
growth_rate : Tezos_protocol_environment_alpha.Q.t;
center_dz : Tezos_protocol_environment_alpha.Q.t;
radius_dz : Tezos_protocol_environment_alpha.Q.t;
}
type adaptive_issuance = {
global_limit_of_staking_over_baking : int;
edge_of_staking_over_delegation : int;
adaptive_rewards_params : adaptive_rewards_params;
}
type issuance_weights = {
base_total_issued_per_minute : Tez_repr.t;
baking_reward_fixed_portion_weight : int;
baking_reward_bonus_weight : int;
attesting_reward_weight : int;
seed_nonce_revelation_tip_weight : int;
vdf_revelation_tip_weight : int;
dal_rewards_weight : int;
}
type t = {
consensus_rights_delay : int;
blocks_preservation_cycles : int;
delegate_parameters_activation_delay : int;
tolerated_inactivity_period : int;
blocks_per_cycle : int32;
blocks_per_commitment : int32;
nonce_revelation_threshold : int32;
cycles_per_voting_period : int32;
hard_gas_limit_per_operation : Gas_limit_repr.Arith.integral;
hard_gas_limit_per_block : Gas_limit_repr.Arith.integral;
proof_of_work_threshold : int64;
minimal_stake : Tez_repr.t;
minimal_frozen_stake : Tez_repr.t;
vdf_difficulty : int64;
origination_size : int;
issuance_weights : issuance_weights;
cost_per_byte : Tez_repr.t;
hard_storage_limit_per_operation : Tezos_protocol_environment_alpha.Z.t;
quorum_min : int32;
quorum_max : int32;
min_proposal_quorum : int32;
liquidity_baking_subsidy : Tez_repr.t;
liquidity_baking_toggle_ema_threshold : int32;
max_operations_time_to_live : int;
minimal_block_delay : Period_repr.t;
delay_increment_per_round : Period_repr.t;
minimal_participation_ratio : Ratio_repr.t;
consensus_committee_size : int;
consensus_threshold_size : int;
limit_of_delegation_over_baking : int;
percentage_of_frozen_deposits_slashed_per_double_baking : Percentage.t;
max_slashing_per_block : Percentage.t;
max_slashing_threshold : Ratio_repr.t;
testnet_dictator : Tezos_protocol_environment_alpha.Signature.Public_key_hash.t
option;
initial_seed : State_hash.t option;
cache_script_size : int;
cache_stake_distribution_cycles : int;
cache_sampler_state_cycles : int;
dal : dal;
sc_rollup : sc_rollup;
zk_rollup : zk_rollup;
adaptive_issuance : adaptive_issuance;
direct_ticket_spending_enable : bool;
aggregate_attestation : bool;
allow_tz4_delegate_enable : bool;
all_bakers_attest_activation_level : Raw_level_repr.t option;
}
val encoding : t Tezos_protocol_environment_alpha.Data_encoding.encoding
update_sc_rollup_parameter ratio_f c
updates the smart rollups constants expressed in number of blocks (e.g., commitment_period_in_blocks
) to preserve their average duration with a new block time.
This function is primilarly intended to be used by the Init_storage
module. ratio_f
is a function used to compute the new constants. For instance, if the block time is multiplied by 4/5, then the constant should be multiplied by 5/4.
module Internal_for_tests : sig ... end