linera-protocol
linera-protocol copied to clipboard
Implement `range_get` for `*MapView` and `*CollectionView`.
The storage of RocksDb, Memory, and ScyllaDb allows accessing keys from one key to another. This would allow implementing a
async fn find_keys_by_interval(&self, prefix_len: usize, start: &[u8], end: &[u8]) -> Result<Vec<Vec<u8>>, K::Error>
That would return the keys between start and end and drop the first prefix_len keys. It is possible to implement this directly, except maybe for DynamoDb. We would, of course, also have a find_key_values_by_interval.
The start and end could be Included, Excluded, or Unbounded. Though we have to check
When done, this would allow implementing a range_get for the MapView and similar views. Depending on the container, the ordering of the keys would be different.
Do we need this?
I think it is a nice feature that we could have.
But the use case that we had in fn block_hashes has been killed by https://github.com/linera-io/linera-protocol/pull/4897