From f35421dd980d676b1408877da04559d38dd72a34 Mon Sep 17 00:00:00 2001 From: mzhangmzz <34969888+mzhangmzz@users.noreply.github.com> Date: Fri, 2 Sep 2022 12:44:38 -0400 Subject: [PATCH] Add RejectBlocksWithOutdatedProtocolVersions to the next shardnet release (#7538) * add feature RejectBlocksWithOutdatedProtocolVersions to the next shardnet release * address comments --- chain/chain/Cargo.toml | 2 ++ core/primitives/Cargo.toml | 2 +- core/primitives/src/version.rs | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/chain/chain/Cargo.toml b/chain/chain/Cargo.toml index 8c6c33a8b10..c97f95b4889 100644 --- a/chain/chain/Cargo.toml +++ b/chain/chain/Cargo.toml @@ -52,6 +52,8 @@ no_cache = ["near-store/no_cache"] protocol_feature_flat_state = ["near-store/protocol_feature_flat_state"] protocol_feature_reject_blocks_with_outdated_protocol_version = ["near-primitives/protocol_feature_reject_blocks_with_outdated_protocol_version"] +shardnet = ["protocol_feature_reject_blocks_with_outdated_protocol_version"] + nightly = [ "nightly_protocol", ] diff --git a/core/primitives/Cargo.toml b/core/primitives/Cargo.toml index 0da55de70d8..5a06d22a442 100644 --- a/core/primitives/Cargo.toml +++ b/core/primitives/Cargo.toml @@ -57,7 +57,7 @@ nightly_protocol = [] # Shardnet is the experimental network that we deploy for chunk-only producer testing. -shardnet = [] +shardnet = ["protocol_feature_reject_blocks_with_outdated_protocol_version"] deepsize_feature = [ "deepsize", diff --git a/core/primitives/src/version.rs b/core/primitives/src/version.rs index 796ed6d24f6..f757b2f03c2 100644 --- a/core/primitives/src/version.rs +++ b/core/primitives/src/version.rs @@ -265,7 +265,13 @@ impl ProtocolFeature { #[cfg(feature = "protocol_feature_account_id_in_function_call_permission")] ProtocolFeature::AccountIdInFunctionCallPermission => 130, #[cfg(feature = "protocol_feature_reject_blocks_with_outdated_protocol_version")] - ProtocolFeature::RejectBlocksWithOutdatedProtocolVersions => 132, + ProtocolFeature::RejectBlocksWithOutdatedProtocolVersions => { + if cfg!(feature = "shardnet") { + 102 + } else { + 132 + } + } #[cfg(feature = "shardnet")] ProtocolFeature::ShardnetShardLayoutUpgrade => 102, }