-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: enable NoDial should still dial static nodes #2151
Conversation
what about |
I think we can include VerifyNodes, since the node is going to connect with the VerifyNodes when started right away, exactly the same as StaticNodes. For TrustedNodes, I don't think it's necessary because the scenario here targets |
add verify nodes
edc6c9d
to
aa48768
Compare
I think your needs should be solved using [Node.P2P]
NoDiscovery = true
However, your changes can indeed meet your needs, but I think nodiscover is more suitable for your needs. It can manually manage, add and delete |
Not exactly. |
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.
LGTM, I think it is reasonable that user could only want to establish connection with StaticNodes.
Description
Resolves #2149
Changes
Previously, when
NoDial
is set to true, then the maximum dial peers is always going to be 0. Hence, the node is never going to dial static nodes.With this code change, when
NoDial
is set to true, the maximum dial peers will be set to the number of static peers. With this, the dial scheduler knows that there are available slots to dial the static peers.One concern regarding this design is that, if the node doesn't dial the static nodes successfully, will it then dial the other peers, since there are available dial slots?
Fortunately, the answer is no. Based on the code here, it's guaranteed to return the number of static nodes. Therefore, there will be no available slots to dial other peers.