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(
240
235
target_dir,
241
236
&snapshot.network,
242
-
)?;
237
+
include_ancillary,
238
+
snapshot.beacon.immutable_file_number,
239
+
&self.logger
240
+
)
241
+
.compute_expected_state_after_download()
242
+
.await?;
243
243
244
-
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
245
252
}
246
253
247
254
/// Download and unpack the given immutable files of the snapshot to the given directory
@@ -260,16 +267,48 @@ impl SnapshotClient {
260
267
self.logger,
261
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."
262
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<()> {
263
298
usecrate::feedback::MithrilEvent;
299
+
264
300
let download_id = MithrilEvent::new_snapshot_download_id();
Copy file name to clipboardExpand all lines: mithril-client/src/utils/mod.rs
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,16 @@
1
1
//! Utilities module
2
2
//! This module contains tools needed mostly for the snapshot download and unpack.
3
3
4
-
pubconstANCILLARIES_NOT_SIGNED_BY_MITHRIL:&str = "Ancillary verification does not use the Mithril certification: as a mitigation, IOG owned keys are used to sign these files.";
5
-
6
4
cfg_fs!{
5
+
pubconstANCILLARIES_NOT_SIGNED_BY_MITHRIL:&str = "Ancillary verification does not use the Mithril certification: as a mitigation, IOG owned keys are used to sign these files.";
0 commit comments