Skip to content
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

go/sentry: simplify tm sentry flags #2560

Merged
merged 3 commits into from
Jan 21, 2020

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Jan 16, 2020

Fixes: #2362

This changes the sentry configuration to:

  • on sentry node:
    • single flag: --tendermint.sentry.upstream_address
  • on upstream node:
    • --worker.registration.sentry.address, --worker.registration.sentry.cert_fiile (for querying addresses at registration time)
    • --tendermint.disable_peer_exchange

One regression to the previous sentry setup is that the upstream node no longer sets "tendermint.persistent_peers" to sentry nodes. I think this is fine, since in any real sentry node setup, the sentry nodes are the only nodes connecting to the upstream node, so not sure if setting persistent peers is/was really needed/useful. Let me know what others think.

Also updated the E2E tests so that nodes behind sentries do not connect to the seed node, since currently the sentry setup was not really properly tested as all nodes got addresses of upstream nodes through the seed node. In future should probably enhance the sentry E2E test further, by blocking all connections to the upstream nodes not originating from sentry nodes.

@ptrus ptrus changed the title go/sentry: simplify tm sentry flags wip: go/sentry: simplify tm sentry flags Jan 16, 2020
@codecov
Copy link

codecov bot commented Jan 16, 2020

Codecov Report

Merging #2560 into master will increase coverage by 0.16%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2560      +/-   ##
==========================================
+ Coverage   63.62%   63.78%   +0.16%     
==========================================
  Files         347      347              
  Lines       32399    32401       +2     
==========================================
+ Hits        20613    20667      +54     
+ Misses       9218     9177      -41     
+ Partials     2568     2557      -11
Impacted Files Coverage Δ
go/worker/common/config.go 71.73% <ø> (+4.59%) ⬆️
go/oasis-node/cmd/node/node.go 56.93% <ø> (-0.11%) ⬇️
go/oasis-test-runner/oasis/args.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/sentry.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/compute.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/validator.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/client.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/keymanager.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/storage.go 0% <0%> (ø) ⬆️
go/worker/sentry/worker.go 82.35% <100%> (+5.56%) ⬆️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 568d426...080a62d. Read the comment docs.

@ptrus ptrus force-pushed the ptrus/feature/simplify-tendermint-sentry branch 3 times, most recently from fc27ef8 to b099140 Compare January 17, 2020 12:12
@ptrus ptrus requested a review from tjanez January 17, 2020 13:22
@ptrus ptrus changed the title wip: go/sentry: simplify tm sentry flags go/sentry: simplify tm sentry flags Jan 17, 2020
@ptrus ptrus force-pushed the ptrus/feature/simplify-tendermint-sentry branch 3 times, most recently from 3fc1db4 to a876333 Compare January 17, 2020 13:29
// CfgP2PPrivatePeerID configures tendermint's private peer ID(s).
CfgP2PPrivatePeerID = "tendermint.private_peer_id"
// CfgP2PPersistentPeer configures tendermint's persistent peer(s).
CfgP2PPersistentPeer = "tendermint.persistent_peer"
Copy link
Member

@kostko kostko Jan 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, actually having an option to configure persistent peers may still be useful (e.g., on the sentry nodes to establish connections to known good peers).

Copy link
Member Author

@ptrus ptrus Jan 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah added it back, so now i'm also thinking if there's even any benefit in setting private_peer_ids on the sentry node in our case. In tendermint's case it's useful since it prevents others from knowing which nodes are behind a specific sentry. In our case this isn't really true, since this will be visible from the registry.

This would mean that there's no benefit of the (just added) tendermint.sentry.upstream_address flag, since it would do the same as the persistent_peers flag. So in that case i would be in favor of also removing this flag, so the sentry setup configuration would be:

  • on sentry node:
    • set sentry nodes as private_peers
  • on upstream node:
    • worker.registration.sentry.address, worker.registration.sentry.cert_fiile (for querying addresses at registration time) (just renames of the existing flags)
    • tendermint.disable_peer_exchange

^ which seems simple enough

Edit: Actually without the private_peer flag, the sentry will gossip the validator's IPs with others. (those IPs should most likely to be private network IPs, but it might still be better to keep the flag on). The thought about usefulness of tendermint.sentry.upstream_address flag instead of just manually setting the low level tendermint flags correctly remains.

@kostko
Copy link
Member

kostko commented Jan 17, 2020

I think this is fine, since in any real sentry node setup, the sentry nodes are the only nodes connecting to the upstream node, so not sure if setting persistent peers is/was really needed/useful. Let me know what others think.

So one place where persistent peers would IMO be useful is on the sentry nodes in order to ensure connections to some "known-good" nodes are established (if available).

@ptrus
Copy link
Member Author

ptrus commented Jan 17, 2020

So one place where persistent peers would IMO be useful is on the sentry nodes in order to ensure connections to some "known-good" nodes are established (if available).

yeah agreed, i think this is actually used a lot in in cosmos/tendermint (e.g. "relay nodes"). I will leave it in, and make the added sentry flag just append to the persistent peers.

@ptrus ptrus force-pushed the ptrus/feature/simplify-tendermint-sentry branch from a876333 to 158442f Compare January 17, 2020 21:14
@ptrus ptrus requested a review from kostko January 21, 2020 10:06
@kostko kostko added the c:breaking/cfg Category: breaks configuration label Jan 21, 2020
@ptrus ptrus force-pushed the ptrus/feature/simplify-tendermint-sentry branch from 158442f to 080a62d Compare January 21, 2020 11:10
@ptrus
Copy link
Member Author

ptrus commented Jan 21, 2020

thanks for review!

@ptrus ptrus merged commit 962084b into master Jan 21, 2020
@ptrus ptrus deleted the ptrus/feature/simplify-tendermint-sentry branch January 21, 2020 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:breaking/cfg Category: breaks configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify sentry node setup
2 participants