Finschia / finschia-sdk

A framework for building blockchains based Finschia Mainnet that is forked from cosmos-sdk
Apache License 2.0
61 stars 31 forks source link

fix: prevent signing from wrong key in multisig #1319

Closed ulbqb closed 8 months ago

ulbqb commented 8 months ago

Description

closes: #XXXX

When signing an multisig tx, you are required to provide the multisig address (--multisig) and the key you are signing with (--from), but there's no check that the key is actually part of the multisig. This makes it very easy to accidentally sign with the wrong key and only figure it out when you try to broadcast the invalid tx that includes a signature from a key thats not in the multisig.

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 28.12500% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 70.39%. Comparing base (e62a330) to head (f53aba1).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1319/graphs/tree.svg?width=650&height=150&src=pr&token=m16qfzIPO7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1319?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) ```diff @@ Coverage Diff @@ ## main #1319 +/- ## ========================================== - Coverage 70.41% 70.39% -0.03% ========================================== Files 643 643 Lines 54752 54779 +27 ========================================== + Hits 38556 38564 +8 - Misses 14021 14040 +19 Partials 2175 2175 ``` | [Files](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1319?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) | Coverage Δ | | |---|---|---| | [x/auth/client/testutil/suite.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1319?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-eC9hdXRoL2NsaWVudC90ZXN0dXRpbC9zdWl0ZS5nbw==) | `96.54% <100.00%> (+0.02%)` | :arrow_up: | | [x/auth/client/cli/tx\_multisign.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1319?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-eC9hdXRoL2NsaWVudC9jbGkvdHhfbXVsdGlzaWduLmdv) | `0.00% <0.00%> (ø)` | | | [x/auth/client/cli/tx\_sign.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1319?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-eC9hdXRoL2NsaWVudC9jbGkvdHhfc2lnbi5nbw==) | `0.00% <0.00%> (ø)` | |