@@ -23,9 +23,8 @@ static const TestVectors vals_main{
2323 // - Port should default to default P2P core with MnNetInfo
2424 // - Ports are no longer implied with ExtNetInfo
2525 {{Purpose::CORE_P2P, " 1.1.1.1" }, NetInfoStatus::Success, NetInfoStatus::BadPort},
26- // - Non-mainnet port on mainnet causes failure in MnNetInfo
27- // - ExtNetInfo is indifferent to choice of port unless it's a bad port which 9998 isn't
28- {{Purpose::CORE_P2P, " 1.1.1.1:9998" }, NetInfoStatus::BadPort, NetInfoStatus::Success},
26+ // Non-mainnet port on mainnet not allowed
27+ {{Purpose::CORE_P2P, " 1.1.1.1:9998" }, NetInfoStatus::BadPort, NetInfoStatus::BadPort},
2928 // Internal addresses not allowed on mainnet
3029 {{Purpose::CORE_P2P, " 127.0.0.1:9999" }, NetInfoStatus::NotRoutable, NetInfoStatus::NotRoutable},
3130 // Valid IPv4 formatting but invalid IPv4 address
@@ -44,9 +43,14 @@ static const TestVectors vals_main{
4443 {{Purpose::CORE_P2P, " :9999" }, NetInfoStatus::BadInput, NetInfoStatus::BadInput},
4544 // Bad purpose code
4645 {{64 , " 1.1.1.1:9999" }, NetInfoStatus::MaxLimit, NetInfoStatus::MaxLimit},
47- // - MnNetInfo doesn't allow storing anything except a Core P2P address
48- // - ExtNetInfo allows storing Platform P2P addresses
49- {{Purpose::PLATFORM_P2P, " 1.1.1.1:9999" }, NetInfoStatus::MaxLimit, NetInfoStatus::Success},
46+ // - MnNetInfo only supports CORE_P2P and cannot store PLATFORM_HTTPS
47+ // - ExtNetInfo can store PLATFORM_HTTPS but non-default ports are not allowed on mainnet
48+ {{Purpose::PLATFORM_HTTPS, " 1.1.1.1:443" }, NetInfoStatus::MaxLimit, NetInfoStatus::Success},
49+ {{Purpose::PLATFORM_HTTPS, " 1.1.1.1:1445" }, NetInfoStatus::MaxLimit, NetInfoStatus::BadPort},
50+ // - MnNetInfo only supports CORE_P2P and cannot store PLATFORM_HTTPS
51+ // - ExtNetInfo can store PLATFORM_P2P but non-default ports are not allowed on mainnet
52+ {{Purpose::PLATFORM_P2P, " 1.1.1.1:26656" }, NetInfoStatus::MaxLimit, NetInfoStatus::Success},
53+ {{Purpose::PLATFORM_P2P, " 1.1.1.1:26657" }, NetInfoStatus::MaxLimit, NetInfoStatus::BadPort},
5054};
5155
5256void ValidateGetEntries (const NetInfoList& entries, const size_t expected_size)
@@ -125,12 +129,21 @@ static const TestVectors vals_reg{
125129 // - MnNetInfo doesn't mind using port 0
126130 // - ExtNetInfo prohibits non-zero ports
127131 {{Purpose::CORE_P2P, " 1.1.1.1:0" }, NetInfoStatus::Success, NetInfoStatus::BadPort},
128- // - Mainnet P2P port on non-mainnet cause failure in MnNetInfo
129- // - ExtNetInfo is indifferent to choice of port unless it's a bad port which 9999 isn't
130- {{Purpose::CORE_P2P, " 1.1.1.1:9999" }, NetInfoStatus::BadPort, NetInfoStatus::Success},
132+ // Mainnet P2P port on non-mainnet not allowed
133+ {{Purpose::CORE_P2P, " 1.1.1.1:9999" }, NetInfoStatus::BadPort, NetInfoStatus::BadPort},
131134 // - Non-mainnet P2P port is allowed in MnNetInfo regardless of bad port status
132135 // - Port 22 (SSH) is below the privileged ports threshold (1023) and is therefore a bad port, disallowed in ExtNetInfo
133136 {{Purpose::CORE_P2P, " 1.1.1.1:22" }, NetInfoStatus::Success, NetInfoStatus::BadPort},
137+ // - MnNetInfo only supports CORE_P2P and cannot store PLATFORM_HTTPS
138+ // - ExtNetInfo can store PLATFORM_HTTPS but default and non-default ports are allowed on non-mainnet
139+ {{Purpose::PLATFORM_HTTPS, " 1.1.1.1:443" }, NetInfoStatus::MaxLimit, NetInfoStatus::Success},
140+ {{Purpose::PLATFORM_HTTPS, " 1.1.1.1:1445" }, NetInfoStatus::MaxLimit, NetInfoStatus::Success},
141+ // The port 443 bad ports carve-out doesn't apply outside PLATFORM_HTTPS (where it is default)
142+ {{Purpose::PLATFORM_P2P, " 1.1.1.1:443" }, NetInfoStatus::MaxLimit, NetInfoStatus::BadPort},
143+ // - MnNetInfo only supports CORE_P2P and cannot store PLATFORM_P2P
144+ // - ExtNetInfo can store PLATFORM_P2P but default and non-default ports are allowed on non-mainnet
145+ {{Purpose::PLATFORM_P2P, " 1.1.1.1:26656" }, NetInfoStatus::MaxLimit, NetInfoStatus::Success},
146+ {{Purpose::PLATFORM_P2P, " 1.1.1.1:26657" }, NetInfoStatus::MaxLimit, NetInfoStatus::Success},
134147};
135148
136149enum class ExpectedType : uint8_t {
0 commit comments