From 5de1572c76d4beb09721e94acac50be32ac05dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:27:58 +0100 Subject: [PATCH 1/8] DAL: Activation level seems is one and not zero --- src/proto_alpha/lib_parameters/default_parameters.ml | 2 +- src/proto_alpha/lib_protocol/raw_context.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index d0f1738d0520..014bfb59d9c8 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -170,7 +170,7 @@ let constants_mainnet : Constants.Parametric.t = Constants.Generated.generate ~consensus_committee_size in let dal_activation_level = - if default_dal.feature_enable then Raw_level.root + if default_dal.feature_enable then Raw_level.succ Raw_level.root else (* Deactivate the reveal if the dal is not enabled. *) (* https://gitlab.com/tezos/tezos/-/issues/5968 diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index 5665e00896b3..7384edbc1f12 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1059,7 +1059,7 @@ let prepare_first_block ~level ~timestamp _chain_id ctxt = if c.dal.feature_enable then (* if dal was enable in previous protocol, do as if it were always activated *) - Raw_level_repr.root + Raw_level_repr.succ Raw_level_repr.root else if dal.feature_enable then (* dal activates at first level of the new protocol. *) Raw_level_repr.of_int32_exn (Int32.succ level) -- GitLab From 8921d9e037735555d56483484ca4d749767f07f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:29:35 +0100 Subject: [PATCH 2/8] Tezt/Tests: Enable to modify the redundancy factor --- tezt/tests/dal.ml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index e9d8642f4c9b..6ebe162e9495 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -189,14 +189,17 @@ let setup_node ?(custom_constants = None) ?(additional_bootstrap_accounts = 0) let with_layer1 ?custom_constants ?additional_bootstrap_accounts ?consensus_committee_size ?minimal_block_delay ?delay_increment_per_round ?attestation_lag ?slot_size ?page_size ?attestation_threshold - ?number_of_shards ?commitment_period ?challenge_window ?dal_enable - ?event_sections_levels ?node_arguments ?activation_timestamp + ?number_of_shards ?redundancy_factor ?commitment_period ?challenge_window + ?dal_enable ?event_sections_levels ?node_arguments ?activation_timestamp ?dal_bootstrap_peers f ~protocol = let parameters = make_int_parameter ["dal_parametric"; "attestation_lag"] attestation_lag @ make_int_parameter ["dal_parametric"; "number_of_shards"] number_of_shards @ make_int_parameter ["dal_parametric"; "slot_size"] slot_size @ make_int_parameter ["dal_parametric"; "page_size"] page_size + @ make_int_parameter + ["dal_parametric"; "redundancy_factor"] + redundancy_factor @ make_int_parameter ["dal_parametric"; "attestation_threshold"] attestation_threshold @@ -342,10 +345,11 @@ let scenario_with_layer1_and_dal_nodes ?(tags = [team]) ?(uses = fun _ -> []) scenario protocol parameters cryptobox node client dal_node) let scenario_with_all_nodes ?custom_constants ?node_arguments ?slot_size - ?page_size ?number_of_shards ?attestation_lag ?(tags = []) - ?(uses = fun _ -> []) ?(pvm_name = "arith") ?(dal_enable = true) - ?commitment_period ?challenge_window ?minimal_block_delay - ?delay_increment_per_round ?activation_timestamp variant scenario = + ?page_size ?number_of_shards ?redundancy_factor ?attestation_lag + ?(tags = []) ?(uses = fun _ -> []) ?(pvm_name = "arith") + ?(dal_enable = true) ?commitment_period ?challenge_window + ?minimal_block_delay ?delay_increment_per_round ?activation_timestamp + variant scenario = let description = "Testing DAL rollup and node with L1" in regression_test ~__FILE__ @@ -361,6 +365,7 @@ let scenario_with_all_nodes ?custom_constants ?node_arguments ?slot_size ?slot_size ?page_size ?number_of_shards + ?redundancy_factor ?attestation_lag ?commitment_period ?challenge_window -- GitLab From 6de4d0ae251d4d45e98d72ac6abdbe04158b1910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:30:20 +0100 Subject: [PATCH 3/8] Tezt/Tests: Fix a hard-coded number --- tezt/tests/dal.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 6ebe162e9495..62e55d3d6fe1 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -1894,10 +1894,10 @@ let rollup_node_stores_dal_slots ?expand_test protocol parameters dal_node and slot 1 has not been downloaded. *) let slot_size = parameters.Dal.Parameters.cryptobox.slot_size in + let page_size = parameters.Dal.Parameters.cryptobox.page_size in let store_slot content = Helpers.(store_slot dal_node @@ make_slot ~slot_size content) in - Log.info "Step 1: send three slots to DAL node and obtain corresponding headers" ; let slot_contents_0 = " 10 " in @@ -1929,7 +1929,7 @@ let rollup_node_stores_dal_slots ?expand_test protocol parameters dal_node and 6" ; let number_of_slots = parameters.number_of_slots in let attestation_lag = parameters.attestation_lag in - let number_of_pages = 256 in + let number_of_pages = slot_size / page_size in let subscribed_slots = "0:2:4:6" in let messages = [ -- GitLab From 8006c12d77de97c55778745f99b45def29ee80f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:30:53 +0100 Subject: [PATCH 4/8] Tezt/Test: Make a test less flaky --- tezt/tests/dal.ml | 8 ++++---- ...ode with L1 (test_lag-3_time-12_preinject-1_slots.out} | 0 ...ode with L1 (test_lag-3_time-4_preinject-5_slots-.out} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename tezt/tests/expected/dal.ml/{Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-6_preinject-1_slots-.out => Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-12_preinject-1_slots.out} (100%) rename tezt/tests/expected/dal.ml/{Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-2_preinject-5_slots-.out => Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-4_preinject-5_slots-.out} (100%) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 62e55d3d6fe1..187ce4c23f82 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -2934,7 +2934,7 @@ let e2e_test_script ?expand_test:_ ?(beforehand_slot_injection = 1) let do_sum = String.make (number_of_dal_slots - 1) '+' in let* () = send_messages ~bake:false l1_client [do_sum ^ " value"] in (* Wait sufficiently many levels so that the PVM interprets the message. *) - let* _lvl = Node.wait_for_level l1_node (level + 2) in + let* _lvl = Node.wait_for_level l1_node (level + 5) in unit in Log.info @@ -2982,7 +2982,7 @@ let e2e_tests = { constants = Protocol.Constants_test; attestation_lag = 3; - block_delay = 6; + block_delay = 12; number_of_dal_slots = 2; beforehand_slot_injection = 1; num_extra_nodes = 2; @@ -2992,7 +2992,7 @@ let e2e_tests = { constants = Protocol.Constants_test; attestation_lag = 3; - block_delay = 2; + block_delay = 4; number_of_dal_slots = 5; beforehand_slot_injection = 5; num_extra_nodes = 2; @@ -3060,7 +3060,7 @@ let register_end_to_end_tests ~protocols = origination and another to configure the PVM. Baker daemon is then started. *) let expected_bake_for_occurrences = 2 in - Ptime.Span.of_int_s (expected_bake_for_occurrences * block_delay) + Ptime.Span.of_int_s expected_bake_for_occurrences in (* Preparing the list of node operators for extra nodes. *) let extra_node_operators = diff --git a/tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-6_preinject-1_slots-.out b/tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-12_preinject-1_slots.out similarity index 100% rename from tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-6_preinject-1_slots-.out rename to tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-12_preinject-1_slots.out diff --git a/tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-2_preinject-5_slots-.out b/tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-4_preinject-5_slots-.out similarity index 100% rename from tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-2_preinject-5_slots-.out rename to tezt/tests/expected/dal.ml/Alpha- Testing DAL rollup and node with L1 (test_lag-3_time-4_preinject-5_slots-.out -- GitLab From 77b369a80cebd6e9f0c36b5da7e47dc688c07fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:31:18 +0100 Subject: [PATCH 5/8] Tezt/Test: Specify hard-coded constants --- tezt/tests/dal.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 187ce4c23f82..bbd1f2e0557a 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -4935,6 +4935,10 @@ let register ~protocols = ~uses:(fun _protocol -> [Constant.smart_rollup_installer; Constant.WASM.dal_echo_kernel]) ~pvm_name:"wasm_2_0_0" + ~number_of_shards:2048 + ~slot_size:(1 lsl 15) + ~redundancy_factor:32 + ~page_size:128 test_reveal_dal_page_in_fast_exec_wasm_pvm protocols ; scenario_with_all_nodes -- GitLab From 47aacfd9eb7707e1167e044c9c9f6b0f34bcf3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:31:31 +0100 Subject: [PATCH 6/8] Tezt/Test: Specify more hard-coded constants --- tezt/tests/dal.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index bbd1f2e0557a..95d8597780c1 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -4946,6 +4946,10 @@ let register ~protocols = ~uses:(fun _protocol -> [Constant.smart_rollup_installer; Constant.WASM.tx_kernel_dal]) ~pvm_name:"wasm_2_0_0" + ~number_of_shards:2048 + ~slot_size:(1 lsl 15) + ~redundancy_factor:32 + ~page_size:128 Tx_kernel_e2e.test_tx_kernel_e2e protocols ; scenario_with_all_nodes -- GitLab From 4f23bc6e83bc26948dcf03f72df8b0dd776cb01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:31:48 +0100 Subject: [PATCH 7/8] Tezt/Test: Generalize constant anticipating future DAL changes --- tezt/tests/dal.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 95d8597780c1..fdd5a5ddfd45 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -1020,9 +1020,9 @@ let test_slots_attestation_operation_dal_committee_membership_check protocol let blocks_per_cycle = JSON.(proto_params |-> "blocks_per_cycle" |> as_int) in (* With [consensus_committee_size = 1024] slots in total, the new baker should get roughly n / 64 = 16 TB slots on average. So the probability that it is - on TB committee is high. With [number_of_shards = 16] (which is the minimum + on TB committee is high. With [number_of_shards = 32] (which is the minimum possible without changing other parameters), the new baker should be - assigned roughly 16/64 = 1/4 shards on average. *) + assigned roughly 32/64 = 1/2 shards on average. *) let stake = Tez.of_mutez_int (Protocol.default_bootstrap_balance / 64) in let* new_account = Client.gen_and_show_keys client in let* () = @@ -4779,7 +4779,7 @@ let register ~protocols = (* We need to set the prevalidator's event level to [`Debug] in order to capture the errors thrown in the validation phase. *) ~event_sections_levels:[("prevalidator", `Debug)] - ~number_of_shards:16 + ~number_of_shards:32 ~consensus_committee_size:1024 protocols ; scenario_with_layer1_node -- GitLab From eb34e334fc6c0a9c41f459328124a3d217c91c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 16 Feb 2024 11:32:09 +0100 Subject: [PATCH 8/8] Tezt/DAL: Making a test less flaky anticpating future DAL changes --- tezt/tests/dal.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index fdd5a5ddfd45..f0583a15e46c 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -4848,7 +4848,7 @@ let register ~protocols = scenario_with_layer1_and_dal_nodes ~uses:(fun protocol -> [Protocol.baker protocol]) ~attestation_threshold:100 - ~attestation_lag:8 + ~attestation_lag:16 ~activation_timestamp:Now "dal attester with baker daemon" test_attester_with_daemon -- GitLab