From f85c11f723cda1286d576bd25d2c7d576ce93e29 Mon Sep 17 00:00:00 2001 From: Jan Malinowski Date: Mon, 28 Oct 2024 16:51:04 +0000 Subject: [PATCH] Allow ShardHeaderInnerV2 in bandwidth scheduler version --- core/primitives/src/sharding.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/primitives/src/sharding.rs b/core/primitives/src/sharding.rs index 7dfbae62591..226ebb76dc1 100644 --- a/core/primitives/src/sharding.rs +++ b/core/primitives/src/sharding.rs @@ -609,9 +609,10 @@ impl ShardChunkHeader { // In bandwidth scheduler version v3 and v4 are allowed. The first chunk in // the bandwidth scheduler version will be v3 because the chunk extra for the // last chunk of previous version doesn't have bandwidth requests. - ShardChunkHeaderInner::V2(_) => { - version >= BLOCK_HEADER_V3_VERSION && version < BANDWIDTH_SCHEDULER_VERSION - } + // v2 is also allowed in the bandwidth scheduler version because there + // are multiple tests which upgrade from an old version directtly to the + // latest version. TODO(#12328) - don't allow InnerV2 in bandwidth scheduler version. + ShardChunkHeaderInner::V2(_) => version >= BLOCK_HEADER_V3_VERSION, ShardChunkHeaderInner::V3(_) => version >= CONGESTION_CONTROL_VERSION, ShardChunkHeaderInner::V4(_) => version >= BANDWIDTH_SCHEDULER_VERSION, },