From 0af07426134986f14ac202765358de522ef7cc23 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 27 Nov 2024 12:49:07 -0300 Subject: [PATCH] upgrade min protocol versions for all network kinds (#9058) --- zebra-network/src/constants.rs | 8 ++++---- zebra-network/src/peer_set/set/tests/vectors.rs | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/zebra-network/src/constants.rs b/zebra-network/src/constants.rs index a116fd63018..acab966f40c 100644 --- a/zebra-network/src/constants.rs +++ b/zebra-network/src/constants.rs @@ -396,14 +396,14 @@ lazy_static! { /// /// The minimum network protocol version typically changes after Mainnet and /// Testnet network upgrades. - // TODO: Change `Nu5` to `Nu6` after NU6 activation. + // TODO: Change `Nu6` to `Nu7` after NU7 activation. // TODO: Move the value here to a field on `testnet::Parameters` (#8367) pub static ref INITIAL_MIN_NETWORK_PROTOCOL_VERSION: HashMap = { let mut hash_map = HashMap::new(); - hash_map.insert(NetworkKind::Mainnet, Version::min_specified_for_upgrade(&Mainnet, Nu5)); - hash_map.insert(NetworkKind::Testnet, Version::min_specified_for_upgrade(&Network::new_default_testnet(), Nu5)); - hash_map.insert(NetworkKind::Regtest, Version::min_specified_for_upgrade(&Network::new_regtest(None, None), Nu5)); + hash_map.insert(NetworkKind::Mainnet, Version::min_specified_for_upgrade(&Mainnet, Nu6)); + hash_map.insert(NetworkKind::Testnet, Version::min_specified_for_upgrade(&Network::new_default_testnet(), Nu6)); + hash_map.insert(NetworkKind::Regtest, Version::min_specified_for_upgrade(&Network::new_regtest(None, None), Nu6)); hash_map }; diff --git a/zebra-network/src/peer_set/set/tests/vectors.rs b/zebra-network/src/peer_set/set/tests/vectors.rs index 0a5d3d34eaf..9f8fbe1f136 100644 --- a/zebra-network/src/peer_set/set/tests/vectors.rs +++ b/zebra-network/src/peer_set/set/tests/vectors.rs @@ -26,7 +26,7 @@ fn peer_set_ready_single_connection() { let peer_versions = PeerVersions { peer_versions: vec![Version::min_specified_for_upgrade( &Network::Mainnet, - NetworkUpgrade::Nu5, + NetworkUpgrade::Nu6, )], }; @@ -118,7 +118,7 @@ fn peer_set_ready_single_connection() { #[test] fn peer_set_ready_multiple_connections() { // Use three peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version, peer_version], }; @@ -182,7 +182,7 @@ fn peer_set_rejects_connections_past_per_ip_limit() { const NUM_PEER_VERSIONS: usize = crate::constants::DEFAULT_MAX_CONNS_PER_IP + 1; // Use three peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: [peer_version; NUM_PEER_VERSIONS].into_iter().collect(), }; @@ -232,7 +232,7 @@ fn peer_set_route_inv_empty_registry() { let test_hash = block::Hash([0; 32]); // Use two peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version], }; @@ -315,7 +315,7 @@ fn peer_set_route_inv_advertised_registry_order(advertised_first: bool) { let test_change = InventoryStatus::new_available(test_inv, test_peer); // Use two peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version], }; @@ -423,7 +423,7 @@ fn peer_set_route_inv_missing_registry_order(missing_first: bool) { let test_change = InventoryStatus::new_missing(test_inv, test_peer); // Use two peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version], }; @@ -525,7 +525,7 @@ fn peer_set_route_inv_all_missing_fail() { let test_change = InventoryStatus::new_missing(test_inv, test_peer); // Use one peer - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version], };