Flakiness connecting to Ledger on Mac OS due to multiple HID devices
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- embedded-iot
Research direction
Start at ledgerblue/comm.py around line 357 and inspect how HID devices from hid.enumerate() are filtered, especially usage_page values 65440 and 61904. Reproduce the connection attempt on Mac OS with the Ethereum app open, then verify that the intended Ledger device is selected consistently and the flaky connection no longer occurs.
Written by the indexing model from the issue text.
Description
We have observed a lot of flakiness with connecting to the Ledger on Mac OS, specifically in this code from the ledgereth library which bottoms out here in ledgerblue.
We found that when the Ethereum app is opened on the Ledger device, another HID entry shows up on the Mac. It is identical to the original HID entry except that usage_page is 61904 instead of 65440. The order of hid.enumerate() is not deterministic, so sometimes you get the original, good device, and sometimes you get the second, bad device. Hence the flakiness.
I'm not knowledgeable about the HID spec but I was wondering if changing the or condition in this line to an and condition would be appropriate. It would fix our problem at least because it would enforce that the device has a usage page of 65440, which would exclude the second, bad device.
- Dominant language
- Python
- Stars
- 125
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LedgerHQ/blue-loader-python
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
LedgerHQ/blue-loader-python#130 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
LedgerHQ/blue-loader-python#98 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
LedgerHQ/blue-loader-python#96 · 4 comments · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
LedgerHQ/blue-loader-python#83 · 1 comment ·
-
installation hintsOpen
Difficulty 1/5 Under an hour Newbie friendliness 55/100
LedgerHQ/blue-loader-python#76 · 1 reaction ·
All issues in LedgerHQ/blue-loader-python
Similar issues
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conan-io/conan-center-index#31098 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
john-kurkowski/tldextract#382 ·
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NousResearch/hermes-agent#132042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepset-ai/haystack#13092 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
feder-cr/invisible_playwright_mcp#1408 ·
Maintainers usually reply within 1 day