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

Method is_cacheable

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

Returns `true` when the flashblock's block number is within [`MAX_CACHE_AHEAD_BLOCKS`] of the latest known canonical block and is therefore eligible for caching.

(&self, block_number: BlockNumber)

Source from the content-addressed store, hash-verified

40 /// [`MAX_CACHE_AHEAD_BLOCKS`] of the latest known canonical block and is
41 /// therefore eligible for caching.
42 pub const fn is_cacheable(&self, block_number: BlockNumber) -> bool {
43 match self.latest_canonical {
44 Some(canonical) => block_number <= canonical + MAX_CACHE_AHEAD_BLOCKS + 1,
45 None => false,
46 }
47 }
48
49 /// Inserts a flashblock into the cache.
50 ///

Callers 1

insertMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected