From c4e8d9709cd325d0c6e01081f7b57d0149ad0a63 Mon Sep 17 00:00:00 2001 From: Julian Eager Date: Tue, 17 Dec 2024 23:28:54 +0800 Subject: [PATCH] Fix start protocol version for deriving cache limits (#12636) --- core/store/src/config.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/store/src/config.rs b/core/store/src/config.rs index 6aa06864c03..7bd3cd444cf 100644 --- a/core/store/src/config.rs +++ b/core/store/src/config.rs @@ -196,8 +196,9 @@ impl StoreConfig { let mut shard_layouts: Vec = Vec::new(); // Ideally we should use the protocol version from current epoch config as start of // the range, but store should not need to depend on the knowledge of current epoch. - let start_version = - PROTOCOL_VERSION.min(ProtocolFeature::SimpleNightshadeV4.protocol_version() - 1); + let start_version = ProtocolFeature::SimpleNightshadeV4.protocol_version() - 1; + // T-1 to ensure cache limits for old layout are included on the edge of upgrading. + let start_version = start_version.min(PROTOCOL_VERSION - 1); for protocol_version in start_version..=PROTOCOL_VERSION { let epoch_config = epoch_config_store.get_config(protocol_version); let shard_layout = epoch_config.shard_layout.clone();