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

Fix offline wrapper signature by elsewho (backport #4120) #4137

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Dec 3, 2024

Describe your changes

Fixes offline wrapper signatures and adds two new tests for this. The bug was only affecting offline wrapper signing when the signer did not own the keys to also sign the inner transaction:

  • Once the inner tx had been dumped and signed offline the user had to reload the tx, wrap it and dump the wrapper
  • At this point they needed to produce the signature for the wrapper offline. To do so, they needed to pass to the offline signing command both the serialized wrapper and the inner signatures (that were not attached to the tx when wrapped), but the command does not accept serialized signatures, just signing keys. So this flow was only possible if the wrapper signer also owned the keys to sign the inner transactions (effectively producing the inner signatures a second time)

The tx command now attaches the raw signatures to the tx when a --dump-wrapper-tx is requested to allow for a different wrapper signer.

The offline sign command and the custom tx one now return errors if a wrapper singer/signature is provided but the tx is not a wrapper.

Also removes a redundant sign-tx client command.

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

This is an automatic backport of pull request #4120 done by [Mergify](https://mergify.com).

Copy link
Contributor Author

mergify bot commented Dec 3, 2024

Cherry-pick of 2d64081 has failed:

On branch mergify/bp/maint-libs-0.46/pr-4120
Your branch is ahead of 'origin/maint-libs-0.46' by 3 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 2d640816b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	added by them:   .changelog/libs-v0.46.1/bug-fixes/4120-fix-offline-wrapper-sig.md

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Dec 3, 2024
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.

Project coverage is 74.57%. Comparing base (96d1ec1) to head (dcf3762).
Report is 6 commits behind head on maint-libs-0.46.

Files with missing lines Patch % Lines
crates/sdk/src/tx.rs 28.57% 5 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           maint-libs-0.46    #4137   +/-   ##
================================================
  Coverage            74.56%   74.57%           
================================================
  Files                  341      341           
  Lines               107492   107499    +7     
================================================
+ Hits                 80150    80164   +14     
+ Misses               27342    27335    -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,3 @@
- Fixed a bug that was preventing generating wrapper signatures
Copy link
Member

Choose a reason for hiding this comment

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

this is not right - it's moved it out of the unreleased dir

(cherry picked from commit 2d64081)
@tzemanovic tzemanovic force-pushed the mergify/bp/maint-libs-0.46/pr-4120 branch from 629f969 to dcf3762 Compare December 3, 2024 10:38
@tzemanovic tzemanovic added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Dec 3, 2024
@mergify mergify bot merged commit 8a15225 into maint-libs-0.46 Dec 3, 2024
10 of 11 checks passed
@mergify mergify bot deleted the mergify/bp/maint-libs-0.46/pr-4120 branch December 3, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants