From f6effba092b0d4a790c71687ee1bc6e0bf8300a5 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Mon, 29 Jan 2024 09:28:54 +0100 Subject: [PATCH 1/2] Proto/Dal: use internal helper --- src/proto_alpha/lib_protocol/dal_slot_storage.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/dal_slot_storage.ml b/src/proto_alpha/lib_protocol/dal_slot_storage.ml index f04bc3bf354b..e127a074d553 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_storage.ml +++ b/src/proto_alpha/lib_protocol/dal_slot_storage.ml @@ -73,7 +73,7 @@ let finalize_pending_slot_headers ctxt ~number_of_slots = match Raw_level_repr.(sub raw_level dal.attestation_lag) with | None -> return (ctxt, Dal_attestation_repr.empty) | Some level_attested -> - let* seen_slots = Storage.Dal.Slot.Headers.find ctxt level_attested in + let* seen_slots = find_slot_headers ctxt level_attested in let* ctxt, attestation, confirmed_slot_headers = match seen_slots with | None -> return (ctxt, Dal_attestation_repr.empty, []) -- GitLab From 2c3a3215a7c1a8b58664216e8640079e31bfe1e8 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Mon, 29 Jan 2024 09:29:45 +0100 Subject: [PATCH 2/2] Proto/Dal: Bug fix. Remove published headers even if none is attested --- src/proto_alpha/lib_protocol/dal_slot_storage.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/dal_slot_storage.ml b/src/proto_alpha/lib_protocol/dal_slot_storage.ml index e127a074d553..699577121df3 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_storage.ml +++ b/src/proto_alpha/lib_protocol/dal_slot_storage.ml @@ -74,6 +74,7 @@ let finalize_pending_slot_headers ctxt ~number_of_slots = | None -> return (ctxt, Dal_attestation_repr.empty) | Some level_attested -> let* seen_slots = find_slot_headers ctxt level_attested in + let*! ctxt = Storage.Dal.Slot.Headers.remove ctxt level_attested in let* ctxt, attestation, confirmed_slot_headers = match seen_slots with | None -> return (ctxt, Dal_attestation_repr.empty, []) @@ -82,7 +83,6 @@ let finalize_pending_slot_headers ctxt ~number_of_slots = compute_attested_slot_headers ctxt seen_slots in let attested_slot_headers = List.rev rev_attested_slot_headers in - let*! ctxt = Storage.Dal.Slot.Headers.remove ctxt level_attested in return (ctxt, attestation, attested_slot_headers) in let* ctxt = -- GitLab