From c145c6d343943247e7768c7f925cdeb735b45ed8 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Fri, 10 Oct 2025 19:43:51 +0200 Subject: [PATCH 1/8] DAL/Node: `get_slot_commitment` RPC fetches the commitment from the skip-list db --- src/lib_dal_node/RPC_server.ml | 30 +++++++++++++++++--------- src/lib_dal_node/slot_manager.mli | 18 ++++++++++++++++ src/lib_dal_node_services/services.ml | 7 ++++-- src/lib_dal_node_services/services.mli | 7 ++++-- 4 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/lib_dal_node/RPC_server.ml b/src/lib_dal_node/RPC_server.ml index 62db830e3559..a864d5349dfc 100644 --- a/src/lib_dal_node/RPC_server.ml +++ b/src/lib_dal_node/RPC_server.ml @@ -236,20 +236,30 @@ module Slots_handlers = struct let get_slot_commitment ctxt slot_level slot_index () () = call_handler1 (fun () -> - let open Lwt_result_syntax in let slot_id : Types.slot_id = {slot_level; slot_index} in - let* content = - Slot_manager.get_slot_content - ~reconstruct_if_missing:true + let open Lwt_result_syntax in + let published_level = slot_id.Types.Slot_id.slot_level in + let*? proto_parameters = + Node_context.get_proto_parameters ctxt ~level:(`Level published_level) + |> Errors.other_result + in + let attested_level = + Int32.(add published_level (of_int proto_parameters.attestation_lag)) + in + let*? plugin = + Node_context.get_plugin_for_level ctxt ~level:attested_level + |> Errors.other_result + in + let* slot_header_opt = + Slot_manager.try_get_slot_header_from_indexed_skip_list + plugin ctxt slot_id + |> Errors.other_lwt_result in - let cryptobox = Node_context.get_cryptobox ctxt in - let*? polynomial = - Slot_manager.polynomial_from_slot cryptobox content - in - let*? commitment = Slot_manager.commit cryptobox polynomial in - return commitment) + match slot_header_opt with + | None -> fail `Not_found + | Some slot_header -> return slot_header.Dal_plugin.commitment) let get_slot_status ctxt slot_level slot_index () () = call_handler1 (fun () -> diff --git a/src/lib_dal_node/slot_manager.mli b/src/lib_dal_node/slot_manager.mli index 1ae5cfb180cc..ae8ee97c8651 100644 --- a/src/lib_dal_node/slot_manager.mli +++ b/src/lib_dal_node/slot_manager.mli @@ -102,6 +102,24 @@ val get_slot_content : Types.slot_id -> (slot, [> Errors.other | Errors.not_found]) result Lwt.t +(** [try_get_slot_header_from_indexed_skip_list plugin node_ctxt ~attested_level + slot_id] retrieves the slot header associated with [slot_id], based on the + local skip list cell stored in the SQLite store. + + Steps: + - Fetch the skip list cell for the given [attested_level] and slot index from + the SQLite store. + - Decode the cell using the DAL [plugin]. + - Return the extracted slot header. + + Returns [None] if the cell is not found in the store. +*) +val try_get_slot_header_from_indexed_skip_list : + (module Dal_plugin.T) -> + Node_context.t -> + Types.slot_id -> + Dal_plugin.slot_header option tzresult Lwt.t + (** [add_commitment_shards ~shards_proofs_precomputation node_store cryptobox commitment slot polynomial] registers the shards of the slot whose commitment is given. diff --git a/src/lib_dal_node_services/services.ml b/src/lib_dal_node_services/services.ml index 05ade1d81993..5d4628a13510 100644 --- a/src/lib_dal_node_services/services.ml +++ b/src/lib_dal_node_services/services.ml @@ -272,8 +272,11 @@ let get_slot_commitment : service = Tezos_rpc.Service.get_service ~description: - "Return the accepted commitment associated to the given slot index and \ - published at the given level." + "Return the commitment associated to the given slot index and published \ + at the given level, if any. The commitment is fetched from the \ + skip-list storage. Note that the commitment is not present in the \ + storage immediately after publication, but only when its attestation \ + status is known and final." ~query:Tezos_rpc.Query.empty ~output:Cryptobox.Commitment.encoding Tezos_rpc.Path.( diff --git a/src/lib_dal_node_services/services.mli b/src/lib_dal_node_services/services.mli index 96e4edb99342..ce960fc2437a 100644 --- a/src/lib_dal_node_services/services.mli +++ b/src/lib_dal_node_services/services.mli @@ -126,8 +126,11 @@ val get_slot_page_proof : ; query : unit > service -(** Return the accepted commitment associated to the given slot index and - published at the given level, if any. *) +(** Return the commitment associated to the given slot index and published at + the given level, if any. The commitment is fetched from the skip-list + storage. Note that the commitment is not present in the storage immediately + after publication, but only when its attestation status is known and + final. *) val get_slot_commitment : < meth : [`GET] ; input : unit -- GitLab From ed656082f1942f88356b757d135c626f5ebd11f7 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Fri, 10 Oct 2025 20:24:30 +0200 Subject: [PATCH 2/8] Tezt/DAL: rename RPC to `get_level_slot_commitment` for consistency --- tezt/lib_tezos/dal_common.ml | 2 +- tezt/lib_tezos/dal_common.mli | 2 +- tezt/tests/dal.ml | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tezt/lib_tezos/dal_common.ml b/tezt/lib_tezos/dal_common.ml index 49c88f906596..69c7f0ff9847 100644 --- a/tezt/lib_tezos/dal_common.ml +++ b/tezt/lib_tezos/dal_common.ml @@ -279,7 +279,7 @@ module Dal_RPC = struct type commitment_proof = string - let get_level_index_commitment ~slot_level ~slot_index = + let get_level_slot_commitment ~slot_level ~slot_index = make GET [ diff --git a/tezt/lib_tezos/dal_common.mli b/tezt/lib_tezos/dal_common.mli index ee0105fb5eb3..a03dfdc2e1e3 100644 --- a/tezt/lib_tezos/dal_common.mli +++ b/tezt/lib_tezos/dal_common.mli @@ -236,7 +236,7 @@ module RPC : sig (** Call RPC "GET /levels//slot_indices//commitment" to get the commitment associated to the given level and index. *) - val get_level_index_commitment : + val get_level_slot_commitment : slot_level:int -> slot_index:int -> commitment RPC_core.t (** Call RPC "PATCH /profiles" to update the list of profiles tracked by diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 3942d158519e..d0fba6dcea85 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -1892,8 +1892,7 @@ let check_get_commitment dal_node ~slot_level check_result slots_info = (fun (slot_index, commitment') -> let* response = Dal_RPC.( - call_raw dal_node - @@ get_level_index_commitment ~slot_index ~slot_level) + call_raw dal_node @@ get_level_slot_commitment ~slot_index ~slot_level) in return @@ check_result commitment' response) slots_info @@ -1919,7 +1918,7 @@ let check_stored_level_headers ~__LOC__ dal_node ~pub_level ~number_of_slots let* response = Dal_RPC.( call_raw dal_node - @@ get_level_index_commitment ~slot_level:pub_level ~slot_index) + @@ get_level_slot_commitment ~slot_level:pub_level ~slot_index) in match response.code with | 200 -> return (accu + 1) @@ -1938,7 +1937,7 @@ let check_slot_status ~__LOC__ ?expected_status dal_node ~slot_level slots_info = let test (slot_index, commitment) = let* commitment_is_stored = - let rpc = Dal_RPC.get_level_index_commitment ~slot_level ~slot_index in + let rpc = Dal_RPC.get_level_slot_commitment ~slot_level ~slot_index in let* response = Dal_RPC.call_raw dal_node rpc in match response.code with | 200 -> @@ -2058,7 +2057,7 @@ let test_dal_node_slots_headers_tracking protocol parameters _cryptobox node Lwt_list.filter_map_s (fun slot_index -> let commitment_rpc = - Dal_RPC.get_level_index_commitment ~slot_level:pub_level ~slot_index + Dal_RPC.get_level_slot_commitment ~slot_level:pub_level ~slot_index in let* response = Dal_RPC.call_raw dal_node commitment_rpc in match response.code with -- GitLab From be98186742111acc009236aaace179a358bc3e9d Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Thu, 9 Oct 2025 06:36:55 +0200 Subject: [PATCH 3/8] Tezt/DAL: add support for cells_of_level RPC --- tezt/lib_tezos/RPC.ml | 15 +++++++++++++++ tezt/lib_tezos/RPC.mli | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/tezt/lib_tezos/RPC.ml b/tezt/lib_tezos/RPC.ml index c4e3feab23dc..56360b9f9c24 100644 --- a/tezt/lib_tezos/RPC.ml +++ b/tezt/lib_tezos/RPC.ml @@ -1912,6 +1912,21 @@ let get_chain_block_context_dal_commitments_history ?(chain = "main") ["chains"; chain; "blocks"; block; "context"; "dal"; "commitments_history"] Fun.id +let get_chain_block_context_dal_cells_of_level ?(chain = "main") + ?(block = "head") () = + make + GET + [ + "chains"; + chain; + "blocks"; + block; + "context"; + "dal"; + "skip_list_cells_of_level"; + ] + Fun.id + let get_chain_block_context_raw_json ?(chain = "main") ?(block = "head") ?(path = []) () = make diff --git a/tezt/lib_tezos/RPC.mli b/tezt/lib_tezos/RPC.mli index af5d340d6c19..0cde8fde5ace 100644 --- a/tezt/lib_tezos/RPC.mli +++ b/tezt/lib_tezos/RPC.mli @@ -1360,6 +1360,12 @@ val get_chain_block_context_issuance_expected_issuance : val get_chain_block_context_dal_commitments_history : ?chain:string -> ?block:string -> unit -> JSON.t t +(** Call RPC + /chains/[chain]/blocks/[block]/context/dal/skip_list_cells_of_level. + [chain] defaults to ["main"]. [block] defaults to ["head"]. *) +val get_chain_block_context_dal_cells_of_level : + ?chain:string -> ?block:string -> unit -> JSON.t t + (** Call RPC /chains/[chain]/blocks/[block]/context/raw/json. [chain] defaults to ["main"]. [block] defaults to ["head"]. *) -- GitLab From 7bbff2fbe571b313a7891e2cd62b0eaf922d1951 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Sat, 11 Oct 2025 13:09:43 +0200 Subject: [PATCH 4/8] DAL/Tests: slightly clarify and improve migration skip-list test Changes: * some cosmetic changes * publish just 3 levels in the new protocol, thus making the test quicker * migrate at level 11, not 10 so that we have a level (ie. 2) fully handled in the old protocol --- tezt/tests/dal.ml | 55 +++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index d0fba6dcea85..770d95bff0ee 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -5574,9 +5574,16 @@ module History_rpcs = struct ~first_dal_level ~last_confirmed_published_level protocol dal_parameters client node dal_node = let module Map_int = Map.Make (Int) in - Log.info "slot_index = %d" slot_index ; + Log.info "slot_index = %d first_dal_level = %d" slot_index first_dal_level ; let client = Client.with_dal_node client ~dal_node in let slot_size = dal_parameters.Dal.Parameters.cryptobox.slot_size in + let lag = dal_parameters.attestation_lag in + let number_of_slots = dal_parameters.number_of_slots in + Log.info + "attestation_lag = %d, number_of_slots = %d, slot_size = %d" + lag + number_of_slots + slot_size ; let* starting_level = Client.level client in let rec publish ~max_level level commitments = @@ -5597,10 +5604,6 @@ module History_rpcs = struct @@ Helpers.make_slot ~slot_size ("slot " ^ string_of_int level) in let* () = wait_mempool_injection in - Log.info - "Publish commitment %s at published_level %d@." - commitment - published_level ; let* () = bake_for client in let* _level = Node.wait_for_level node (level + 1) in publish @@ -5608,29 +5611,43 @@ module History_rpcs = struct (level + 1) (Map_int.add published_level commitment commitments) in - Log.info "Publishing some commitments in the previous protocol@." ; + Log.info + "Publishing commitments in the previous protocol, from published level \ + %d to %d" + (starting_level + 1) + (migration_level + 1) ; let* commitments = publish ~max_level:migration_level starting_level Map_int.empty in - let* dal_parameters = Dal.Parameters.from_client client in - let lag = dal_parameters.attestation_lag in - - let number_of_slots = dal_parameters.number_of_slots in - Log.info "attestation_lag = %d, number_of_slots = %d" lag number_of_slots ; + Log.info "Migrated to the next protocol." ; let last_attested_level = last_confirmed_published_level + lag in - (* The maximum level that needs to be reached (we use +2 to make last - attested level final). *) - let max_level = last_attested_level + 2 in let wait_for_dal_node = wait_for_layer1_final_block dal_node last_attested_level in - let* first_level_new_proto = Client.level client in - Log.info "Publishing some commitments in the new protocol@." ; - let* commitments = publish ~max_level first_level_new_proto commitments in + let* second_level_new_proto = Client.level client in + assert (second_level_new_proto = migration_level + 1) ; + Log.info + "Publish commitments in the new protocol, from published level %d to %d" + (second_level_new_proto + 1) + (last_confirmed_published_level + 1) ; + let* commitments = + publish + ~max_level:last_confirmed_published_level + second_level_new_proto + commitments + in + let* () = + (* The maximum level that needs to be reached (we use +2 to make last + attested level final). *) + let max_level = last_attested_level + 2 in + let* current_level = Node.get_level node in + let count = max_level + 1 - current_level in + bake_for ~count client + in let module SeenIndexes = Set.Make (struct type t = int @@ -5750,7 +5767,9 @@ module History_rpcs = struct check_history (level + 1) in let* () = wait_for_dal_node in + Log.info "Check skip-list using commitments_history RPCs" ; let* () = check_history first_dal_level in + Check.( (!at_least_one_attested_status = true) bool @@ -12102,7 +12121,7 @@ let tests_start_dal_node_around_migration ~migrate_from ~migrate_to = let register_migration ~migrate_from ~migrate_to = test_migration_plugin ~migration_level:4 ~migrate_from ~migrate_to ; History_rpcs.test_commitments_history_rpcs_with_migration - ~migration_level:10 + ~migration_level:11 ~migrate_from ~migrate_to ; tests_start_dal_node_around_migration ~migrate_from ~migrate_to ; -- GitLab From 02f93249e63adcf4e02bc5c967013e2e4be9ec43 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Sat, 11 Oct 2025 13:15:12 +0200 Subject: [PATCH 5/8] DAL/Tests: add calls to cells_of_level RPC in skip-list migration test --- tezt/tests/dal.ml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 770d95bff0ee..38168bf40b5a 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -5774,6 +5774,36 @@ module History_rpcs = struct (!at_least_one_attested_status = true) bool ~error_msg:"No cell with the 'attested' status has been visited") ; + + let rec call_cells_of_level level = + if level > last_confirmed_published_level then unit + else + let* cells = + Node.RPC.call node + @@ RPC.get_chain_block_context_dal_cells_of_level + ~block:(string_of_int level) + () + in + let cells = JSON.as_list cells in + let num_cells = List.length cells in + let expected_num_cells = if level < lag then 0 else 32 in + Check.( + (num_cells = expected_num_cells) + int + ~error_msg:"Unexpected number of cells: got %L, expected %R") ; + let* () = + Lwt_list.iter_s + (fun hash_cell_tuple -> + let cell = JSON.geti 1 hash_cell_tuple in + check_cell cell ~check_level:(Some level)) + cells + in + call_cells_of_level (level + 1) + in + Log.info + "Call cells_of_level on each relevant level, and check the number of \ + cells returned" ; + let* () = call_cells_of_level 1 in unit let test_commitments_history_rpcs protocols = -- GitLab From 78903dcc1bab9136cee4d67f265c3dcce3dc7772 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Sat, 11 Oct 2025 13:16:41 +0200 Subject: [PATCH 6/8] DAL/Tests: add calls to `get_slot_commitment` RPC in skip-list migration test --- tezt/tests/dal.ml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 38168bf40b5a..8874c1a6e16b 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -5804,6 +5804,31 @@ module History_rpcs = struct "Call cells_of_level on each relevant level, and check the number of \ cells returned" ; let* () = call_cells_of_level 1 in + + let rec call_get_commitment level = + if level > last_confirmed_published_level then unit + else + let* commitment = + Dal_RPC.( + call dal_node + @@ get_level_slot_commitment ~slot_level:level ~slot_index) + in + let expected_commitment = + match Map_int.find_opt level commitments with + | Some c -> c + | None -> Test.fail "Commitment not found at level %d" level + in + Check.( + (commitment = expected_commitment) + string + ~error_msg: + (let msg = sf "Unexpected commitment at level %d: " level in + msg ^ ": got %L, expected %R")) ; + call_get_commitment (level + 1) + in + Log.info "Check fetching commitments from the skip-list store" ; + let* () = call_get_commitment 2 in + unit let test_commitments_history_rpcs protocols = -- GitLab From 6ea0a16b88a93b1678c9295843ec49c66efd693b Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Sat, 11 Oct 2025 16:16:49 +0200 Subject: [PATCH 7/8] Tezt/DAL: reset regression outputs for RPC list --- .../Alpha- Testing DAL node (dal node list RPCs).out | 7 +++++-- .../S023-- Testing DAL node (dal node list RPCs).out | 7 +++++-- .../T024-- Testing DAL node (dal node list RPCs).out | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tezt/tests/expected/dal.ml/Alpha- Testing DAL node (dal node list RPCs).out b/tezt/tests/expected/dal.ml/Alpha- Testing DAL node (dal node list RPCs).out index 618dfd3794d4..baa1f744ac08 100644 --- a/tezt/tests/expected/dal.ml/Alpha- Testing DAL node (dal node list RPCs).out +++ b/tezt/tests/expected/dal.ml/Alpha- Testing DAL node (dal node list RPCs).out @@ -12,8 +12,11 @@ Available services: node. + levels//slots// - GET /levels//slots//commitment - Return the accepted commitment associated to the given slot index and - published at the given level. + Return the commitment associated to the given slot index and + published at the given level, if any. The commitment is fetched from + the skip-list storage. Note that the commitment is not present in the + storage immediately after publication, but only when its attestation + status is known and final. - GET /levels//slots//content Retrieve the content of the slot whose id is given. - GET /levels//slots//pages diff --git a/tezt/tests/expected/dal.ml/S023-- Testing DAL node (dal node list RPCs).out b/tezt/tests/expected/dal.ml/S023-- Testing DAL node (dal node list RPCs).out index 618dfd3794d4..baa1f744ac08 100644 --- a/tezt/tests/expected/dal.ml/S023-- Testing DAL node (dal node list RPCs).out +++ b/tezt/tests/expected/dal.ml/S023-- Testing DAL node (dal node list RPCs).out @@ -12,8 +12,11 @@ Available services: node. + levels//slots// - GET /levels//slots//commitment - Return the accepted commitment associated to the given slot index and - published at the given level. + Return the commitment associated to the given slot index and + published at the given level, if any. The commitment is fetched from + the skip-list storage. Note that the commitment is not present in the + storage immediately after publication, but only when its attestation + status is known and final. - GET /levels//slots//content Retrieve the content of the slot whose id is given. - GET /levels//slots//pages diff --git a/tezt/tests/expected/dal.ml/T024-- Testing DAL node (dal node list RPCs).out b/tezt/tests/expected/dal.ml/T024-- Testing DAL node (dal node list RPCs).out index 618dfd3794d4..baa1f744ac08 100644 --- a/tezt/tests/expected/dal.ml/T024-- Testing DAL node (dal node list RPCs).out +++ b/tezt/tests/expected/dal.ml/T024-- Testing DAL node (dal node list RPCs).out @@ -12,8 +12,11 @@ Available services: node. + levels//slots// - GET /levels//slots//commitment - Return the accepted commitment associated to the given slot index and - published at the given level. + Return the commitment associated to the given slot index and + published at the given level, if any. The commitment is fetched from + the skip-list storage. Note that the commitment is not present in the + storage immediately after publication, but only when its attestation + status is known and final. - GET /levels//slots//content Retrieve the content of the slot whose id is given. - GET /levels//slots//pages -- GitLab From 1524e903caa98006a0aaa86e20531d72fd2b1756 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Wed, 15 Oct 2025 14:23:07 +0200 Subject: [PATCH 8/8] DAL/Tests: adapt headers tracking test --- tezt/tests/dal.ml | 87 ++++++++++++----------------------------------- 1 file changed, 21 insertions(+), 66 deletions(-) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index 8874c1a6e16b..4f1ea56e5cf0 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -1898,14 +1898,17 @@ let check_get_commitment dal_node ~slot_level check_result slots_info = slots_info let get_commitment_succeeds expected_commitment response = - let commitment = - JSON.(parse ~origin:__LOC__ response.RPC_core.body |> as_string) - in - Check.(commitment = expected_commitment) - Check.string - ~error_msg: - "The value of a stored commitment should match the one computed locally \ - (current = %L, expected = %R)" + match response.RPC_core.code with + | 200 -> + let commitment = + JSON.(parse ~origin:__LOC__ response.RPC_core.body |> as_string) + in + Check.(commitment = expected_commitment) + Check.string + ~error_msg: + "The value of a stored commitment should match the one computed \ + locally (current = %L, expected = %R)" + | code -> Test.fail ~__LOC__ "Unexpected HTTP response code %d" code let get_commitment_not_found _commit r = RPC_core.check_string_response ~code:404 r @@ -1935,25 +1938,10 @@ let check_stored_level_headers ~__LOC__ dal_node ~pub_level ~number_of_slots let check_slot_status ~__LOC__ ?expected_status dal_node ~slot_level slots_info = - let test (slot_index, commitment) = - let* commitment_is_stored = - let rpc = Dal_RPC.get_level_slot_commitment ~slot_level ~slot_index in - let* response = Dal_RPC.call_raw dal_node rpc in - match response.code with - | 200 -> - let published_commitment = - rpc.decode @@ JSON.parse ~origin:"RPC response" response.body - in - return (commitment = published_commitment) - | _ -> return false - in - match (commitment_is_stored, expected_status) with - | false, None -> unit - | true, None -> - Test.fail - ~__LOC__ - "It was expected that the given commitment is not stored, but it is." - | true, Some expected_status -> + let test (slot_index, _commitment) = + match expected_status with + | None -> unit + | Some expected_status -> let* status = Dal_RPC.( call dal_node @@ get_level_slot_status ~slot_level ~slot_index) @@ -1965,10 +1953,6 @@ let check_slot_status ~__LOC__ ?expected_status dal_node ~slot_level slots_info "The value of the fetched status should match the expected one \ (current = %L, expected = %R)" ; unit - | false, Some _ -> - Test.fail - ~__LOC__ - "It was expected that the given commitment is stored, but it is not." in Lwt_list.iter_s test slots_info @@ -2050,38 +2034,10 @@ let test_dal_node_slots_headers_tracking protocol parameters _cryptobox node let ok = [slot0; slot1; slot2_b] in let ko = slot3 :: slot4 :: List.map (fun (i, c) -> (i + 100, c)) ok in let* () = - (* There are 3 published slots: slot0, slot1, and slot2_b *) - check_stored_level_headers ~__LOC__ ~pub_level ~number_of_headers:3 - in - let* slot_headers = - Lwt_list.filter_map_s - (fun slot_index -> - let commitment_rpc = - Dal_RPC.get_level_slot_commitment ~slot_level:pub_level ~slot_index - in - let* response = Dal_RPC.call_raw dal_node commitment_rpc in - match response.code with - | 200 -> - let commitment = - commitment_rpc.decode - @@ JSON.parse ~origin:"RPC response" response.body - in - let* status = - Dal_RPC.( - call dal_node - @@ get_level_slot_status ~slot_level:pub_level ~slot_index) - in - if status = "waiting_attestation" then some (slot_index, commitment) - else none - | 404 -> none - | code -> Test.fail ~__LOC__ "Unexpected HTTP response code %d" code) - (List.init number_of_slots Fun.id) + (* There are 3 published slots: slot0, slot1, and slot2_b. But the attestation + period is not over, so they are not yet present in the skip-list. *) + check_stored_level_headers ~__LOC__ ~pub_level ~number_of_headers:0 in - Check.(slot_headers = ok) - Check.(list (tuple2 int string)) - ~error_msg: - "Published header is different from stored header (current = %L, \ - expected = %R)" ; let check_slot_status ?expected_status l = check_slot_status ?expected_status dal_node ~slot_level:pub_level l in @@ -2090,7 +2046,7 @@ let test_dal_node_slots_headers_tracking protocol parameters _cryptobox node in (* Slots waiting for attestation. *) - let* () = check_get_commitment get_commitment_succeeds ok in + let* () = check_get_commitment get_commitment_not_found ok in let* () = check_slot_status ~__LOC__ ~expected_status:"waiting_attestation" ok in @@ -2121,8 +2077,7 @@ let test_dal_node_slots_headers_tracking protocol parameters _cryptobox node let* () = bake_for ~count:2 client in let* () = wait_block_processing3 in let* () = - (* The unattested slot has been removed. *) - check_stored_level_headers ~__LOC__ ~pub_level ~number_of_headers:2 + check_stored_level_headers ~__LOC__ ~pub_level ~number_of_headers:3 in Log.info "Check that the store is as expected" ; @@ -2149,7 +2104,7 @@ let test_dal_node_slots_headers_tracking protocol parameters _cryptobox node ~number_of_headers:0 in let* () = - check_stored_level_headers ~__LOC__ ~pub_level ~number_of_headers:2 + check_stored_level_headers ~__LOC__ ~pub_level ~number_of_headers:3 in check_stored_level_headers ~__LOC__ -- GitLab