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

WIP multisign cli command #6185

Closed
wants to merge 1 commit into from
Closed

WIP multisign cli command #6185

wants to merge 1 commit into from

Conversation

jaekwon
Copy link
Contributor

@jaekwon jaekwon commented May 11, 2020

We need a way to sign multiple transactions at once, as we will be signing a lot of transactions.

This should run on cosmoshub-3 so release/v0.37.4 may not be appropriate, but I'm not sure.
We may need to back-port this to v0.37.4. I meant to do so but made a mistake during git checkout.

In other words, this is a temporary draft PR while we discuss what to do going forward.

@auto-comment
Copy link

auto-comment bot commented May 11, 2020

👋 Thanks for creating a PR!

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Thank you for your contribution to the Cosmos-SDK! 🚀

@@ -37,6 +37,8 @@ const (
flagKeyAlgo = "algo"

// DefaultKeyPass contains the default key password for genesis transactions
// XXX What is this?!
// It's being used for the signing cli!
Copy link
Contributor

Choose a reason for hiding this comment

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

It's no longer used. With the new keyring passwords are handled outside of the SDK

@@ -352,6 +352,7 @@ func PrepareFactory(ctx context.CLIContext, txf Factory) (Factory, error) {
//
// Note, It is assumed the Factory has the necessary fields set that are required
// by the CanonicalSignBytes call.
// XXX The passphrase isn't even being used...
Copy link
Contributor

Choose a reason for hiding this comment

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

That's correct, see my previous comment


Read signature(s) from [signature] file(s), generate a multisig signature compliant to the
multisig key [name], and attach it to the transaction read from [file].
func GetMultiSignCommand(codec *codec.Codec) *cobra.Command {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should call this command something different. multisign exists already and is used to build a mulsig signature from multiple signatures

Copy link
Member

Choose a reason for hiding this comment

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

What if we called it batch-sign or sign-batch?

Copy link
Contributor

Choose a reason for hiding this comment

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

I second sign-batch.

@aaronc aaronc added the WIP label May 11, 2020
@@ -332,6 +332,7 @@ func (ctx CLIContext) PrintOutput(toPrint interface{}) error {
// GetFromFields returns a from account address and Keybase name given either
// an address or key name. If genOnly is true, only a valid Bech32 cosmos
// address is returned.
// XXX What does genOnly mean? Why is it called that?
Copy link
Contributor

Choose a reason for hiding this comment

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

genOnly == GenerateOnly. The godoc states its use. I'd advise against adding a XXX and actually creating an issue to revise the API.


Read signature(s) from [signature] file(s), generate a multisig signature compliant to the
multisig key [name], and attach it to the transaction read from [file].
func GetMultiSignCommand(codec *codec.Codec) *cobra.Command {
Copy link
Contributor

Choose a reason for hiding this comment

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

I second sign-batch.

@alessio
Copy link
Contributor

alessio commented May 11, 2020

sign-batch is brief and self-explanatory. +1 from me

return parseStdSignDocs(string(body))
}

func parseStdSignDocs(lines string) (docs []types.StdSignDoc) {
Copy link
Contributor

@alessio alessio May 13, 2020

Choose a reason for hiding this comment

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

--generate-only generates StdTxs. This command seems to be expecting types.StdSignDocs as input instead.
I'm not sure it would work (unless we amend --generate-only's behaviour)

@jgimeno jgimeno mentioned this pull request May 19, 2020
8 tasks
@jgimeno
Copy link
Contributor

jgimeno commented Jun 9, 2020

#6350 closes this

@jgimeno jgimeno closed this Jun 9, 2020
@alessio alessio deleted the jae/multisign branch March 14, 2021 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants