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

[Ledger] Enhance Ledger Class #2228

Open
lllwvlvwlll opened this issue Sep 4, 2021 · 4 comments
Open

[Ledger] Enhance Ledger Class #2228

lllwvlvwlll opened this issue Sep 4, 2021 · 4 comments
Labels
enhancement High An issue above regular priority

Comments

@lllwvlvwlll
Copy link
Member

This enhancement reimplements the feature for fetching additional keys from a ledger device, which was disabled as part of #2219 .
Currently, the authentication interface for ledger is extremely functional, hammering the connection open/close on every request. This introduces an issue when trying to resolve multiple events at once (like checking ledger status and requesting additional keys).

The proposed implementation path for this feature is a minor rearchitecture of the ledger classes and their relationship with the
LoginLedgerNanoS component to allow a persistent connection which handles interfacing needs. This should also significantly improve application performance when on the component is active since it reduces the overhead of negotiating the interface for every request.

The proposed enhancement would not impact the signing features of the application.

@lllwvlvwlll lllwvlvwlll added enhancement High An issue above regular priority labels Sep 4, 2021
@ixje
Copy link
Member

ixje commented Sep 5, 2021

Is the connection negotiation really that slow? I always had the feeling it was the actual public key grabbing on the device. I will actually test it.

fyi; I like the idea of redesigning the ledger classes. I kind of went with the "fastest way" a.k.a copy the NEO2 stuff and adjust since the component and actions felt so tightly coupled.

@lllwvlvwlll
Copy link
Member Author

The performance enhancement is a secondary benefit to the preventing of overlapping serial connections.

The bus isn't locked(I suspect) so a "close" from a parallel request is killing the connection before the public keys return. This also occurs inversely where the public key requests are getting getDeviceInfo and getAppName which is being communicated on the interface.

I do think there is a significant overhead from negotiating a connection and closing before each message, but its purely based on experience in other system. I don't know how substantial it will be.

@ixje
Copy link
Member

ixje commented Sep 6, 2021

I did some testing with the Python lib but should be reflective for JS

  • Acquiring USB conn - 00:079 seconds
  • Acquiring 1 public key - 01:238 seconds

@lllwvlvwlll lllwvlvwlll added this to the Orpheus milestone Sep 6, 2021
@lllwvlvwlll lllwvlvwlll changed the title [Ledger] Fetch Multiple Keys [Ledger] Enhance Ledger Class Sep 7, 2021
@lllwvlvwlll
Copy link
Member Author

Renaming this issue to be an enhancement which can be handled after N3 Ledger integration since the Fetch Multiple Keys defect was mitigated using a different approach.

@lllwvlvwlll lllwvlvwlll removed this from the Orpheus milestone Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement High An issue above regular priority
Projects
None yet
Development

No branches or pull requests

2 participants