feat: enable NoDial should still dial static nodes#2151
feat: enable NoDial should still dial static nodes#2151zzzckck merged 1 commit intobnb-chain:developfrom
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 = trueHowever, 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. |
zzzckck
left a comment
There was a problem hiding this comment.
LGTM, I think it is reasonable that user could only want to establish connection with StaticNodes.
Description
Resolves #2149
Changes
Previously, when
NoDialis 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
NoDialis 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.