upgrade min protocol versions for all network kinds (#9058)
This commit is contained in:
parent
802a243385
commit
0af0742613
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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],
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue