From 03fe86951726f5e7bd2c612e84b4e0cfc6b399cd Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Tue, 11 Jun 2024 21:20:26 +0200 Subject: [PATCH 1/2] Rollup node: include commitment publication info in snapshot This information is important for cementation. --- src/lib_smart_rollup_node/snapshots.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib_smart_rollup_node/snapshots.ml b/src/lib_smart_rollup_node/snapshots.ml index 79bc66c1268a..1f556fdc416a 100644 --- a/src/lib_smart_rollup_node/snapshots.ml +++ b/src/lib_smart_rollup_node/snapshots.ml @@ -638,8 +638,7 @@ let post_export_checks ~snapshot_file = snapshot_metadata ~dest -let operator_local_file_regexp = - Re.Str.regexp "^storage/\\(commitments_published_at_level.*\\|lpc$\\)" +let operator_local_file_regexp = Re.Str.regexp "^storage/lpc$" let snapshotable_files_regexp = Re.Str.regexp -- GitLab From 812a34e85cb12dc9e3ebf3ae326df7e1a87fdfee Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Tue, 11 Jun 2024 21:22:20 +0200 Subject: [PATCH 2/2] Rollup node: register publication information all the time --- .../lib_sc_rollup_node/daemon_helpers.ml | 17 ++++++----------- .../lib_sc_rollup_node/daemon_helpers.ml | 17 ++++++----------- .../lib_sc_rollup_node/daemon_helpers.ml | 17 ++++++----------- .../lib_sc_rollup_node/daemon_helpers.ml | 17 ++++++----------- 4 files changed, 24 insertions(+), 44 deletions(-) diff --git a/src/proto_017_PtNairob/lib_sc_rollup_node/daemon_helpers.ml b/src/proto_017_PtNairob/lib_sc_rollup_node/daemon_helpers.ml index c974a66a962d..ae7c7a096d7d 100644 --- a/src/proto_017_PtNairob/lib_sc_rollup_node/daemon_helpers.ml +++ b/src/proto_017_PtNairob/lib_sc_rollup_node/daemon_helpers.ml @@ -161,18 +161,13 @@ let process_included_l1_operation (type kind) (node_ctxt : Node_context.rw) let their_commitment_hash = Sc_rollup_proto_types.Commitment_hash.to_octez their_commitment_hash in - let* known_commitment = - Node_context.commitment_exists node_ctxt their_commitment_hash - in let* () = - if not known_commitment then return_unit - else - Node_context.register_published_commitment - node_ctxt - (Sc_rollup_proto_types.Commitment.to_octez their_commitment) - ~first_published_at_level:(Raw_level.to_int32 published_at_level) - ~level:head.Layer1.level - ~published_by_us:false + Node_context.register_published_commitment + node_ctxt + (Sc_rollup_proto_types.Commitment.to_octez their_commitment) + ~first_published_at_level:(Raw_level.to_int32 published_at_level) + ~level:head.Layer1.level + ~published_by_us:false in (* An accuser node will publish its commitment if the other one is refutable. *) diff --git a/src/proto_018_Proxford/lib_sc_rollup_node/daemon_helpers.ml b/src/proto_018_Proxford/lib_sc_rollup_node/daemon_helpers.ml index a1106f5a0b6e..c4f9e00439bc 100644 --- a/src/proto_018_Proxford/lib_sc_rollup_node/daemon_helpers.ml +++ b/src/proto_018_Proxford/lib_sc_rollup_node/daemon_helpers.ml @@ -162,18 +162,13 @@ let process_included_l1_operation (type kind) ~catching_up {published_at_level; staked_hash = their_commitment_hash; _} ) -> (* Commitment published by someone else *) (* We first register the publication information *) - let* known_commitment = - Node_context.commitment_exists node_ctxt their_commitment_hash - in let* () = - if not known_commitment then return_unit - else - Node_context.register_published_commitment - node_ctxt - (Sc_rollup_proto_types.Commitment.to_octez their_commitment) - ~first_published_at_level:(Raw_level.to_int32 published_at_level) - ~level:head.Layer1.level - ~published_by_us:false + Node_context.register_published_commitment + node_ctxt + (Sc_rollup_proto_types.Commitment.to_octez their_commitment) + ~first_published_at_level:(Raw_level.to_int32 published_at_level) + ~level:head.Layer1.level + ~published_by_us:false in (* An accuser node will publish its commitment if the other one is refutable. *) diff --git a/src/proto_019_PtParisB/lib_sc_rollup_node/daemon_helpers.ml b/src/proto_019_PtParisB/lib_sc_rollup_node/daemon_helpers.ml index 50208c2472e8..8a0da88b0c8a 100644 --- a/src/proto_019_PtParisB/lib_sc_rollup_node/daemon_helpers.ml +++ b/src/proto_019_PtParisB/lib_sc_rollup_node/daemon_helpers.ml @@ -136,18 +136,13 @@ let process_included_l1_operation (type kind) ~catching_up {published_at_level; staked_hash = their_commitment_hash; _} ) -> (* Commitment published by someone else *) (* We first register the publication information *) - let* known_commitment = - Node_context.commitment_exists node_ctxt their_commitment_hash - in let* () = - if not known_commitment then return_unit - else - Node_context.register_published_commitment - node_ctxt - (Sc_rollup_proto_types.Commitment.to_octez their_commitment) - ~first_published_at_level:(Raw_level.to_int32 published_at_level) - ~level:head.Layer1.level - ~published_by_us:false + Node_context.register_published_commitment + node_ctxt + (Sc_rollup_proto_types.Commitment.to_octez their_commitment) + ~first_published_at_level:(Raw_level.to_int32 published_at_level) + ~level:head.Layer1.level + ~published_by_us:false in (* An accuser node will publish its commitment if the other one is refutable. *) diff --git a/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml b/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml index 04317ecb4608..5e5496569043 100644 --- a/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml +++ b/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml @@ -136,18 +136,13 @@ let process_included_l1_operation (type kind) ~catching_up {published_at_level; staked_hash = their_commitment_hash; _} ) -> (* Commitment published by someone else *) (* We first register the publication information *) - let* known_commitment = - Node_context.commitment_exists node_ctxt their_commitment_hash - in let* () = - if not known_commitment then return_unit - else - Node_context.register_published_commitment - node_ctxt - (Sc_rollup_proto_types.Commitment.to_octez their_commitment) - ~first_published_at_level:(Raw_level.to_int32 published_at_level) - ~level:head.Layer1.level - ~published_by_us:false + Node_context.register_published_commitment + node_ctxt + (Sc_rollup_proto_types.Commitment.to_octez their_commitment) + ~first_published_at_level:(Raw_level.to_int32 published_at_level) + ~level:head.Layer1.level + ~published_by_us:false in (* An accuser node will publish its commitment if the other one is refutable. *) -- GitLab