pub fn new(name: &'static str, capacity: usize) -> Self {
        assert!(capacity > 0, "Cache capacity must be greater than 0");

        let config = SequentialCacheConfig {
            capacity: capacity as u64,
        };
        tracing::info!("Configured sequential cache `{name}` with capacity {capacity} items");
        let metrics = &METRICS[&name.into()];
        if let Err(err) = metrics.sequential_info.set(config) {
            tracing::warn!(
                "Sequential cache `{name}` was already created with config {:?}; new config: {:?}",
                metrics.sequential_info.get(),
                err.into_inner()
            );
        }

        SequentialCache {
            metrics,
            data: VecDeque::with_capacity(capacity),
            capacity,
        }
    }
Creates a new `SequentialCache` with the specified maximum capacity.

# Panics

Panics if `capacity` is 0.
core/lib/state/src/cache/sequential_cache.rs