-
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
#659 Adaptable Discoverying Nodes #705
#659 Adaptable Discoverying Nodes #705
Conversation
The test cases will be added. |
There's a lot to test. And it needs a rebase. Could you update ? I'll focus on reviewing/testing this tomorrow so we can get it merged quickly. |
Thanks l, I will. |
c8138bd
to
aa9dc93
Compare
1712e1f
to
d0b435a
Compare
Codecov Report
@@ Coverage Diff @@
## master #705 +/- ##
==========================================
- Coverage 60.43% 60.25% -0.18%
==========================================
Files 151 153 +2
Lines 10347 10708 +361
==========================================
+ Hits 6253 6452 +199
- Misses 3394 3522 +128
- Partials 700 734 +34
Continue to review full report at Codecov.
|
Entirely newly rewrote. Please continue to review |
d0b435a
to
8ceda36
Compare
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.
👍 👍
And only have some minor issues.
|
||
// startDiscovery will try to discover the validators; it will block until | ||
// enough validators is discovered, and then it will keep discovering the left | ||
// validators. |
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.
Good documentation 👍
8ceda36
to
9906075
Compare
9906075
to
e5ffac0
Compare
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 👍
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 👍
Adaptable Connecting Nodes
Resolves #659
At this time, a node must know these things about its validators,
When one of the endpoints is updated, all the nodes in the network must be restarted with the updated endpoints. This will be a painful job for maintanence.
This patch will solve this problem and new endpoint of validators will be updated without downtime.
Changes
--validators
only with public addressThe current way to set
--validators
is,--validators "self https://127.0.0.1:2822?address=G..W&alias=node2 https://127.0.0.1:2823/?address=G..4&alias=node3 https://127.0.0.1:2824/?address=G..O&alias=node4"
The new way is,
--validators "self G..W G..4 G..O"
Node just knows only the public address, the variable information like endpoint and alias are removed.
The environment variable also can be set,
New option,
--discovery
Instead of setting endpoint in
--validators
option, using--discovery
node will try to discover the validators. When a node starts, the node will sendnetwork.DiscoveryMessage
to--discovery
values. Each node sends and receivesnetwork.DiscoveryMessage
s, the node can be started until the number of discovered validators is over consensus threshold.--discovery
also can be set by an environment variable,SEBAK_DISCOVERY
, multiple values can be separated by empty space.Omitting
-discovery
option also be possible. Without--discovery
node will just waitnetwork.DiscoveryMessage
from other nodes.WatcherMode
Watcher does not care about the validator, it just needs the target node to watch. Watcher will use
--discovery
instead of--validators
, the node address will be fetched from the node info of--discovery
node. At this process, the remote node info is compared with watcher; the network id and initial balance are matched.Minor changes
node.LocalNode.Endpoint()
will return ifpublishEndpoint
is setnode.LocalNode.ClearValidators()
will make emptyvalidators
Etc
This patch was severely tested in integration test :)