You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
slog::warn!(self.logger,"The fast bootstrap of the Cardano node is not available with the current parameters used in this command: the ledger state will be recomputed from genesis at startup of the Cardano node. Set the include_ancillary entry to true in the DownloadUnpackOptions.");
let expected_files_after_download = UnexpectedDownloadedFileVerifier::new(
239
235
target_dir,
240
236
&snapshot.network,
241
-
)?;
237
+
include_ancillary,
238
+
snapshot.beacon.immutable_file_number,
239
+
&self.logger
240
+
)
241
+
.compute_expected_state_after_download()
242
+
.await?;
242
243
243
-
Ok(())
244
+
// Return the result later so unexpected file removal is always run
245
+
let result = self.run_download_unpack(snapshot, target_dir, include_ancillary).await;
246
+
247
+
expected_files_after_download
248
+
.remove_unexpected_files()
249
+
.await?;
250
+
251
+
result
244
252
}
245
253
246
254
/// Download and unpack the given immutable files of the snapshot to the given directory
@@ -259,16 +267,48 @@ impl SnapshotClient {
259
267
self.logger,
260
268
"The fast bootstrap of the Cardano node is not available with the current parameters used in this command: the ledger state will be recomputed from genesis at startup of the Cardano node. Use the extra function download_unpack_full to allow it."
261
269
);
270
+
271
+
let include_ancillary = false;
272
+
let expected_files_after_download = UnexpectedDownloadedFileVerifier::new(
273
+
target_dir,
274
+
&snapshot.network,
275
+
include_ancillary,
276
+
snapshot.beacon.immutable_file_number,
277
+
&self.logger
278
+
)
279
+
.compute_expected_state_after_download()
280
+
.await?;
281
+
282
+
// Return the result later so unexpected file removal is always run
283
+
let result = self.run_download_unpack(snapshot, target_dir, include_ancillary).await;
284
+
285
+
expected_files_after_download
286
+
.remove_unexpected_files()
287
+
.await?;
288
+
289
+
result
290
+
}
291
+
292
+
asyncfn run_download_unpack(
293
+
&self,
294
+
snapshot:&Snapshot,
295
+
target_dir:&Path,
296
+
include_ancillary:bool,
297
+
) -> MithrilResult<()> {
262
298
usecrate::feedback::MithrilEvent;
299
+
263
300
let download_id = MithrilEvent::new_snapshot_download_id();
0 commit comments