Skip to content

Commit

Permalink
upgrade min protocol versions for all network kinds (#9058)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxarbitrage authored Nov 27, 2024
1 parent 802a243 commit 0af0742
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions zebra-network/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NetworkKind, Version> = {
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
};
Expand Down
14 changes: 7 additions & 7 deletions zebra-network/src/peer_set/set/tests/vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)],
};

Expand Down Expand Up @@ -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],
};
Expand Down Expand Up @@ -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(),
};
Expand Down Expand Up @@ -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],
};
Expand Down Expand Up @@ -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],
};
Expand Down Expand Up @@ -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],
};
Expand Down Expand Up @@ -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],
};
Expand Down

0 comments on commit 0af0742

Please sign in to comment.