Add address lookup table program (backport #21616) (#21789)

* Add address lookup table program (#21616)

* Add address lookup table program

* feedback

(cherry picked from commit 9b41ddd9ba)

# Conflicts:
#	runtime/Cargo.toml

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
This commit is contained in:
mergify[bot]
2021-12-11 05:26:46 +00:00
committed by GitHub
parent 7782d34bbf
commit 5bf4445ae6
21 changed files with 1665 additions and 4 deletions

View File

@ -25,6 +25,9 @@ impl SlotHashes {
}
(self.0).truncate(MAX_ENTRIES);
}
pub fn position(&self, slot: &Slot) -> Option<usize> {
self.binary_search_by(|(probe, _)| slot.cmp(probe)).ok()
}
#[allow(clippy::trivially_copy_pass_by_ref)]
pub fn get(&self, slot: &Slot) -> Option<&Hash> {
self.binary_search_by(|(probe, _)| slot.cmp(probe))