-
Notifications
You must be signed in to change notification settings - Fork 115
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
Initial sentry node support #2300
Conversation
ab6bed9
to
952ab7c
Compare
44562ee
to
2c8391c
Compare
go/common/node/address.go
Outdated
// NOTE: This could be the P2P ID and IP of a sentry node. | ||
type ConsensusAddress struct { | ||
ID signature.PublicKey `json:"id"` | ||
Address Address `json:"address"` |
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.
General question...
Unless I'm mistake, the tendermint protocol sentry nodes as used for cosmos are meant to be a dynamic set of machines. These sentry node machines could in theory continuously disappear and reappear with different IP addresses and identities. The gossip nature of the tendermint protocol would allow this to work. Is there a reason that we need to specify more than the ID
when registering a node for consensus?
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.
Yeah this would probably work as well, but would rely exclusively on the seed nodes to establish peers via PEX.
Also tendermint AFAIK requires you to specify validator addresses in the genesis block?
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.
Also "sentry nodes" (aka proxies) for other things (gRPC and possibly libp2p) will definitely require addresses and we should keep that in mind while designing any proxy stuff.
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.
Also tendermint AFAIK requires you to specify validator addresses in the genesis block?
Strictly speaking, no: https://godoc.org/github.com/tendermint/tendermint/types#GenesisValidator
Our tendermint seed node implementation currently uses the genesis document to populate the initial address book. This can be omitted, assuming "enough" nodes use the seed node. Time to a functional network after redeploy will be longer.
From a practical perspective, we use more than tendermint, and I don't see us implementing a gossip protocol anytime soon. So I'm not sure what this saves if anything.
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.
As long as it's possible for the tendermint sentry node to disappear entirely I would say whatever gets registered is alright.
Also "sentry nodes" (aka proxies) for other things (gRPC and possibly libp2p) will definitely require addresses and we should keep that in mind while designing any proxy stuff.
I would say registering an address for libp2p/grpc proxy would be fine. Would it be possible to register a DNS name and cert for those proxies so that IPs can float and be scaled out?
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.
Would it be possible to register a DNS name and cert for those proxies so that IPs can float and be scaled out?
Yes.
2c8391c
to
b31cd70
Compare
Codecov Report
@@ Coverage Diff @@
## master #2300 +/- ##
==========================================
+ Coverage 66.17% 66.35% +0.17%
==========================================
Files 288 292 +4
Lines 29444 29663 +219
==========================================
+ Hits 19484 19682 +198
- Misses 7620 7627 +7
- Partials 2340 2354 +14
Continue to review full report at Codecov.
|
dbc8d02
to
2802735
Compare
fc84120
to
ba3031c
Compare
go/tendermint/tendermint.go
Outdated
tenderConfig.P2P.SeedMode = viper.GetBool(CfgP2PSeedMode) | ||
// Seed Ids need to be Lowecase as p2p/transport.go:MultiplexTransport.upgrade() | ||
// uses a case sensitive string comparision to validate public keys | ||
// uses a case sensitive string comparision to validate public keys. | ||
// Since Seeds is expected to be in comma-delimited id@host:port format, | ||
// lowercasing the whole string is ok. | ||
tenderConfig.P2P.Seeds = strings.ToLower(viper.GetString(CfgP2PSeeds)) |
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.
I there there were some plans in making CfgP2PSeeds
a string slice (on our end) instead of comma-delimited list, maybe a good time to change it
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.
Done.
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.
I've also decided to make a breaking configuration change here and renamed tendermint.seeds
configuraiton flag to tendermint.seed
to be consistent with newly added tendermint.*peer
options.
@ptrus, please take a look.
8d3fd26
to
5fe3359
Compare
580a6ed
to
96124b9
Compare
459578f
to
7d04d1d
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.
This looks good to me, just fix the ctx
and then it's good to merge!
Support passing multiple consensus addresses via cfgConsensusAddress.
0c11c6d
to
b6a62c5
Compare
When registering a validator, query sentry nodes for their consensus address(es) if sentry nodes are configured.
Rename tendermint.seeds configuraiton flag to tendermint.seed to be consistent with tendermint.*peer options. Change the configuration flag to accept a string slice on our side to make the seed node configuration easier.
b6a62c5
to
a8b2c2e
Compare
No description provided.