Skip to content

Commit 99807cb

Browse files
committed
if commit is too short do not shorten it
1 parent ca2e5bd commit 99807cb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/lib/mina_lib/mina_lib.ml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,16 @@ let context ~commit_id ~proof_cache_db (config : Config.t) : (module CONTEXT) =
13011301
let proof_cache_db = proof_cache_db
13021302
end )
13031303

1304+
let shorten_commit_id commit_id =
1305+
(* Shorten the commit ID to 8 characters for logging purposes *)
1306+
let min_commit_id_length = 8 in
1307+
if String.length commit_id < min_commit_id_length then commit_id
1308+
else
1309+
(* Take the first 8 characters of the commit ID *)
1310+
String.sub ~pos:0 ~len commit_id
1311+
13041312
let start t =
1305-
let commit_id_short = String.sub ~pos:0 ~len:8 t.commit_id in
1313+
let commit_id_short = shorten_commit_id t.commit_id in
13061314
let set_next_producer_timing timing consensus_state =
13071315
let block_production_status, next_producer_timing =
13081316
let generated_from_consensus_at :
@@ -1694,7 +1702,8 @@ let initialize_zkapp_vk_cache_db (config : Config.t) =
16941702
>>| function Error e -> raise_on_initialization_error e | Ok db -> db
16951703

16961704
let create ~commit_id ?wallets (config : Config.t) =
1697-
let commit_id_short = String.sub ~pos:0 ~len:8 commit_id in
1705+
[%log' info config.logger] "Creating daemon with commit id: %s" commit_id ;
1706+
let commit_id_short = shorten_commit_id commit_id in
16981707
let constraint_constants = config.precomputed_values.constraint_constants in
16991708
let consensus_constants = config.precomputed_values.consensus_constants in
17001709
let block_window_duration = config.compile_config.block_window_duration in

0 commit comments

Comments
 (0)