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

Cleanup up Multisig naming #2255

Merged
merged 6 commits into from
Aug 28, 2018
Merged

Cleanup up Multisig naming #2255

merged 6 commits into from
Aug 28, 2018

Conversation

ebuchman
Copy link
Contributor

This is follow up from #2163.

This PR standardizes the naming used in the multisig package and adds the multisig pubkey to the crypto/encoding/amino codec.

It also moves the compact bit array into it's own package.

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

@codecov-io
Copy link

codecov-io commented Aug 21, 2018

Codecov Report

Merging #2255 into develop will decrease coverage by 1.77%.
The diff coverage is 81.81%.

@@             Coverage Diff             @@
##           develop    #2255      +/-   ##
===========================================
- Coverage    62.42%   60.64%   -1.78%     
===========================================
  Files          215      196      -19     
  Lines        17664    16239    -1425     
===========================================
- Hits         11026     9848    -1178     
+ Misses        5726     5535     -191     
+ Partials       912      856      -56
Impacted Files Coverage Δ
crypto/multisig/bitarray/compact_bit_array.go 77.77% <ø> (ø)
crypto/encoding/amino/amino.go 85.71% <100%> (+1.5%) ⬆️
crypto/multisig/multisignature.go 77.77% <100%> (ø) ⬆️
crypto/multisig/wire.go 100% <100%> (ø) ⬆️
crypto/multisig/threshold_pubkey.go 58.97% <66.66%> (ø)
libs/autofile/autofile.go 69.23% <0%> (-6.16%) ⬇️
privval/socket.go 71.83% <0%> (-0.46%) ⬇️
p2p/conn/connection.go 79.43% <0%> (-0.29%) ⬇️
consensus/reactor.go 73.55% <0%> (ø) ⬆️
p2p/peer.go 57.95% <0%> (ø) ⬆️
... and 33 more

@@ -10,15 +10,15 @@ import (
// TODO: Figure out API for others to either add their own pubkey types, or
// to make verify / marshal accept a cdc.
const (
ThresholdPubkeyAminoRoute = "tendermint/PubkeyMultisigThreshold"
PubKeyMultisigThresholdAminoRoute = "tendermint/PubKeyMultisigThreshold"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we omit the multisig from the varname since it's in the package? Also should we omit the pubkey from the var name since there's no privkey

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 to both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmmm .... I was hoping to reach parity between the var name and the Amino route. We can't remove Multisig from the amino route because there's no pkg information there, it needs to be the full tendermint/PubKeyMultisigThreshold.

We could consider removing Multisig from the var name, but I think we should keep PubKey for consistency/clarity

@xla xla added the C:crypto Component: Crypto label Aug 22, 2018
@xla xla added this to Ongoing in current iteration via automation Aug 22, 2018
@xla xla added this to the launch milestone Aug 22, 2018
current iteration automation moved this from Ongoing to Reviewed Aug 22, 2018
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

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

👍 :octocat: :shipit: 🍡

Small nit, for the ba import.

@@ -4,20 +4,21 @@ import (
"errors"

"github.com/tendermint/tendermint/crypto"
bA "github.com/tendermint/tendermint/crypto/multisig/bitarray"
Copy link
Contributor

Choose a reason for hiding this comment

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

This alias does more harm than good, obscuring what is imported here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok!

@@ -10,15 +10,15 @@ import (
// TODO: Figure out API for others to either add their own pubkey types, or
// to make verify / marshal accept a cdc.
const (
ThresholdPubkeyAminoRoute = "tendermint/PubkeyMultisigThreshold"
PubKeyMultisigThresholdAminoRoute = "tendermint/PubKeyMultisigThreshold"
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 to both.

Copy link
Contributor

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! I agree with xla's comment about the bA import

@melekes melekes added the T:breaking Type: Breaking Change label Aug 27, 2018
@melekes melekes merged commit 38b4016 into develop Aug 28, 2018
current iteration automation moved this from Reviewed to Done Aug 28, 2018
@melekes melekes deleted the bucky/multisig branch August 28, 2018 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:crypto Component: Crypto T:breaking Type: Breaking Change
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants