Open towelbyte opened 1 day ago
@spartacusrex99 @Jazminima For some reason I cannot add you as reviewers (maybe access rights thing?), thus tagging you here.
Thanks!
I'm having a play..
as we discussed the issue is whether to just switch to v6.. or use Both..
This is a quick and dirty hack, but working prototype, for Minima partial IPv6 support as a proof of concept; for demonstration purposes.
This allows for peers IP:PORT to be defined for IPv6 addresses as well, by simple notation: e.g.:
fda9:e0aa:589f::2:9001
. For proper implementation we may want to only allow the unambiguous square brackets notation, e.g.:[fda9:e0aa:589f::2]:9001
?For proper implementation we may want to filter-out "local" addresses: link local
(fe80::/10)
and unique local(fc00::/7)
, and loopback (::1/128
). Analogous as the code currently does with IPv4 (and then an-allip
option override).Testing: Running on testnet in docker containers w/ unique local IPv6 addresses.
Can send messages over Maxima; Maxima contact addresses w/ IPv6:
"contact":"MxG18HGG6FJ038614Y8CW46US6G20810K0070CD00Z83282G60G13P2JWVKB65Y6C9H4SCM03RY9DRFSBYDAVTRZ3286DRC6426MHAEZZ3GB8G23VCR5EWN82R22843R34056M06Z6BQEY6SJKYGEWZZ3J9T9WHFHSVNFBS222YA0QDAVYGGGNR4HSBNZ87JNHFAJ08ZQQVMP64M1GHHDSEHCEUZ110303NJBW1TUGD5D3CTK0Z5UD3QBSDVFZUUK10608006QWVV1A@fda9:e0aa:589f:0:0:0:0:4:9001"
This does mean that such a node may not be able to communicate over Maxima with a node that may only be connectable via IPv4 (as this node's maxima contact address has only an IPv6 relay address).
The current assumption is there is 1 relay IPv4 address in the Maxima contact address. If adding IPv6 support, maybe Maxima addresses could be extended to be able to have 1 or more IPv4 and/or IPv6 addresses of relay nodes? Maybe simply separated by a comma? e.g.:
"contact":"MxG18HGG6FJ038614Y8CW46US6G20810K0070CD00Z83282G60G13P2JWVKB65Y6C9H4SCM03RY9DRFSBYDAVTRZ3286DRC6426MHAEZZ3GB8G23VCR5EWN82R22843R34056M06Z6BQEY6SJKYGEWZZ3J9T9WHFHSVNFBS222YA0QDAVYGGGNR4HSBNZ87JNHFAJ08ZQQVMP64M1GHHDSEHCEUZ110303NJBW1TUGD5D3CTK0Z5UD3QBSDVFZUUK10608006QWVV1A@fda9:e0aa:589f:0:0:0:0:4:9001,172.20.0.4"
There may be additional backwards compatibility considerations to think of.
node 2: Add initial peer as an IPv6 address:port
node 1: after node 2 has added it as its initial peer:
Netstat shows connections via IPv4 and IPv6. I don't know why multiple connections to the same IP:PORT occur, though.
with
-allip
option: