fn verify(tree: &Db) -> (u32, u32) {
    // key 0 should always be the highest value, as that's where we increment
    // at some point, it might go down by one
    // it should never return, or go down again after that
    let mut iter = tree.iter();
    let highest = match iter.next() {
        Some(Ok((_k, v))) => slice_to_u32(&*v),
        Some(Err(e)) => panic!("{:?}", e),
        None => return (0, 0),
    };

    let highest_vec = u32_to_vec(highest);

    // find how far we got
    let mut contiguous: u32 = 0;
    let mut lowest_with_high_value = 0;

    for res in iter {
        let (k, v) = res.unwrap();
        if v[..4] == highest_vec[..4] {
            contiguous += 1;
        } else {
            let expected = if highest == 0 {
                CYCLE as u32 - 1
            } else {
                (highest - 1) % CYCLE as u32
            };
            let actual = slice_to_u32(&*v);
            // FIXME BUG 2
            // thread '<unnamed>' panicked at tests/test_crash_recovery.rs:159:13:
            // assertion `left == right` failed
            //   left: 139
            //  right: 136
            assert_eq!(
                expected,
                actual,
                "tree failed assertion with iterated values: {}, k: {:?} v: {:?} expected: {} highest: {}",
                tree_to_string(&tree),
                k,
                v,
                expected,
                highest
            );
            lowest_with_high_value = actual;
            break;
        }
    }

    // ensure nothing changes after this point
    let low_beginning = u32_to_vec(contiguous + 1);

    for res in tree.range(&*low_beginning..) {
        let (k, v): (sled::InlineArray, _) = res.unwrap();
        assert_eq!(
            slice_to_u32(&*v),
            lowest_with_high_value,
            "expected key {} to have value {}, instead it had value {} in db: {:?}",
            slice_to_u32(&*k),
            lowest_with_high_value,
            slice_to_u32(&*v),
            tree
        );
    }

    (contiguous, highest)
}
Verifies that the keys in the tree are correctly recovered.
Panics if they are incorrect.
Returns the key that should be resumed at, and the current cycle value.
tests/crash_tests/crash_sequential_writes.rs