-
Notifications
You must be signed in to change notification settings - Fork 455
P2P 2.3 incompatibility with older version - Closes #4060 #4065
P2P 2.3 incompatibility with older version - Closes #4060 #4065
Conversation
elements/lisk-p2p/src/validation.ts
Outdated
@@ -39,6 +43,7 @@ import { constructPeerIdFromPeerInfo } from './utils'; | |||
|
|||
const IPV4_NUMBER = 4; | |||
const IPV6_NUMBER = 6; | |||
export const IPADDRESS_FIELD_SUPPORT_VERSION = '2.3.0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IP_ADDRESS_FIELD_SUPPORT_VERSION
is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this SDK version or Core version?
I think this version doesnt relates to this library, so Prefer not to use hardcoded version , too.
elements/lisk-p2p/src/peer/base.ts
Outdated
procedure: REMOTE_RPC_GET_PEERS_LIST, | ||
procedure: isLowerVersionPeer(this._peerInfo as P2PDiscoveredPeerInfo) | ||
? REMOTE_RPC_GET_PEERS_LIST | ||
: REMOTE_RPC_GET_MINIMAL_PEERS_LIST, | ||
}); | ||
|
||
return validateBasicPeersInfoList(response.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should always remove other properties (except for ip/ipAddress and wsPort), even if the peer is the old version and it gives us the full list. The idea for the original feature was that we can't trust PeerInfo which we haven't connected to so that is why we don't store the other fields. Maybe we should keep this aspect.
elements/lisk-p2p/src/validation.ts
Outdated
@@ -39,6 +43,7 @@ import { constructPeerIdFromPeerInfo } from './utils'; | |||
|
|||
const IPV4_NUMBER = 4; | |||
const IPV6_NUMBER = 6; | |||
export const IPADDRESS_FIELD_SUPPORT_VERSION = '2.3.0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this SDK version or Core version?
I think this version doesnt relates to this library, so Prefer not to use hardcoded version , too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets re-open the issue to update the RPC endpoint and tackle on 3.0?
0512b8f
to
db5bde0
Compare
What was the problem?
The
2.3
node should work with old2.0
and1.x
peers. There is an incompatibility issue related toipAddress
vsip
properties in old versions. Also, the old version only supportslist
RPC to get peers list.How did I solve it?
peerInfo
sanitization function.2.3
How to manually test it?
npm t
and also connect with older versions and see if it's fetching peersReview checklist