123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* 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. *)(* *)(*****************************************************************************)letversion_number_004="\000"letversion_number="\001"letproof_of_work_nonce_size=8letnonce_length=32letmax_revelations_per_block=32letmax_proposals_per_delegate=20letmax_operation_data_length=16*1024(* 16kB *)typefixed={proof_of_work_nonce_size:int;nonce_length:int;max_revelations_per_block:int;max_operation_data_length:int;max_proposals_per_delegate:int;}letfixed_encoding=letopenData_encodinginconv(func->(c.proof_of_work_nonce_size,c.nonce_length,c.max_revelations_per_block,c.max_operation_data_length,c.max_proposals_per_delegate))(fun(proof_of_work_nonce_size,nonce_length,max_revelations_per_block,max_operation_data_length,max_proposals_per_delegate)->{proof_of_work_nonce_size;nonce_length;max_revelations_per_block;max_operation_data_length;max_proposals_per_delegate;})(obj5(req"proof_of_work_nonce_size"uint8)(req"nonce_length"uint8)(req"max_revelations_per_block"uint8)(req"max_operation_data_length"int31)(req"max_proposals_per_delegate"uint8))letfixed={proof_of_work_nonce_size;nonce_length;max_revelations_per_block;max_operation_data_length;max_proposals_per_delegate;}typeparametric={preserved_cycles:int;blocks_per_cycle:int32;blocks_per_commitment:int32;blocks_per_roll_snapshot:int32;blocks_per_voting_period:int32;time_between_blocks:Period_repr.tlist;endorsers_per_block:int;hard_gas_limit_per_operation:Z.t;hard_gas_limit_per_block:Z.t;proof_of_work_threshold:int64;tokens_per_roll:Tez_repr.t;michelson_maximum_type_size:int;seed_nonce_revelation_tip:Tez_repr.t;origination_size:int;block_security_deposit:Tez_repr.t;endorsement_security_deposit:Tez_repr.t;block_reward:Tez_repr.t;endorsement_reward:Tez_repr.t;cost_per_byte:Tez_repr.t;hard_storage_limit_per_operation:Z.t;test_chain_duration:int64;(* in seconds *)quorum_min:int32;quorum_max:int32;min_proposal_quorum:int32;initial_endorsers:int;delay_per_missing_endorsement:Period_repr.t;}letparametric_encoding=letopenData_encodinginconv(func->((c.preserved_cycles,c.blocks_per_cycle,c.blocks_per_commitment,c.blocks_per_roll_snapshot,c.blocks_per_voting_period,c.time_between_blocks,c.endorsers_per_block,c.hard_gas_limit_per_operation,c.hard_gas_limit_per_block),((c.proof_of_work_threshold,c.tokens_per_roll,c.michelson_maximum_type_size,c.seed_nonce_revelation_tip,c.origination_size,c.block_security_deposit,c.endorsement_security_deposit,c.block_reward),(c.endorsement_reward,c.cost_per_byte,c.hard_storage_limit_per_operation,c.test_chain_duration,c.quorum_min,c.quorum_max,c.min_proposal_quorum,c.initial_endorsers,c.delay_per_missing_endorsement))))(fun((preserved_cycles,blocks_per_cycle,blocks_per_commitment,blocks_per_roll_snapshot,blocks_per_voting_period,time_between_blocks,endorsers_per_block,hard_gas_limit_per_operation,hard_gas_limit_per_block),((proof_of_work_threshold,tokens_per_roll,michelson_maximum_type_size,seed_nonce_revelation_tip,origination_size,block_security_deposit,endorsement_security_deposit,block_reward),(endorsement_reward,cost_per_byte,hard_storage_limit_per_operation,test_chain_duration,quorum_min,quorum_max,min_proposal_quorum,initial_endorsers,delay_per_missing_endorsement)))->{preserved_cycles;blocks_per_cycle;blocks_per_commitment;blocks_per_roll_snapshot;blocks_per_voting_period;time_between_blocks;endorsers_per_block;hard_gas_limit_per_operation;hard_gas_limit_per_block;proof_of_work_threshold;tokens_per_roll;michelson_maximum_type_size;seed_nonce_revelation_tip;origination_size;block_security_deposit;endorsement_security_deposit;block_reward;endorsement_reward;cost_per_byte;hard_storage_limit_per_operation;test_chain_duration;quorum_min;quorum_max;min_proposal_quorum;initial_endorsers;delay_per_missing_endorsement;})(merge_objs(obj9(req"preserved_cycles"uint8)(req"blocks_per_cycle"int32)(req"blocks_per_commitment"int32)(req"blocks_per_roll_snapshot"int32)(req"blocks_per_voting_period"int32)(req"time_between_blocks"(listPeriod_repr.encoding))(req"endorsers_per_block"uint16)(req"hard_gas_limit_per_operation"z)(req"hard_gas_limit_per_block"z))(merge_objs(obj8(req"proof_of_work_threshold"int64)(req"tokens_per_roll"Tez_repr.encoding)(req"michelson_maximum_type_size"uint16)(req"seed_nonce_revelation_tip"Tez_repr.encoding)(req"origination_size"int31)(req"block_security_deposit"Tez_repr.encoding)(req"endorsement_security_deposit"Tez_repr.encoding)(req"block_reward"Tez_repr.encoding))(obj9(req"endorsement_reward"Tez_repr.encoding)(req"cost_per_byte"Tez_repr.encoding)(req"hard_storage_limit_per_operation"z)(req"test_chain_duration"int64)(req"quorum_min"int32)(req"quorum_max"int32)(req"min_proposal_quorum"int32)(req"initial_endorsers"uint16)(req"delay_per_missing_endorsement"Period_repr.encoding))))typet={fixed:fixed;parametric:parametric;}letencoding=letopenData_encodinginconv(fun{fixed;parametric}->(fixed,parametric))(fun(fixed,parametric)->{fixed;parametric})(merge_objsfixed_encodingparametric_encoding)