-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support ipv6 #167
Comments
Actually, I have a small question, I would really appreciate it if someone could answer it for me. Currently DEFAULT_SEARCH_INTERVAL_MS is 0, and I didn't find the input |
In Lodestar we trigger findPeer searches on demand. This option is left there for backwards compatibility since some downstream consumers may rely on discv5 emitting ENRs without any input. However as you note the performance cost is high. I think we should completely deprecate the interval for findPeers and let the consumer implement a constant loop if that's what they want. Here we trigger the searches in Lodestar, let me know if that answers your question https://github.com/ChainSafe/lodestar/blob/cdfebc36387aaa3a590217102ca113292f6abb12/packages/lodestar/src/network/peers/discover.ts#L235 EDIT: I got confused for a second too, in Lodestar the Discv5 class directly from |
Thanks for the explanation, now I totally get it! |
I tried to use this library in an environment where ipv6 and ipv4 co-exist, but encountered some problems:
UDPTransportService
, the socket object is created according to themultiaddr.toOptions().family
, which may beudp4
orudp6
. When the local socket object isudp4
but the remote host is an ipv6 address, callingthis.socket.send
will return an error:Maybe we should create and bind two socket objects
udp4
andudp6
, and then judge which socket object to use when sending?enr.getLocationMultiaddr("udp")
is used directly without judgmentFor example, this place should determine whether
message.recipientIp
is an ipv4 address or an ipv6 address before callingenr.getLocationMultiaddr("udp")
. Ifmessage.recipientIp
is an ipv6 address, butcurrentAddr
is an ipv4 address, the two cannot be equal, which will cause the local node to keep increasing its ownenr.seq
And other places, like here and here and here (Although I don't know what these places are doing)
The text was updated successfully, but these errors were encountered: