diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out index 8babebe3fadb68a1bc39c727077d1531e6376b5c..4c585c653a0ae4dd16964ae2e92002bec5bfe473 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out @@ -3,19 +3,19 @@ Address: 0xff00000000000000000000000000000000000002 Topics: - 0x7ee7a1de9c18ce695c95b8b19fbdf26cce3544e3ca9e08c9f487776783d7599f -- 0x83fa75cb8976a0a19a558662f9a23b43ee119469ca5d1b1c25ab81b822280b27 +- 0x0a7f08b28bfb0812b548025f87d603a2323750a725cf8d61c777756f33f69b0a Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000002 # FA Withdrawal ## Log 0 Address: 0xff00000000000000000000000000000000000002 Topics: - 0xab68450c9e546f6062a861eebf8ec5bbd41b4425e26b20199c91227c7f9038ca -- 0x83fa75cb8976a0a19a558662f9a23b43ee119469ca5d1b1c25ab81b822280b27 -Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c000000000000000000000000000000000000000000000000000000000000000001a1bb750903c3e419b322ee388e74e3f97e00f09e000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000 +- 0x0a7f08b28bfb0812b548025f87d603a2323750a725cf8d61c777756f33f69b0a +Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c000000000000000000000000000000000000000000000000000000000000000001869fa13f83d506a4fc71122a7a1fd07a68081006000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000 # FA Fast Withdrawal ## Log 0 Address: 0xff00000000000000000000000000000000000002 Topics: - 0x7e40c982e82bccb5e8bbd29f38bcfa3996f341ef9f51e2a9cffe086ec87a11c7 -- 0x83fa75cb8976a0a19a558662f9a23b43ee119469ca5d1b1c25ab81b822280b27 -Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000c55cf02dbeecc978d9c84625dcae72bb77ea4fbd0000000000000000000001a1bb750903c3e419b322ee388e74e3f97e00f09e000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000005e0be103000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001 +- 0x0a7f08b28bfb0812b548025f87d603a2323750a725cf8d61c777756f33f69b0a +Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000c55cf02dbeecc978d9c84625dcae72bb77ea4fbd0000000000000000000001869fa13f83d506a4fc71122a7a1fd07a68081006000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000005e0be103000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001 diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out index e5dd1b372d5c8418603da6d15a81e765972ae029..6716c9f0f4b3c87f2e587f6e749dd20f6dac8f07 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out @@ -3,7 +3,7 @@ Address: 0xff00000000000000000000000000000000000002 Topics: - 0xb02d79c5657e344e23d91529b954c3087c60a974d598939583904a4f0b959614 -- 0x13d1ace30beaa763d08656e720bee6c9fbda87c1e78a5d8e400e904aa1a2529b +- 0x106ef28b733794add0506347b61933862ac856fc0c28b75f36afe923f3032e0a - 0x000000000000000000000000d77420f73b4612a7a99dba8c2afd30a1886b0344 Data: 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d77420f73b4612a7a99dba8c2afd30a1886b0344000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000003 # Claimed deposit @@ -11,5 +11,5 @@ Data: 0x000000000000000000000000000000000000000000000000000000000000000000000000 Address: 0xff00000000000000000000000000000000000002 Topics: - 0x7ee7a1de9c18ce695c95b8b19fbdf26cce3544e3ca9e08c9f487776783d7599f -- 0x13d1ace30beaa763d08656e720bee6c9fbda87c1e78a5d8e400e904aa1a2529b +- 0x106ef28b733794add0506347b61933862ac856fc0c28b75f36afe923f3032e0a Data: 0x000000000000000000000000d77420f73b4612a7a99dba8c2afd30a1886b0344000000000000000000000000d77420f73b4612a7a99dba8c2afd30a1886b0344000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000003 diff --git a/src/lib_dal_node_services/types.ml b/src/lib_dal_node_services/types.ml index 6cf9c377d4b36dc4e0faa0e8c54f8d26b8a9b150..03967f3588101d7538dd85dd1ec15d1288ace033 100644 --- a/src/lib_dal_node_services/types.ml +++ b/src/lib_dal_node_services/types.ml @@ -371,6 +371,7 @@ type proto_parameters = { dynamic_lag_enable : bool; number_of_slots : int; attestation_lag : int; + attestation_lags : int list; attestation_threshold : int; traps_fraction : Q.t; cryptobox_parameters : Cryptobox.Verifier.parameters; @@ -529,6 +530,7 @@ let proto_parameters_encoding : proto_parameters Data_encoding.t = dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; traps_fraction; cryptobox_parameters; @@ -544,6 +546,7 @@ let proto_parameters_encoding : proto_parameters Data_encoding.t = dynamic_lag_enable, number_of_slots, attestation_lag, + attestation_lags, attestation_threshold, traps_fraction ), ( cryptobox_parameters, @@ -557,6 +560,7 @@ let proto_parameters_encoding : proto_parameters Data_encoding.t = dynamic_lag_enable, number_of_slots, attestation_lag, + attestation_lags, attestation_threshold, traps_fraction ), ( cryptobox_parameters, @@ -572,6 +576,7 @@ let proto_parameters_encoding : proto_parameters Data_encoding.t = dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; traps_fraction; cryptobox_parameters; @@ -582,12 +587,13 @@ let proto_parameters_encoding : proto_parameters Data_encoding.t = minimal_block_delay; }) (merge_objs - (obj7 + (obj8 (req "feature_enable" bool) (req "incentives_enable" bool) (req "dynamic_lag_enable" bool) (req "number_of_slots" int31) (req "attestation_lag" int31) + (req "attestation_lags" (list int31)) (req "attestation_threshold" int31) (req "traps_fraction" q_encoding)) (obj6 diff --git a/src/lib_dal_node_services/types.mli b/src/lib_dal_node_services/types.mli index dc5839f51fab13174ae6cf2663b1cb65ee7fd7da..747871c417fff2631de00dd076bae895ebc91d32 100644 --- a/src/lib_dal_node_services/types.mli +++ b/src/lib_dal_node_services/types.mli @@ -274,6 +274,7 @@ type proto_parameters = { dynamic_lag_enable : bool; number_of_slots : int; attestation_lag : int; + attestation_lags : int list; attestation_threshold : int; traps_fraction : Q.t; cryptobox_parameters : Cryptobox.Verifier.parameters; diff --git a/src/proto_021_PsQuebec/lib_dal/dal_plugin_registration.ml b/src/proto_021_PsQuebec/lib_dal/dal_plugin_registration.ml index 184eaf58f19c1d4062d8538e819115088a5f372e..9a961e134d55c96bbad91ce6656acb35291ec7b2 100644 --- a/src/proto_021_PsQuebec/lib_dal/dal_plugin_registration.ml +++ b/src/proto_021_PsQuebec/lib_dal/dal_plugin_registration.ml @@ -65,6 +65,7 @@ module Plugin = struct dynamic_lag_enable = false; number_of_slots; attestation_lag; + attestation_lags = [attestation_lag]; attestation_threshold; traps_fraction = Q.(1 // 1000); (* not used in proto_021 *) diff --git a/src/proto_022_PsRiotum/lib_dal/dal_plugin_registration.ml b/src/proto_022_PsRiotum/lib_dal/dal_plugin_registration.ml index 5ea2b9d48ea70d373de70ec6b06b7e146326bc85..25dbe72ae2bcb4382810d7bfd39e8dec82c789f9 100644 --- a/src/proto_022_PsRiotum/lib_dal/dal_plugin_registration.ml +++ b/src/proto_022_PsRiotum/lib_dal/dal_plugin_registration.ml @@ -68,6 +68,7 @@ module Plugin = struct dynamic_lag_enable = false; number_of_slots; attestation_lag; + attestation_lags = [attestation_lag]; attestation_threshold; traps_fraction; cryptobox_parameters; diff --git a/src/proto_023_PtSeouLo/lib_dal/dal_plugin_registration.ml b/src/proto_023_PtSeouLo/lib_dal/dal_plugin_registration.ml index 48353cc7e1e43a9803676e550257bc57401bceca..cdf0b9e9fd37825a6df188b65db025fb49630cfd 100644 --- a/src/proto_023_PtSeouLo/lib_dal/dal_plugin_registration.ml +++ b/src/proto_023_PtSeouLo/lib_dal/dal_plugin_registration.ml @@ -69,6 +69,7 @@ module Plugin = struct dynamic_lag_enable = false; number_of_slots; attestation_lag; + attestation_lags = [attestation_lag]; attestation_threshold; traps_fraction; cryptobox_parameters; diff --git a/src/proto_024_PtTALLiN/lib_dal/dal_plugin_registration.ml b/src/proto_024_PtTALLiN/lib_dal/dal_plugin_registration.ml index c4f17a9503742dc5437220c207799e557b87ede3..1add99f4757c2b56e4995fbca834744edde97347 100644 --- a/src/proto_024_PtTALLiN/lib_dal/dal_plugin_registration.ml +++ b/src/proto_024_PtTALLiN/lib_dal/dal_plugin_registration.ml @@ -86,6 +86,7 @@ module Plugin = struct dynamic_lag_enable = false; number_of_slots; attestation_lag; + attestation_lags = [attestation_lag]; attestation_threshold; traps_fraction; cryptobox_parameters; diff --git a/src/proto_alpha/lib_dal/dal_plugin_registration.ml b/src/proto_alpha/lib_dal/dal_plugin_registration.ml index e8744f502391d80b9f2c315fc6e62af6dc0f470d..42e0194dbb23729c6cada0bb44f8050433612f74 100644 --- a/src/proto_alpha/lib_dal/dal_plugin_registration.ml +++ b/src/proto_alpha/lib_dal/dal_plugin_registration.ml @@ -108,6 +108,7 @@ module Plugin = struct dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; minimal_participation_ratio = _; rewards_ratio = _; @@ -123,6 +124,7 @@ module Plugin = struct dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; traps_fraction; cryptobox_parameters; diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 8b96483ff79ed8b8cbf5d0be78f3eae3482aa29a..042c0b44438776abf8841081c847b77909fb5403 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -160,6 +160,7 @@ let default_dal = dynamic_lag_enable = false; number_of_slots = 32; attestation_lag = 5; + attestation_lags = [5]; attestation_threshold = 66; cryptobox_parameters = default_cryptobox_parameters; minimal_participation_ratio = Q.(64 // 100); diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 4d3a8bc2213ab916b786867f4345714226e59b56..dfe19e682630b932c267213a711287d190634ee4 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -863,6 +863,7 @@ module Constants : sig dynamic_lag_enable : bool; number_of_slots : int; attestation_lag : int; + attestation_lags : int list; attestation_threshold : int; cryptobox_parameters : Dal.parameters; minimal_participation_ratio : Q.t; @@ -1096,6 +1097,10 @@ module Constants : sig val dal_attestation_lag : context -> int + val dal_attestation_lags : context -> int list + + val dal_number_of_lags : context -> int + val sc_rollup_arith_pvm_enable : context -> bool val sc_rollup_riscv_pvm_enable : context -> bool diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 20903d1dca222c9961e28e595dc617dea093c93f..73d79d97910b28b1a79e4d597faa56e02be1e3cc 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -51,6 +51,7 @@ type dal = { dynamic_lag_enable : bool; number_of_slots : int; attestation_lag : int; + attestation_lags : int list; attestation_threshold : int; cryptobox_parameters : Dal.parameters; minimal_participation_ratio : Q.t; @@ -86,6 +87,7 @@ let dal_encoding = dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; cryptobox_parameters; minimal_participation_ratio; @@ -98,6 +100,7 @@ let dal_encoding = dynamic_lag_enable, number_of_slots, attestation_lag, + attestation_lags, attestation_threshold, minimal_participation_ratio, rewards_ratio, @@ -108,6 +111,7 @@ let dal_encoding = dynamic_lag_enable, number_of_slots, attestation_lag, + attestation_lags, attestation_threshold, minimal_participation_ratio, rewards_ratio, @@ -120,6 +124,7 @@ let dal_encoding = dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; cryptobox_parameters; minimal_participation_ratio; @@ -127,12 +132,13 @@ let dal_encoding = traps_fraction; }) (merge_objs - (obj9 + (obj10 (req "feature_enable" bool) (req "incentives_enable" bool) (req "dynamic_lag_enable" bool) (req "number_of_slots" uint16) (req "attestation_lag" uint8) + (req "attestation_lags" (list uint8)) (req "attestation_threshold" uint8) (req "minimal_participation_ratio" diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index 3d5fd7b8a132d7727ec8b4f5b23c297f6d06000f..2d44cffef908d2288b4cb3f2a9bdee9cda0202fc 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -76,6 +76,7 @@ type dal = { dynamic_lag_enable : bool; number_of_slots : int; attestation_lag : int; + attestation_lags : int list; attestation_threshold : int; cryptobox_parameters : Dal.parameters; minimal_participation_ratio : Q.t; diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index 4ddfd87d1e5a5f3f7c5f22bf7b19f10f9652cf61..cdddf4f53e39642adf07cdfaa1e38f1692bdf8f0 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -353,6 +353,33 @@ let check_constants constants = "The attestation_lag must be strictly greater than 1, because only \ slot headers in finalized blocks are attested.") in + let* () = + error_unless + Compare.Int.( + List.compare_length_with constants.dal.attestation_lags 1 >= 0) + (Invalid_protocol_constants + "The attestation_lags must contain at least one element.") + in + let* () = + let last_lag = + Option.value ~default:0 @@ List.hd + @@ List.rev constants.dal.attestation_lags + in + error_unless + Compare.Int.(last_lag = constants.dal.attestation_lag) + (Invalid_protocol_constants + "The last element of attestation_lags must equal attestation_lag.") + in + let* () = + let rec is_sorted = function + | [] | [_] -> true + | h1 :: h2 :: tl -> Compare.Int.(h1 < h2) && is_sorted (h2 :: tl) + in + error_unless + (is_sorted constants.dal.attestation_lags) + (Invalid_protocol_constants + "The attestation_lags list must be ordered increasingly.") + in let* () = error_unless Compare.Int.( diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 7ecc17586ab36b4ae3bac1fe8f9a3d5d931ff207..a3fb00818a1da0ecab91f704005357dacf3bf837 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -236,6 +236,14 @@ let dal_number_of_shards c = let constants = Raw_context.constants c in constants.dal.cryptobox_parameters.number_of_shards +let dal_attestation_lags c = + let constants = Raw_context.constants c in + constants.dal.attestation_lags + +let dal_number_of_lags c = + let constants = Raw_context.constants c in + List.length constants.dal.attestation_lags + let dal_enable c = let constants = Raw_context.constants c in constants.dal.feature_enable diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index 35bd388b64064651a5a29d955a17ba3603a427cc..e2474f00d26d74268cc544fe6a60d2fccea3726d 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -132,6 +132,10 @@ val dal_number_of_shards : Raw_context.t -> int val dal_attestation_lag : Raw_context.t -> int +val dal_attestation_lags : Raw_context.t -> int list + +val dal_number_of_lags : Raw_context.t -> int + val dal_enable : Raw_context.t -> bool val zk_rollup_enable : Raw_context.t -> bool diff --git a/src/proto_alpha/lib_protocol/dal_storage.ml b/src/proto_alpha/lib_protocol/dal_storage.ml index 465db955f198b6bcf69cad82ae69d3561e4bab28..e0f60859e2c54f828a2f39251419305a9d418a5e 100644 --- a/src/proto_alpha/lib_protocol/dal_storage.ml +++ b/src/proto_alpha/lib_protocol/dal_storage.ml @@ -38,6 +38,7 @@ let save_parameters ctxt dynamic_lag_enable = false; number_of_slots; attestation_lag; + attestation_lags = [attestation_lag]; attestation_threshold; cryptobox_parameters; minimal_participation_ratio; diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index 0aecf4f5c47d97c53aad316f865a04ff87f827bf..a567971a705941a7486995ec72a0ca643c579443 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1055,6 +1055,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; cryptobox_parameters; minimal_participation_ratio; @@ -1070,6 +1071,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = dynamic_lag_enable; number_of_slots; attestation_lag; + attestation_lags; attestation_threshold; cryptobox_parameters; minimal_participation_ratio; @@ -1370,6 +1372,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = dynamic_lag_enable = false; number_of_slots; attestation_lag = 5; + attestation_lags = [5]; attestation_threshold; cryptobox_parameters; minimal_participation_ratio; diff --git a/src/proto_alpha/lib_protocol/test/unit/test_dal_past_parameters_storage.ml b/src/proto_alpha/lib_protocol/test/unit/test_dal_past_parameters_storage.ml index 7604f068dfd7e2d3b331d327fea50932cd295752..4ae5b7cb0c78b5332e45e6c377f2af790fc1046e 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_dal_past_parameters_storage.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_dal_past_parameters_storage.ml @@ -72,6 +72,7 @@ let parameters_for_a_level () = dynamic_lag_enable = false; number_of_slots; attestation_lag; + attestation_lags = [attestation_lag]; attestation_threshold; cryptobox_parameters; minimal_participation_ratio; diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 3a8f1b58bac953f9b34a070e9fddbdd00f3d95cc..465cbcb82338798dd82bcb1076c20f8ed6ae7805 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -511,6 +511,15 @@ let with_layer1 ?custom_constants ?additional_bootstrap_accounts ?all_bakers_attest_activation_threshold f ~protocol = let parameter_overrides = make_int_parameter ["dal_parametric"; "attestation_lag"] attestation_lag + @ (match attestation_lag with + | None -> [] + | Some lag -> + if Protocol.number protocol < 025 then [] + else + [ + ( ["dal_parametric"; "attestation_lags"], + `A [`Float (float_of_int lag)] ); + ]) @ make_int_parameter ["dal_parametric"; "number_of_shards"] number_of_shards @ make_int_parameter ["dal_parametric"; "redundancy_factor"] 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 2420a7c6ba94b3a3177e9873ea8f5d481d06115c..af9ce682b130264d6f83932eaf35d6c5d7c32a95 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 @@ -41,7 +41,8 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": true, "dynamic_lag_enable": false, "number_of_slots": 16, - "attestation_lag": 5, "attestation_threshold": 66, + "attestation_lag": 5, "attestation_lags": [ 5 ], + "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16", "denominator": "25" }, "rewards_ratio": { "numerator": "1", "denominator": "10" }, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol_abaab.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol_abaab.out index 787beb645e2fe003df593b4d67afd5d24642a21c..b776c8532d5b50779db428b7f7b63a91b6eca3bd 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol_abaab.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol_abaab.out @@ -41,7 +41,8 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": true, "dynamic_lag_enable": false, "number_of_slots": 16, - "attestation_lag": 5, "attestation_threshold": 66, + "attestation_lag": 5, "attestation_lags": [ 5 ], + "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16", "denominator": "25" }, "rewards_ratio": { "numerator": "1", "denominator": "10" }, 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 0b503d16958be9e81b0d68b4026cf7fb54d9ee08..1ab11e9c5ffdd72b01295f06a87c1af9f61ba11d 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 @@ -41,7 +41,8 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": true, "dynamic_lag_enable": false, "number_of_slots": 16, - "attestation_lag": 5, "attestation_threshold": 66, + "attestation_lag": 5, "attestation_lags": [ 5 ], + "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16", "denominator": "25" }, "rewards_ratio": { "numerator": "1", "denominator": "10" }, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol_abaab.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol_abaab.out index 1af73250ae9dcf1428a290e9dc809263bacf2f6d..1d495efa209f28ee87a6d3a1930b811117c600e6 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol_abaab.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol_abaab.out @@ -41,7 +41,8 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": true, "dynamic_lag_enable": false, "number_of_slots": 16, - "attestation_lag": 5, "attestation_threshold": 66, + "attestation_lag": 5, "attestation_lags": [ 5 ], + "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16", "denominator": "25" }, "rewards_ratio": { "numerator": "1", "denominator": "10" }, 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 81775501881d9ee5e05cdf442980ef724d686d76..bea2f960d4dd7ffbe1689b3f43309a02dfc72154 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 @@ -41,7 +41,8 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": true, "dynamic_lag_enable": false, "number_of_slots": 16, - "attestation_lag": 5, "attestation_threshold": 66, + "attestation_lag": 5, "attestation_lags": [ 5 ], + "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16", "denominator": "25" }, "rewards_ratio": { "numerator": "1", "denominator": "10" }, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol_abaab.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol_abaab.out index 0d06f14ca1bccd78c3d0ebe96c93062bd1c201ea..024cde2ab0da96bd1572e00a137e8a28d14fa69c 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol_abaab.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol_abaab.out @@ -41,7 +41,8 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": true, "dynamic_lag_enable": false, "number_of_slots": 16, - "attestation_lag": 5, "attestation_threshold": 66, + "attestation_lag": 5, "attestation_lags": [ 5 ], + "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16", "denominator": "25" }, "rewards_ratio": { "numerator": "1", "denominator": "10" }, diff --git a/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out b/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out index c1046c07bbbe8d183a1b676925c2262c18b68d1b..d649e3ab710fa32bd78a7e0c22a51e5135feac4e 100644 --- a/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out +++ b/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out @@ -31,7 +31,8 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": false, "dynamic_lag_enable": false, "number_of_slots": 32, - "attestation_lag": 5, "attestation_threshold": 66, + "attestation_lag": 5, "attestation_lags": [ 5 ], + "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16", "denominator": "25" }, "rewards_ratio": { "numerator": "0", "denominator": "1" }, diff --git a/tezt/tests/mockup.ml b/tezt/tests/mockup.ml index 8d6d3bf9affe560bda750a97307be24bd8ffb917..6bb92e081104dc34a984bb3bdcd09a1e8f66ed36 100644 --- a/tezt/tests/mockup.ml +++ b/tezt/tests/mockup.ml @@ -1154,6 +1154,18 @@ let test_create_mockup_config_show_init_roundtrip protocols = JSON.(value |> as_string_opt) in `String value' + | "array" -> ( + let array_items = JSON.(value |> as_list) in + match array_items with + | [] -> + Test.fail + "[distinct_sample] is not implemented for empty arrays (value: \ + %s)" + (JSON.encode value) + | first :: rest -> + let items_schema = JSON.(schema |-> "items") in + let modified_first = distinct_sample first items_schema in + `A (modified_first :: List.map JSON.unannotate rest)) | typ -> Test.fail "[distinct_sample] is not implemented for types [%s] (value: %s)" diff --git a/tezt/tests/weeklynet_configs/alpha.json b/tezt/tests/weeklynet_configs/alpha.json index 53e0668e760a0530cb5f9f6832d8229acea19be6..09db3a505db42f85965bfb6f5d281031a9f09bcc 100644 --- a/tezt/tests/weeklynet_configs/alpha.json +++ b/tezt/tests/weeklynet_configs/alpha.json @@ -77,6 +77,7 @@ "dynamic_lag_enable": false, "number_of_slots": 32, "attestation_lag": 8, + "attestation_lags": [ 8 ], "attestation_threshold": 66, "minimal_participation_ratio": { "numerator": "16",