diff --git a/contrib/kaitai-struct-files/files/alpha__constants.ksy b/contrib/kaitai-struct-files/files/alpha__constants.ksy index 51c655a4580b4cc3fdd8881a5461d58975dd2c90..a8ba2ca95fe4929dbb0edf78d82d60dcb91c3bb4 100644 --- a/contrib/kaitai-struct-files/files/alpha__constants.ksy +++ b/contrib/kaitai-struct-files/files/alpha__constants.ksy @@ -226,8 +226,6 @@ seq: type: s4 - id: nonce_revelation_threshold type: s4 -- id: blocks_per_stake_snapshot - type: s4 - id: cycles_per_voting_period type: s4 - id: hard_gas_limit_per_operation diff --git a/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy b/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy index fa867fa56722f5582b5e672bd4945eae4460fd19..17a5db4e9cd7c690006dc553df007101e38daa33 100644 --- a/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy +++ b/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy @@ -198,8 +198,6 @@ seq: type: s4 - id: nonce_revelation_threshold type: s4 -- id: blocks_per_stake_snapshot - type: s4 - id: cycles_per_voting_period type: s4 - id: hard_gas_limit_per_operation diff --git a/contrib/kaitai-struct-files/files/alpha__parameters.ksy b/contrib/kaitai-struct-files/files/alpha__parameters.ksy index e6801545055dcca9dbe0889cbfd8be4d8fee3efe..f773406ecaab8a5dafc1a7b40741369a7d72246d 100644 --- a/contrib/kaitai-struct-files/files/alpha__parameters.ksy +++ b/contrib/kaitai-struct-files/files/alpha__parameters.ksy @@ -476,8 +476,6 @@ seq: type: s4 - id: nonce_revelation_threshold type: s4 -- id: blocks_per_stake_snapshot - type: s4 - id: cycles_per_voting_period type: s4 - id: hard_gas_limit_per_operation diff --git a/src/lib_store/unix/test/alpha_utils.ml b/src/lib_store/unix/test/alpha_utils.ml index 365235f509ad7d345146b10eebeed41e1c3133b3..fc52ebe68e55ff5eb3d267bea543cd32c4df109b 100644 --- a/src/lib_store/unix/test/alpha_utils.ml +++ b/src/lib_store/unix/test/alpha_utils.ml @@ -375,23 +375,13 @@ let protocol_param_key = ["protocol_parameters"] let check_constants_consistency constants = let open Lwt_result_syntax in let open Constants_parametric_repr in - let {blocks_per_cycle; blocks_per_commitment; blocks_per_stake_snapshot; _} = - constants - in + let {blocks_per_cycle; blocks_per_commitment; _} = constants in let* () = Error_monad.unless (blocks_per_commitment <= blocks_per_cycle) (fun () -> failwith "Inconsistent constants : blocks per commitment must be less than \ blocks per cycle") in - let* () = - Error_monad.unless - (blocks_per_cycle >= blocks_per_stake_snapshot) - (fun () -> - failwith - "Inconsistent constants : blocks per cycle must be superior than \ - blocks per stake snapshot") - in return_unit let default_accounts = diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index aed7a63bb99f6980d19936c63db118f8cd6ffbad..92466e1c6776b650ec352d8c96b4d0900ed5b1f8 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -187,7 +187,6 @@ let constants_mainnet = blocks_per_cycle = 24576l; blocks_per_commitment = 192l; nonce_revelation_threshold = 768l; - blocks_per_stake_snapshot = 1536l; cycles_per_voting_period = 5l; hard_gas_limit_per_operation = Gas.Arith.(integral_of_int_exn 1_040_000); hard_gas_limit_per_block = Gas.Arith.(integral_of_int_exn 1_733_333); @@ -343,7 +342,6 @@ let constants_sandbox = blocks_per_cycle = 8l; blocks_per_commitment = 4l; nonce_revelation_threshold = 4l; - blocks_per_stake_snapshot = 4l; cycles_per_voting_period = 8l; proof_of_work_threshold = Int64.(sub (shift_left 1L 62) 1L); vdf_difficulty = 50_000L; @@ -380,7 +378,6 @@ let constants_test = blocks_per_cycle = 12l; blocks_per_commitment = 4l; nonce_revelation_threshold = 4l; - blocks_per_stake_snapshot = 4l; cycles_per_voting_period = 2l; proof_of_work_threshold = Int64.(sub (shift_left 1L 62) 1L) (* 1/4 of nonces are accepted *); diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index e4b23ce9463a0f24ef2a30d3c82dd9fc73a47c21..409b938cdf175777745894f6a062745ecb299ab8 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -897,7 +897,6 @@ module Constants : sig 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.Arith.integral; hard_gas_limit_per_block : Gas.Arith.integral; @@ -975,8 +974,6 @@ module Constants : sig val nonce_revelation_threshold : context -> int32 - val blocks_per_stake_snapshot : context -> int32 - val cycles_per_voting_period : context -> int32 val hard_gas_limit_per_operation : context -> Gas.Arith.integral diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 05aba5cf22c4dc099e0fb64f28eb3364d2a51ffc..cea14f53859b02c60df4d8eebe049d7f914bd442 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -179,7 +179,6 @@ type t = { 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; @@ -527,7 +526,6 @@ let encoding = ( 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, @@ -568,7 +566,6 @@ let encoding = ( 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, @@ -610,7 +607,6 @@ let encoding = 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; @@ -653,11 +649,10 @@ let encoding = (req "consensus_rights_delay" uint8) (req "blocks_preservation_cycles" uint8) (req "delegate_parameters_activation_delay" uint8)) - (obj9 + (obj8 (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" diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index ee3247a84cfa6e41b3efe3160345d2d71a310f13..7bb25c0804263cf3f2594ef658610ea1c4eb59b2 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -184,7 +184,6 @@ type t = { 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; diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index f8259a29c8aa135c6d56b65bdefa1e7e8740d033..14d4387913ff88da9f239beba03abf47f1e50711 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -236,20 +236,6 @@ let check_constants constants = (Invalid_protocol_constants "The delegation over baking limit must be greater than or equal to 0.") in - let* () = - error_unless - (let snapshot_frequence = - Int32.div - constants.blocks_per_cycle - constants.blocks_per_stake_snapshot - in - Compare.Int32.( - snapshot_frequence > Int32.zero - && snapshot_frequence < Int32.of_int (1 lsl 16))) - (Invalid_protocol_constants - "The ratio blocks_per_cycle per blocks_per_stake_snapshot should be \ - between 1 and 65535") - in let* () = error_unless Compare.Int32.( diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 4feb06a9a8d154bd32464acb3a192fdab8504051..1a20937146cf52ee9016422cb82510031ab23420 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -88,10 +88,6 @@ let nonce_revelation_threshold c = let constants = Raw_context.constants c in constants.nonce_revelation_threshold -let blocks_per_stake_snapshot c = - let constants = Raw_context.constants c in - constants.blocks_per_stake_snapshot - let cycles_per_voting_period c = let constants = Raw_context.constants c in constants.cycles_per_voting_period diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index 0c9ad1857919a7e9bb08776ed06841c786cd1221..e79f27fb406f472ea133a4291241f236006ae607 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -43,8 +43,6 @@ val blocks_per_commitment : Raw_context.t -> int32 val nonce_revelation_threshold : Raw_context.t -> int32 -val blocks_per_stake_snapshot : Raw_context.t -> int32 - val cycles_per_voting_period : Raw_context.t -> int32 val hard_gas_limit_per_operation : diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index 9231712e39f48399a893ce893fc325f765b87210..b452b6a22ff9c8fe9489201d50800d2a7d666571 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -955,7 +955,6 @@ let update_block_time_related_constants (c : Constants_parametric_repr.t) = let blocks_per_cycle = half_more c.blocks_per_cycle in let blocks_per_commitment = half_more c.blocks_per_commitment in let nonce_revelation_threshold = half_more c.nonce_revelation_threshold in - let blocks_per_stake_snapshot = half_more c.blocks_per_stake_snapshot in let max_operations_time_to_live = 3 * c.max_operations_time_to_live / 2 in let block_time = Int64.to_int (Period_repr.to_seconds minimal_block_delay) in let sc_rollup = @@ -967,7 +966,6 @@ let update_block_time_related_constants (c : Constants_parametric_repr.t) = blocks_per_cycle; blocks_per_commitment; nonce_revelation_threshold; - blocks_per_stake_snapshot; max_operations_time_to_live; minimal_block_delay; delay_increment_per_round; @@ -1202,7 +1200,6 @@ let prepare_first_block ~level ~timestamp _chain_id ctxt = blocks_per_cycle = c.blocks_per_cycle; blocks_per_commitment = c.blocks_per_commitment; nonce_revelation_threshold = c.nonce_revelation_threshold; - blocks_per_stake_snapshot = c.blocks_per_stake_snapshot; cycles_per_voting_period = c.cycles_per_voting_period; hard_gas_limit_per_operation = c.hard_gas_limit_per_operation; hard_gas_limit_per_block = c.hard_gas_limit_per_block; diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.ml b/src/proto_alpha/lib_protocol/test/helpers/block.ml index a84f6f4cbe38fa3b7577351ca69db8b5b99efb9b..d7fead596c3fb35bb1b91f30a406601c083b3b33 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/block.ml @@ -369,13 +369,7 @@ let protocol_param_key = ["protocol_parameters"] let check_constants_consistency constants = let open Lwt_result_syntax in let open Constants.Parametric in - let { - blocks_per_cycle; - blocks_per_commitment; - nonce_revelation_threshold; - blocks_per_stake_snapshot; - _; - } = + let {blocks_per_cycle; blocks_per_commitment; nonce_revelation_threshold; _} = constants in let* () = @@ -384,18 +378,10 @@ let check_constants_consistency constants = "Inconsistent constants : blocks_per_commitment must be less than \ blocks_per_cycle") in - let* () = - Error_monad.unless - (nonce_revelation_threshold <= blocks_per_cycle) - (fun () -> - failwith - "Inconsistent constants : nonce_revelation_threshold must be less \ - than blocks_per_cycle") - in - Error_monad.unless (blocks_per_cycle >= blocks_per_stake_snapshot) (fun () -> + Error_monad.unless (nonce_revelation_threshold <= blocks_per_cycle) (fun () -> failwith - "Inconsistent constants : blocks_per_cycle must be superior than \ - blocks_per_stake_snapshot") + "Inconsistent constants : nonce_revelation_threshold must be less than \ + blocks_per_cycle") let prepare_main_init_params ?bootstrap_contracts commitments constants bootstrap_accounts = diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out index 795b91fce55134a2e69ae8e7c301fe2552fe5c4c..0ef3de11e7d619f432ef27d54f9676767ba43828 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out @@ -12,8 +12,8 @@ "preserved_cycles": 2, "consensus_rights_delay": 2, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, - "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, - "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, + "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1733333", "proof_of_work_threshold": "4611686018427387903", "minimal_stake": "6000000000", "minimal_frozen_stake": "600000000", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out index 60dde986afeece866e3136e493ddd20a38187f6d..dc78a7fa0ea2da6ec07735ece857af4a00d8276b 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out @@ -12,8 +12,8 @@ "preserved_cycles": 2, "consensus_rights_delay": 2, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, - "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, - "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, + "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1733333", "proof_of_work_threshold": "4611686018427387903", "minimal_stake": "6000000000", "minimal_frozen_stake": "600000000", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out index 1127ebd4ca805139cf04bc91617c9d203882acad..567fb640fab7f5e07b4b7f7beb7d6475b0c85dc0 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out @@ -12,8 +12,8 @@ "preserved_cycles": 2, "consensus_rights_delay": 2, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, - "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, - "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, + "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1733333", "proof_of_work_threshold": "4611686018427387903", "minimal_stake": "6000000000", "minimal_frozen_stake": "600000000", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out index ee4e6e65150fc06d6229793561cdc182e6b38b4b..866fdd6154de98c768e946e5f079dd0c0f7a40a9 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out @@ -12,8 +12,8 @@ "preserved_cycles": 2, "consensus_rights_delay": 2, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, - "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, - "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, + "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1733333", "proof_of_work_threshold": "4611686018427387903", "minimal_stake": "6000000000", "minimal_frozen_stake": "600000000", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out index ee4e6e65150fc06d6229793561cdc182e6b38b4b..866fdd6154de98c768e946e5f079dd0c0f7a40a9 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out @@ -12,8 +12,8 @@ "preserved_cycles": 2, "consensus_rights_delay": 2, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, - "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, - "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, + "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1733333", "proof_of_work_threshold": "4611686018427387903", "minimal_stake": "6000000000", "minimal_frozen_stake": "600000000",