From 4d342db83033ee40bbb86cf1cd28620966fac5e8 Mon Sep 17 00:00:00 2001 From: IvanPsurtcev <87025698+IvanPsurtcev@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:56:57 +0300 Subject: [PATCH] fix: function write_checkpoint did not write checkpoint_{index}_with_id.json files to the folder (#4915) ### Description Added a mechanism for writing checkpoint files to the checkpoint folder in the write_chekpoint function. Without this change we wrote a lot of files to the root folder, which was not a correct behavior. --- rust/main/hyperlane-base/src/types/gcs_storage.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/main/hyperlane-base/src/types/gcs_storage.rs b/rust/main/hyperlane-base/src/types/gcs_storage.rs index a413edb323..93219f8510 100644 --- a/rust/main/hyperlane-base/src/types/gcs_storage.rs +++ b/rust/main/hyperlane-base/src/types/gcs_storage.rs @@ -240,7 +240,8 @@ impl CheckpointSyncer for GcsStorageClient { &self, signed_checkpoint: &SignedCheckpointWithMessageId, ) -> Result<()> { - let object_name = Self::get_checkpoint_key(signed_checkpoint.value.index); + let object_key = Self::get_checkpoint_key(signed_checkpoint.value.index); + let object_name = self.object_path(&object_key); let data = serde_json::to_vec(signed_checkpoint)?; self.upload_and_log(&object_name, data).await }