123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *)(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typedal={feature_enable:bool;number_of_slots:int;attestation_lag:int;availability_threshold:int;cryptobox_parameters:Dal.parameters;}letdal_encoding=letopenData_encodinginconv(fun{feature_enable;number_of_slots;attestation_lag;availability_threshold;cryptobox_parameters;}->((feature_enable,number_of_slots,attestation_lag,availability_threshold),cryptobox_parameters))(fun((feature_enable,number_of_slots,attestation_lag,availability_threshold),cryptobox_parameters)->{feature_enable;number_of_slots;attestation_lag;availability_threshold;cryptobox_parameters;})(merge_objs(obj4(req"feature_enable"bool)(req"number_of_slots"int16)(req"attestation_lag"int16)(req"availability_threshold"int16))Dal.parameters_encoding)(* The encoded representation of this type is stored in the context as
bytes. Changing the encoding, or the value of these constants from
the previous protocol may break the context migration, or (even
worse) yield an incorrect context after migration.
If you change this encoding compared to `Constants_parametric_previous_repr.t`,
you should ensure that there is a proper migration of the constants
during context migration. See: `Raw_context.prepare_first_block` *)typetx_rollup={enable:bool;origination_size:int;hard_size_limit_per_inbox:int;hard_size_limit_per_message:int;commitment_bond:Tez_repr.t;finality_period:int;withdraw_period:int;max_inboxes_count:int;max_messages_per_inbox:int;max_commitments_count:int;cost_per_byte_ema_factor:int;max_ticket_payload_size:int;max_withdrawals_per_batch:int;rejection_max_proof_size:int;sunset_level:int32;}typesc_rollup={enable:bool;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;}typezk_rollup={enable:bool;origination_size:int;min_pending_to_process:int;}typet={preserved_cycles:int;blocks_per_cycle:int32;blocks_per_commitment:int32;nonce_revelation_threshold:int32;blocks_per_stake_snapshot: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;vdf_difficulty:int64;seed_nonce_revelation_tip:Tez_repr.t;origination_size:int;baking_reward_fixed_portion:Tez_repr.t;baking_reward_bonus_per_slot:Tez_repr.t;endorsing_reward_per_slot:Tez_repr.t;cost_per_byte:Tez_repr.t;hard_storage_limit_per_operation: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:int;max_slashing_period:int;frozen_deposits_percentage:int;double_baking_punishment:Tez_repr.t;ratio_of_frozen_deposits_slashed_per_double_endorsement:Ratio_repr.t;testnet_dictator:Signature.Public_key_hash.toption;initial_seed:State_hash.toption;(* If a new cache is added, please also modify the
[cache_layout_size] value. *)cache_script_size:int;cache_stake_distribution_cycles:int;cache_sampler_state_cycles:int;tx_rollup:tx_rollup;dal:dal;sc_rollup:sc_rollup;zk_rollup:zk_rollup;}lettx_rollup_encoding=letopenData_encodinginconv(fun(c:tx_rollup)->((c.enable,c.origination_size,c.hard_size_limit_per_inbox,c.hard_size_limit_per_message,c.max_withdrawals_per_batch,c.commitment_bond,c.finality_period,c.withdraw_period,c.max_inboxes_count,c.max_messages_per_inbox),(c.max_commitments_count,c.cost_per_byte_ema_factor,c.max_ticket_payload_size,c.rejection_max_proof_size,c.sunset_level)))(fun((tx_rollup_enable,tx_rollup_origination_size,tx_rollup_hard_size_limit_per_inbox,tx_rollup_hard_size_limit_per_message,tx_rollup_max_withdrawals_per_batch,tx_rollup_commitment_bond,tx_rollup_finality_period,tx_rollup_withdraw_period,tx_rollup_max_inboxes_count,tx_rollup_max_messages_per_inbox),(tx_rollup_max_commitments_count,tx_rollup_cost_per_byte_ema_factor,tx_rollup_max_ticket_payload_size,tx_rollup_rejection_max_proof_size,tx_rollup_sunset_level))->{enable=tx_rollup_enable;origination_size=tx_rollup_origination_size;hard_size_limit_per_inbox=tx_rollup_hard_size_limit_per_inbox;hard_size_limit_per_message=tx_rollup_hard_size_limit_per_message;max_withdrawals_per_batch=tx_rollup_max_withdrawals_per_batch;commitment_bond=tx_rollup_commitment_bond;finality_period=tx_rollup_finality_period;withdraw_period=tx_rollup_withdraw_period;max_inboxes_count=tx_rollup_max_inboxes_count;max_messages_per_inbox=tx_rollup_max_messages_per_inbox;max_commitments_count=tx_rollup_max_commitments_count;cost_per_byte_ema_factor=tx_rollup_cost_per_byte_ema_factor;max_ticket_payload_size=tx_rollup_max_ticket_payload_size;rejection_max_proof_size=tx_rollup_rejection_max_proof_size;sunset_level=tx_rollup_sunset_level;})(merge_objs(obj10(req"tx_rollup_enable"bool)(req"tx_rollup_origination_size"int31)(req"tx_rollup_hard_size_limit_per_inbox"int31)(req"tx_rollup_hard_size_limit_per_message"int31)(req"tx_rollup_max_withdrawals_per_batch"int31)(req"tx_rollup_commitment_bond"Tez_repr.encoding)(req"tx_rollup_finality_period"int31)(req"tx_rollup_withdraw_period"int31)(req"tx_rollup_max_inboxes_count"int31)(req"tx_rollup_max_messages_per_inbox"int31))(obj5(req"tx_rollup_max_commitments_count"int31)(req"tx_rollup_cost_per_byte_ema_factor"int31)(req"tx_rollup_max_ticket_payload_size"int31)(req"tx_rollup_rejection_max_proof_size"int31)(req"tx_rollup_sunset_level"int32)))letsc_rollup_encoding=letopenData_encodinginconv(fun(c:sc_rollup)->((c.enable,c.arith_pvm_enable,c.origination_size,c.challenge_window_in_blocks,c.stake_amount,c.commitment_period_in_blocks,c.max_lookahead_in_blocks,c.max_active_outbox_levels,c.max_outbox_messages_per_level),(c.number_of_sections_in_dissection,c.timeout_period_in_blocks,c.max_number_of_stored_cemented_commitments,c.max_number_of_parallel_games)))(fun((sc_rollup_enable,sc_rollup_arith_pvm_enable,sc_rollup_origination_size,sc_rollup_challenge_window_in_blocks,sc_rollup_stake_amount,sc_rollup_commitment_period_in_blocks,sc_rollup_max_lookahead_in_blocks,sc_rollup_max_active_outbox_levels,sc_rollup_max_outbox_messages_per_level),(sc_rollup_number_of_sections_in_dissection,sc_rollup_timeout_period_in_blocks,sc_rollup_max_number_of_cemented_commitments,sc_rollup_max_number_of_parallel_games))->{enable=sc_rollup_enable;arith_pvm_enable=sc_rollup_arith_pvm_enable;origination_size=sc_rollup_origination_size;challenge_window_in_blocks=sc_rollup_challenge_window_in_blocks;stake_amount=sc_rollup_stake_amount;commitment_period_in_blocks=sc_rollup_commitment_period_in_blocks;max_lookahead_in_blocks=sc_rollup_max_lookahead_in_blocks;max_active_outbox_levels=sc_rollup_max_active_outbox_levels;max_outbox_messages_per_level=sc_rollup_max_outbox_messages_per_level;number_of_sections_in_dissection=sc_rollup_number_of_sections_in_dissection;timeout_period_in_blocks=sc_rollup_timeout_period_in_blocks;max_number_of_stored_cemented_commitments=sc_rollup_max_number_of_cemented_commitments;max_number_of_parallel_games=sc_rollup_max_number_of_parallel_games;})(merge_objs(obj9(req"smart_rollup_enable"bool)(req"smart_rollup_arith_pvm_enable"bool)(req"smart_rollup_origination_size"int31)(req"smart_rollup_challenge_window_in_blocks"int31)(req"smart_rollup_stake_amount"Tez_repr.encoding)(req"smart_rollup_commitment_period_in_blocks"int31)(req"smart_rollup_max_lookahead_in_blocks"int32)(req"smart_rollup_max_active_outbox_levels"int32)(req"smart_rollup_max_outbox_messages_per_level"int31))(obj4(req"smart_rollup_number_of_sections_in_dissection"uint8)(req"smart_rollup_timeout_period_in_blocks"int31)(req"smart_rollup_max_number_of_cemented_commitments"int31)(req"smart_rollup_max_number_of_parallel_games"int31)))letzk_rollup_encoding=letopenData_encodinginconv(fun({enable;origination_size;min_pending_to_process}:zk_rollup)->(enable,origination_size,min_pending_to_process))(fun(zk_rollup_enable,zk_rollup_origination_size,zk_rollup_min_pending_to_process)->{enable=zk_rollup_enable;origination_size=zk_rollup_origination_size;min_pending_to_process=zk_rollup_min_pending_to_process;})(obj3(req"zk_rollup_enable"bool)(req"zk_rollup_origination_size"int31)(req"zk_rollup_min_pending_to_process"int31))letencoding=letopenData_encodinginconv(func->((c.preserved_cycles,c.blocks_per_cycle,c.blocks_per_commitment,c.nonce_revelation_threshold,c.blocks_per_stake_snapshot,c.cycles_per_voting_period,c.hard_gas_limit_per_operation,c.hard_gas_limit_per_block,c.proof_of_work_threshold,c.minimal_stake),((c.vdf_difficulty,c.seed_nonce_revelation_tip,c.origination_size,c.baking_reward_fixed_portion,c.baking_reward_bonus_per_slot,c.endorsing_reward_per_slot,c.cost_per_byte,c.hard_storage_limit_per_operation,c.quorum_min),((c.quorum_max,c.min_proposal_quorum,c.liquidity_baking_subsidy,c.liquidity_baking_toggle_ema_threshold,c.max_operations_time_to_live,c.minimal_block_delay,c.delay_increment_per_round,c.consensus_committee_size,c.consensus_threshold),((c.minimal_participation_ratio,c.max_slashing_period,c.frozen_deposits_percentage,c.double_baking_punishment,c.ratio_of_frozen_deposits_slashed_per_double_endorsement,c.testnet_dictator,c.initial_seed),((c.cache_script_size,c.cache_stake_distribution_cycles,c.cache_sampler_state_cycles),(c.tx_rollup,(c.dal,(c.sc_rollup,c.zk_rollup)))))))))(fun((preserved_cycles,blocks_per_cycle,blocks_per_commitment,nonce_revelation_threshold,blocks_per_stake_snapshot,cycles_per_voting_period,hard_gas_limit_per_operation,hard_gas_limit_per_block,proof_of_work_threshold,minimal_stake),((vdf_difficulty,seed_nonce_revelation_tip,origination_size,baking_reward_fixed_portion,baking_reward_bonus_per_slot,endorsing_reward_per_slot,cost_per_byte,hard_storage_limit_per_operation,quorum_min),((quorum_max,min_proposal_quorum,liquidity_baking_subsidy,liquidity_baking_toggle_ema_threshold,max_operations_time_to_live,minimal_block_delay,delay_increment_per_round,consensus_committee_size,consensus_threshold),((minimal_participation_ratio,max_slashing_period,frozen_deposits_percentage,double_baking_punishment,ratio_of_frozen_deposits_slashed_per_double_endorsement,testnet_dictator,initial_seed),((cache_script_size,cache_stake_distribution_cycles,cache_sampler_state_cycles),(tx_rollup,(dal,(sc_rollup,zk_rollup))))))))->{preserved_cycles;blocks_per_cycle;blocks_per_commitment;nonce_revelation_threshold;blocks_per_stake_snapshot;cycles_per_voting_period;hard_gas_limit_per_operation;hard_gas_limit_per_block;proof_of_work_threshold;minimal_stake;vdf_difficulty;seed_nonce_revelation_tip;origination_size;baking_reward_fixed_portion;baking_reward_bonus_per_slot;endorsing_reward_per_slot;cost_per_byte;hard_storage_limit_per_operation;quorum_min;quorum_max;min_proposal_quorum;liquidity_baking_subsidy;liquidity_baking_toggle_ema_threshold;max_operations_time_to_live;minimal_block_delay;delay_increment_per_round;minimal_participation_ratio;max_slashing_period;consensus_committee_size;consensus_threshold;frozen_deposits_percentage;double_baking_punishment;ratio_of_frozen_deposits_slashed_per_double_endorsement;testnet_dictator;initial_seed;cache_script_size;cache_stake_distribution_cycles;cache_sampler_state_cycles;tx_rollup;dal;sc_rollup;zk_rollup;})(merge_objs(obj10(req"preserved_cycles"uint8)(req"blocks_per_cycle"int32)(req"blocks_per_commitment"int32)(req"nonce_revelation_threshold"int32)(req"blocks_per_stake_snapshot"int32)(req"cycles_per_voting_period"int32)(req"hard_gas_limit_per_operation"Gas_limit_repr.Arith.z_integral_encoding)(req"hard_gas_limit_per_block"Gas_limit_repr.Arith.z_integral_encoding)(req"proof_of_work_threshold"int64)(req"minimal_stake"Tez_repr.encoding))(merge_objs(obj9(req"vdf_difficulty"int64)(req"seed_nonce_revelation_tip"Tez_repr.encoding)(req"origination_size"int31)(req"baking_reward_fixed_portion"Tez_repr.encoding)(req"baking_reward_bonus_per_slot"Tez_repr.encoding)(req"endorsing_reward_per_slot"Tez_repr.encoding)(req"cost_per_byte"Tez_repr.encoding)(req"hard_storage_limit_per_operation"z)(req"quorum_min"int32))(merge_objs(obj9(req"quorum_max"int32)(req"min_proposal_quorum"int32)(req"liquidity_baking_subsidy"Tez_repr.encoding)(req"liquidity_baking_toggle_ema_threshold"int32)(req"max_operations_time_to_live"int16)(req"minimal_block_delay"Period_repr.encoding)(req"delay_increment_per_round"Period_repr.encoding)(req"consensus_committee_size"int31)(req"consensus_threshold"int31))(merge_objs(obj7(req"minimal_participation_ratio"Ratio_repr.encoding)(req"max_slashing_period"int31)(req"frozen_deposits_percentage"int31)(req"double_baking_punishment"Tez_repr.encoding)(req"ratio_of_frozen_deposits_slashed_per_double_endorsement"Ratio_repr.encoding)(opt"testnet_dictator"Signature.Public_key_hash.encoding)(opt"initial_seed"State_hash.encoding))(merge_objs(obj3(req"cache_script_size"int31)(req"cache_stake_distribution_cycles"int8)(req"cache_sampler_state_cycles"int8))(merge_objstx_rollup_encoding(merge_objs(obj1(req"dal_parametric"dal_encoding))(merge_objssc_rollup_encodingzk_rollup_encoding))))))))