From b0a1058ce80412f9dc464d127002c86c8eff1fe1 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Mon, 15 Apr 2024 09:16:18 +0200 Subject: [PATCH] Store: read uint32 while checking snapshot import consistency --- src/lib_store/unix/cemented_block_store.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_store/unix/cemented_block_store.ml b/src/lib_store/unix/cemented_block_store.ml index 95fb1aa26f2d..01d095def3de 100644 --- a/src/lib_store/unix/cemented_block_store.ml +++ b/src/lib_store/unix/cemented_block_store.ml @@ -1022,7 +1022,7 @@ let check_indexes_consistency ?(post_step = fun () -> Lwt.return_unit) let*! () = Lwt_utils_unix.read_bytes ~len:len_offset fd bytes in let offsets = Data_encoding.Binary.of_bytes_exn - Data_encoding.(Variable.array ~max_length:nb_blocks int31) + Data_encoding.(Variable.array ~max_length:nb_blocks int32) bytes in (* Cursor is now after the offset region *) @@ -1032,7 +1032,7 @@ let check_indexes_consistency ?(post_step = fun () -> Lwt.return_unit) let*! cur_offset = Lwt_unix.lseek fd 0 Unix.SEEK_CUR in let* () = fail_unless - Compare.Int.(cur_offset = offsets.(n)) + Compare.Int32.(Int32.of_int cur_offset = offsets.(n)) (Inconsistent_cemented_store (Bad_offset {level = n; cycle = Naming.file_path file})) -- GitLab