Skip to content

sui_v0.30.0_1680514340_ci

@phoenix-o phoenix-o tagged this 03 Apr 07:24
currently there's a bug in the way we use iterators in the codebase
we check iterators for
[validity](https://github.com/MystenLabs/sui/blob/main/crates/typed-store/src/rocks/iter.rs#L45),
but do not check for potential
[errors](https://github.com/rust-rocksdb/rust-rocksdb/blob/master/src/db_iterator.rs#L132).
So we can't really differentiate if the iterator stopped because it was
fully consumed or there was an error.

This PR introduces a new temporary method `safe_iter`. It's similar to
the existing `iter` method but returns an iterator of results instead.
We use iterators a lot, so migration of call sites will be split into a
few batches. Once migration is done, `safe_iter` will be renamed back to
`iter`
 
Notes:
* `.keys` and `.values` methods are fully migrated
* `typed_store` internal call sites (including sally) and tests are
migrated
*  `typed_store::Store` struct is deprecated and removed
Assets 2
Loading