MCPcopy Create free account
hub / github.com/base/base / update_canonical

Method update_canonical

crates/execution/flashblocks/src/cache.rs:77–80  ·  view source on GitHub ↗

Updates the latest canonical block number and evicts any cached entries at or below it (they can no longer be useful).

(&mut self, block_number: BlockNumber)

Source from the content-addressed store, hash-verified

75 /// Updates the latest canonical block number and evicts any cached entries
76 /// at or below it (they can no longer be useful).
77 pub fn update_canonical(&mut self, block_number: BlockNumber) {
78 self.latest_canonical = Some(block_number);
79 self.entries.retain(|&bn, _| bn > block_number);
80 }
81
82 /// Returns the number of distinct block numbers currently cached.
83 pub fn len(&self) -> usize {

Callers 2

startMethod · 0.80

Calls 1

retainMethod · 0.80

Tested by 1