-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: PrivKeyLedgerSecp256k1: lost connection #3431
Conversation
Hey @jleni can you also link to a PR to |
Yes, the conflict appeared once another PR was merged last night. No worries, the PR is still WIP. @jackzampolin I have now included a longer technical explanation for all the changes that were made with links to each respective layer and PR. |
Codecov Report
@@ Coverage Diff @@
## develop #3431 +/- ##
===========================================
+ Coverage 52.97% 59.21% +6.23%
===========================================
Files 142 134 -8
Lines 10363 9940 -423
===========================================
+ Hits 5490 5886 +396
+ Misses 4550 3680 -870
- Partials 323 374 +51 |
As discussed with @cwgoes @jackzampolin I have noticed something that may result in problems. At the moment, when a key is requested to a ledger device, a PrivKeyLedgerSecp256k1 object keeps the device together with the keys. However, this object is actually a USB resource that is never released. At the moment, there are a few problems in gaia and still in this PR:
We agreed on refactoring gaia's code, so resources are released ASAP and pks are rechecked before signing. As PKs are checked, it should be possible to detect if devices are swapped or there are multiple devices and the incorrect one is re-discovered. |
In addition to these changes, I have noticed that we have a mix of DER vs BER signatures. I will try to unify this a bit too to avoid confusion. |
This PR just updated dependancies. |
True, for now the changes are in other layers as described above. |
@jleni Looking forward to unit testing for this really crucial usecase. Thank you for adding them! |
@jackzampolin Given that these fixes have uncovered an existing incompatibility between DER and BER signatures, I would suggest considering this PR for prelaunch: without these changes, signatures will be invalid. |
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.
Thanks @jleni! I left a few remarks 👍
removing case mismatches in dependencies
Co-Authored-By: jleni <juan.leni@zondax.ch>
It seems an unrelated issue hit integration_tests here:
Should I open another issue for that? I can try rerunning but there is a panic to analyse there anyway. |
Here is the link to the CI error: |
Running integration_tests again and they passed. There is definitely a sporadic unrelated issue in integration_tests that needs to be looked at. |
@jackzampolin @alessio Fixed a conflict in Pending.md. |
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.
Very good indeed. Nihil obstat from me. @cwgoes fancy taking a look at this?
@jackzampolin @alessio This PR and #3461 have changes in similar areas. Whichever you merge first will result in changes on the other side. |
Yes, thanks! I will adjust this in the next hour |
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.
Thank you @jleni! LGTM
This PR solves issue #3335
This PR upgrades
ledger-cosmos-go
and brings the following improvements:make test_ledger
Technical description
This upgrade also results in multiple changes/fixes in several dependencies:
HID https://github.com/ZondaX/hid
There were some issues in OSX in the other hid wrapper that were affecting gaia.
Incorrect number of written bytes karalabe/hid#16
Zondax/hid@302fd40
Ledger-go https://github.com/ZondaX/ledger-go
Ledger-cosmos-go https://github.com/ZondaX/ledger-cosmos-go
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: