Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Optional peer ID verification #219

Merged
merged 1 commit into from
Mar 13, 2019
Merged

Optional peer ID verification #219

merged 1 commit into from
Mar 13, 2019

Conversation

tarcieri
Copy link
Contributor

Adds a (presently optional) peer ID to tcp:/// validator addresses allowing the remote peer ID to be specified.

Presently warns if this is unconfigured, or verifies it if it is configured.

See: #111

Adds a (presently optional) peer ID to `tcp:///` validator addresses
allowing the remote peer ID to be specified.

Presently warns if this is unconfigured, or verifies it if it is
configured.

See: #111
@tarcieri tarcieri requested review from zmanian and liamsi March 13, 2019 17:42
@tarcieri
Copy link
Contributor Author

This is the last thing I wanted to get into a final v0.5.0 release. I will test it on gaia-13k before shipping.

/// Secret Connection signing keys
// TODO(tarcieri): unify with `TendermintKey`?
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
pub enum SecretConnectionKey {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved and renamed this to tendermint::secret_connection::PublicKey. This seems better with secret_connection as (presently) an optional cargo feature, however I just noticed we don't test tendermint-rs with --no-default-features

Copy link
Contributor

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

I did not test this but the changes look good to me. Thanks a lot Tony!

@tarcieri tarcieri merged commit 1acf987 into master Mar 13, 2019
@tarcieri tarcieri deleted the peer-id-verification branch March 13, 2019 18:39
@@ -7,7 +7,8 @@ GENESIS_FILE=${GENESIS_FILE:-${TMHOME}/config/genesis.json}
SIGNING_KEY=${SIGNING_KEY:-${OUTPUT_PATH}/signing.key}
SECRET_KEY=${SECRET_KEY:-${OUTPUT_PATH}/secret_connection.key}
OUTPUT_FILE=${OUTPUT_FILE:-${OUTPUT_PATH}/tmkms.toml}
VALIDATOR_ADDR=${VALIDATOR_ADDR:-"tcp://127.0.0.1:61278"}
VALIDATOR_ID=${VALIDATOR_ID:-"f88883b673fc69d7869cab098de3bafc2ff76eb8"}
VALIDATOR_ADDR=${VALIDATOR_ADDR:-"tcp://f88883b673fc69d7869cab098de3bafc2ff76eb8@127.0.0.1:61278"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will need to (re)configure these whenever #207 happens

This was referenced Mar 13, 2019
@tarcieri
Copy link
Contributor Author

@liamsi so I tested this out in production and it seems to be working, however it seems the Secret Connection key associated with gaiad's priv_validator_laddr is randomly generated each time it starts? It is static so long as gaiad is running, but changes the next time you start it.

I can open an issue about this, but I'm not sure if it's a cosmos/cosmos-sdk or tendermint/tendermint issue offhand...

/cc @zmanian

@liamsi
Copy link
Contributor

liamsi commented Mar 14, 2019

Yes, you are right: we currently always regenerate the key instead of persisting it:
https://github.com/tendermint/tendermint/blob/745713330736c5c751450245d88b8037cbee3aa6/node/node.go#L915-L918

@liamsi
Copy link
Contributor

liamsi commented Mar 14, 2019

It's a tendermint issue: tendermint/tendermint#3105

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants