pub fn set_target_retained_version(&self, new_version: u64) -> Result<u64, PrunerStoppedError> {
        if let Some(version) = self.target_retained_version.upgrade() {
            Ok(version.fetch_max(new_version, Ordering::Relaxed))
        } else {
            Err(PrunerStoppedError(()))
        }
    }
Sets the version of the tree the pruner should attempt to prune to. Calls should provide
monotonically increasing versions; call with a lesser version will have no effect.

Returns the previously set target retained version.

# Errors

If the pruner has stopped (e.g., due to a panic), this method will return an error.
core/lib/merkle_tree/src/pruning.rs