pub fn compute_history_rank(
chunk: &BlockNumberList,
block_number: BlockNumber,
) -> (u64, Option<u64>)Expand description
Computes the rank and finds the next modification block in a history shard.
Given a block_number, this function returns:
rank: The number of entries strictly beforeblock_numberin the shardfound_block: The block number at positionrank(i.e., the first block >=block_numberwhere a modification occurred), orNoneifrankis out of bounds
The rank is adjusted when block_number exactly matches an entry in the shard,
so that found_block always returns the modification at or after the target.
This logic is shared between MDBX cursor-based lookups and RocksDB iterator lookups.