pub fn first_retained_version(&self) -> Option<u64> {
        match self.db.min_stale_key_version() {
            // Min stale key version is next after the first retained version since at least
            // the root is updated on each version.
            Some(version) => version.checked_sub(1),
            // No stale keys means all past versions of the tree have been pruned
            None => self.latest_version(),
        }
    }
Returns the first retained version of the tree.
core/lib/merkle_tree/src/lib.rs