@@ -1222,17 +1222,22 @@ fn dump_reconstruct_to_file(
12221222 states : needed_blocks. clone ( ) ,
12231223 } ;
12241224
1225- const FILENAME : & str = "/tmp/failed_reconstruct_ctx.binprot" ;
1225+ let debug_dir = openmina_core:: get_debug_dir ( ) ;
1226+ let filename = debug_dir
1227+ . join ( "failed_reconstruct_ctx.binprot" )
1228+ . to_string_lossy ( )
1229+ . to_string ( ) ;
1230+ std:: fs:: create_dir_all ( & debug_dir) ?;
12261231
12271232 use mina_p2p_messages:: binprot:: BinProtWrite ;
1228- let mut file = std:: fs:: File :: create ( FILENAME ) ?;
1233+ let mut file = std:: fs:: File :: create ( & filename ) ?;
12291234 reconstruct_context. binprot_write ( & mut file) ?;
12301235 file. sync_all ( ) ?;
12311236
12321237 openmina_core:: info!(
12331238 openmina_core:: log:: system_time( ) ;
12341239 kind = "LedgerService::dump - Failed reconstruct" ,
1235- summary = format!( "Reconstruction saved to: {FILENAME :?}" )
1240+ summary = format!( "Reconstruction saved to: {filename :?}" )
12361241 ) ;
12371242
12381243 Ok ( ( ) )
@@ -1277,9 +1282,16 @@ fn dump_application_to_file(
12771282 blocks : vec ! [ ( * block. block) . clone( ) ] ,
12781283 } ;
12791284
1280- use mina_p2p_messages:: binprot:: BinProtWrite ;
1281- let filename = format ! ( "/tmp/failed_application_ctx_{}.binprot" , block_height) ;
1285+ let debug_dir = openmina_core:: get_debug_dir ( ) ;
1286+ let filename = debug_dir
1287+ . join ( format ! ( "failed_application_ctx_{}.binprot" , block_height) )
1288+ . to_string_lossy ( )
1289+ . to_string ( ) ;
1290+ std:: fs:: create_dir_all ( & debug_dir) ?;
1291+
12821292 let mut file = std:: fs:: File :: create ( & filename) ?;
1293+
1294+ use mina_p2p_messages:: binprot:: BinProtWrite ;
12831295 apply_context. binprot_write ( & mut file) ?;
12841296 file. sync_all ( ) ?;
12851297
0 commit comments