From 2e6dba6c0c890f76d22d41f0a3d9377f61db85ba Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Thu, 22 May 2025 12:37:08 +0200 Subject: [PATCH 1/2] [DAL/Node] Fetch reused data outside iter_es --- src/lib_dal_node/block_handler.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib_dal_node/block_handler.ml b/src/lib_dal_node/block_handler.ml index c82db241c6e0..e935a5a24666 100644 --- a/src/lib_dal_node/block_handler.ml +++ b/src/lib_dal_node/block_handler.ml @@ -389,6 +389,9 @@ let process_block_data ctxt cctxt store proto_parameters block_level (* If a slot header was posted to the L1 and we have the corresponding data, post it to gossipsub. Note that this is done independently of the profile. *) + let level_committee = Node_context.fetch_committee ctxt in + let slot_size = proto_parameters.cryptobox_parameters.slot_size in + let gs_worker = Node_context.get_gs_worker ctxt in List.iter_es (fun Dal_plugin.{slot_index; commitment; published_level} -> let slot_id : Types.slot_id = @@ -396,9 +399,9 @@ let process_block_data ctxt cctxt store proto_parameters block_level in Slot_manager.publish_slot_data ctxt - ~level_committee:(Node_context.fetch_committee ctxt) - ~slot_size:proto_parameters.cryptobox_parameters.slot_size - (Node_context.get_gs_worker ctxt) + ~level_committee + ~slot_size + gs_worker proto_parameters commitment slot_id) -- GitLab From aea58b2a0bdcb3219a76154dc92d10913b674063 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Thu, 22 May 2025 15:59:38 +0200 Subject: [PATCH 2/2] DAL/Node: only emit the commitment_not_found_in_cache event for our slots indices --- src/lib_dal_node/slot_manager.ml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/lib_dal_node/slot_manager.ml b/src/lib_dal_node/slot_manager.ml index 25a2f075388a..68e5dc974f75 100644 --- a/src/lib_dal_node/slot_manager.ml +++ b/src/lib_dal_node/slot_manager.ml @@ -347,12 +347,23 @@ let publish_slot_data ctxt ~level_committee ~slot_size gs_worker let cache = Store.cache node_store in match Store.Commitment_indexed_cache.find_opt cache commitment with | None -> - (* This is unexpected. Either: - 1. The proofs where not stored properly (an invariant is broken) - 2. The node was restarted (unlikely to happen given the time frame) - 3. The cache was full (unlikely to happen if - [shards_proofs_cache_size] is set properly. *) - let*! () = Event.emit_commitment_not_found_in_cache ~commitment in + let*! () = + if + Profile_manager.can_publish_on_slot_index + slot_id.Types.Slot_id.slot_index + (Node_context.get_profile_ctxt ctxt) + then + (* This is unexpected. Either: + 1. The proofs where not stored properly (an invariant is broken) + 2. The node was restarted (unlikely to happen given the time frame) + 3. The cache was full (unlikely to happen if + [shards_proofs_cache_size] is set properly. *) + Event.emit_commitment_not_found_in_cache ~commitment + else + (* The node is likely not concerned with the publication of the shards + of this commit. *) + Lwt.return_unit + in return_unit | Some (slot, shares, shard_proofs) -> let shards = -- GitLab