Skip to content

Commit

Permalink
Fix start protocol version for deriving cache limits (#12636)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagr authored Dec 17, 2024
1 parent 603060e commit c4e8d97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/store/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ impl StoreConfig {
let mut shard_layouts: Vec<ShardLayout> = 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();
Expand Down

0 comments on commit c4e8d97

Please sign in to comment.