diff --git a/CHANGELOG.md b/CHANGELOG.md index caf651981894..e158458c919e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ - [#3126](https://github.com/ChainSafe/forest/issues/3126): Bail on database lookup errors instead of silently ignoring them. +- [#2999](https://github.com/ChainSafe/forest/issues/2999): Restored `--tipset` + flag to `forest-cli snapshot export` to allow export at a specific tipset. ### Removed diff --git a/src/cli/subcommands/snapshot_cmd.rs b/src/cli/subcommands/snapshot_cmd.rs index f6e5faae32b8..189470b528da 100644 --- a/src/cli/subcommands/snapshot_cmd.rs +++ b/src/cli/subcommands/snapshot_cmd.rs @@ -40,6 +40,9 @@ pub enum SnapshotCommands { /// Don't write the archive. #[arg(long)] dry_run: bool, + /// Tipset to start the export from, default is the chain head + #[arg(short, long)] + tipset: Option, }, /// Fetches the most recent snapshot from a trusted, pre-defined location. @@ -79,13 +82,14 @@ impl SnapshotCommands { output_path, skip_checksum, dry_run, + tipset, } => { let chain_head = match chain_head(&config.client.rpc_token).await { Ok(head) => head.0, Err(_) => cli_error_and_die("Could not get network head", 1), }; - let epoch = chain_head.epoch(); + let epoch = tipset.unwrap_or(chain_head.epoch()); let chain_name = chain_get_name((), &config.client.rpc_token) .await @@ -96,7 +100,7 @@ impl SnapshotCommands { TrustedVendor::Forest, chain_name, Utc::now().date_naive(), - chain_head.epoch(), + epoch, )), false => output_path.clone(), }; @@ -144,6 +148,7 @@ impl SnapshotCommands { "Export completed. Snapshot located at {}", out.display() )); + println!("\n"); Ok(()) } Self::Fetch { directory, vendor } => {