-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
R4R: Multisig support #3264
R4R: Multisig support #3264
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3264 +/- ##
===========================================
- Coverage 55.64% 55.52% -0.13%
===========================================
Files 134 134
Lines 9746 9764 +18
===========================================
- Hits 5423 5421 -2
- Misses 3980 3999 +19
- Partials 343 344 +1 |
15ec441
to
7d50367
Compare
Blocked on tendermint/tendermint#3101 |
I would recommend we use |
Blocked on #3279 |
ff43ede
to
b498016
Compare
1ba51e3
to
99f11c0
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.
Workflow looks reasonable to me, several comments.
@@ -28,7 +29,15 @@ func AddGenesisAccountCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command | |||
|
|||
addr, err := sdk.AccAddressFromBech32(args[0]) | |||
if err != nil { | |||
return err | |||
kb, err := keys.GetKeyBaseFromDir(viper.GetString(flagClientHome)) |
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.
OK, this is convenient - I wonder if we should just support named aliases, but that can be a later question...
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.
Yes, I'm doing it just for convenience. But I wouldn't frown upon a change request and I reckon this could we be seen as superfluous.
docs/gaia/gaiacli.md
Outdated
gaiacli keys add --multisig=baz,foo,bar --multisig-threshold=2 multisigaddress | ||
``` | ||
|
||
Although keys and threshold parameter used in the above examples are the same, the commands |
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.
Can we sort the names? This behaviour seems unusual, unless there's a specific reason we want 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.
... actually, can we sort by the public keys? that way different names on different machines will still work
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 sounds like a good idea. Ideally order doesn't matter here.
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 I second this. I can see simple mishaps happening due to this.
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.
Sorted - sorry for the pun.
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 added the flag --nosort
so that a user can pass the keys in the exact order he wants and expect they don't get shuffled.
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.
A couple of small comments 👆 but otherwise this is 💯 🎉 and should be merged.
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.
Looks good @alessio -- I left some feedback.
docs/gaia/gaiacli.md
Outdated
gaiacli keys add --multisig=baz,foo,bar --multisig-threshold=2 multisigaddress | ||
``` | ||
|
||
Although keys and threshold parameter used in the above examples are the same, the commands |
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 I second this. I can see simple mishaps happening due to this.
A couple of test failures here @alessio |
Few more comments @alessio, also |
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.
👍 👍 minor comments. Also we'll need to support multisig through gaia lite (maybe other PR)
e6c44da
to
1b94623
Compare
client/keys/add.go
Outdated
|
||
// Handle --nosort | ||
if !viper.GetBool(flagNoSort) { | ||
sort.Strings(multisigKeys) |
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 wonder if we should instead sort by the keys - that way different aliases on different computers will still result in the same public key.
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 second this.
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.
client/keys/add.go
Outdated
|
||
// Handle --nosort | ||
if !viper.GetBool(flagNoSort) { | ||
sort.Strings(multisigKeys) |
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 second this.
- New keys add --multisig flag to store multisig keys locally. - New multisign command to generate multisig signatures. - New sign --multisig flag to enable multisig mode. - Add multisig transactions support in ante handler. - gaiad add-genesis-account can now take both account addresses and key names. Closes: #3198
1b94623
to
0022513
Compare
Habemus multisig:
keys add --multisig
flag to store multisig keys locally.multisign
command to generate multisig signatures.sign --multisig
flag to enable multisig mode.gaiad add-genesis-account
can now take both account addresses and key namesCloses: #3198
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: