Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(network): Upgrade minimum protocol versions for all network kinds #9058

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading