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 #4120

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

grarco
Copy link
Collaborator

@grarco grarco commented Nov 29, 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:

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

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

Project coverage is 74.58%. Comparing base (9f817f0) to head (25c2564).
Report is 56 commits behind head on main.

Files with missing lines Patch % Lines
crates/sdk/src/tx.rs 28.57% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4120   +/-   ##
=======================================
  Coverage   74.58%   74.58%           
=======================================
  Files         341      341           
  Lines      107491   107502   +11     
=======================================
+ Hits        80171    80184   +13     
+ Misses      27320    27318    -2     

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

@grarco grarco marked this pull request as ready for review November 29, 2024 17:22
@grarco grarco changed the title Fix offline wrapper sig Fix offline wrapper signature by elsewho Dec 1, 2024
@tzemanovic tzemanovic added backport-libs-0.47 Backport libraries to 0.47 maintenance branch backport-1.1 Backport apps to 1.1 maintenance branch and removed backport-1.1 Backport apps to 1.1 maintenance branch labels Dec 2, 2024
@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 bot added a commit that referenced this pull request Dec 3, 2024
@mergify mergify bot merged commit f027584 into main Dec 3, 2024
23 of 24 checks passed
@mergify mergify bot deleted the grarco/fix-offline-wrapper-sig branch December 3, 2024 10:01
mergify bot pushed a commit that referenced this pull request Dec 3, 2024
(cherry picked from commit 2d64081)

# Conflicts:
#	.changelog/libs-v0.46.1/bug-fixes/4120-fix-offline-wrapper-sig.md
tzemanovic pushed a commit that referenced this pull request Dec 3, 2024
(cherry picked from commit 2d64081)
mergify bot added a commit that referenced this pull request Dec 3, 2024
Fix offline wrapper signature by elsewho (backport #4120)
tzemanovic added a commit that referenced this pull request Dec 11, 2024
* tomas/ci/test-ledger-app:
  ci/test-ledger-app: specify container image
  Point to Ledger app patched to fix decimal point and internal address issue.
  Format timestamps so that they exactly match hardware wallet outputs.
  ci: minors
  Minor simplifications.
  Added changelog entry.
  Make the CI run the generated test vectors through the Ledger app unit tests.
  fix readme links
  Added a changelog entry.
  Change the Hermes branch used by the CI.
  Refactors attaching signatures on wrapper dump
  ci: run on maint-libs PRs
  mergify: add apps backport rules, add prefix for libs
  Hide modified ZIP 32 behind a CLI flag.
  Downgraded the ledger-namada-rs branch. Now print error messages when MASP hardware wallet integration functionality is triggered.
  Test that the transfer source now displays as a viewing key.
  Make the the software wallet support the old Store format.
  Adjust integration tests to work with both hardware and localnet genesis files.
  update for mainnet release
  Namada 1.0.0
  clear changelogs released in libs-v0.46.1
  changelog: add #4123
  Changelog #4120
  Removes duplicated `sign-tx` command
  Adds tests for offline wrapper signature
  Fixes offline wrapper signature
  changelog: add #4117
  exclude apps crate from libs release
  apps: don't use workspace version anymore
  add a script to release apps bins
  prefix libs release tag with "libs-"
  mv scripts/release.sh scripts/release_libs.sh
  add different commit msg for libs release
  add a different release config for apps
  Changelog
  Add a single CometBFT dummy validator
  Make shielded balance checking more robust for IBC tests.
  Sometimes use literals instead of aliases in the IBC tests.
  test/e2e/masp: add support for testing with HW wallet
  Always sign MASP Transactions before dumping because randomness parameters cannot be reused. Fixed MASP integration tests depending on access to secret keys.
  fix proposal type
  Dont do a dry run if using a device in the MASP integration tests.
  Moved the shielded keys used in the integration tests into the localnet wallet.
  Never use the hardware wallet to sign the fee header alone. Always ensure removal of MASP Builder data.
  Separate the storage of shielded keys from their birthdays.
  Expand MASP hardware wallet support to other transaction types.
  Factored out the logic for MASP hardware wallet signing.
  Implemented MASP signing using the hardware wallet.
  mergify: move autosquash to queue_rules
  Adds debug trace for masp epochs in asset types
  Revert "ci(mergify): upgrade configuration to current format"
  Error match for shielding retry logic
  Fix `gen_localnet.py` json exception
  Improves implicit vp display
  Changelog #4083
  Adds missing protocol params in logs
  Log the implicit vp in `query-protocol-parameters`
  mergify: backport 0.46
  Changelog #4071
  Refactors shielding retry logic
  Shielding retry logic only when masp vp rejects
  Fix typos in README.md
@grarco grarco mentioned this pull request Jan 14, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-libs-0.47 Backport libraries to 0.47 maintenance branch breaking:cli breaking:client 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