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

plugins: keepkey: vendor keepkeylib #9581

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

SomberNight
Copy link
Member

@SomberNight SomberNight commented Feb 24, 2025

This adds keepkeylib into our git tree. We will vendor it that way from now, instead of declaring it as an external dependency.

Upstream keepkeylib is effectively unmaintained -- but the only problem with it is that it requires an old version of protobuf. (see keepkey/python-keepkey#146)
By vendoring it, we can fix that ourselves.

keepkeylib is taken from PyPI, at keepkey==6.3.1, which is the version we have sha256 pinned for 5 years.

This also vendors the corresponding source protobuf files, which were not part of the keepkeylib sdist. Those are taken from the git repo, at the corresponding commit (for v6.3.1).

Subsequent commits

  • strip out some of the shitcoin crap from keepkeylib, though only the parts that were easy to remove
  • regenerate the pb2 files using protoc-21.12 (which is the version currently in debian stable, already much newer than what was previously used)

closes #7922

This is from PyPI, keepkey==6.3.1 [0] with sha256 hash `cef1e862e195ece3e42640a0f57d15a63086fd1dedc8b5ddfcbc9c2657f0bb1e`,
which is the hash we've had pinned in contrib/deterministic-build/requirements-hw.txt for 5 years.

[0]: https://files.pythonhosted.org/packages/30/38/558d9a2dd1fd74f50ff4587b4054496ffb69e21ab1138eb448f3e8e2f4a7/keepkey-6.3.1.tar.gz

related spesmilo#7922
and keepkey/python-keepkey#146
(i.e. upstream keepkeylib is unmaintained)
```
$ mkdir -p /opt/protoc && \
  curl -L0 https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -o /tmp/protoc-21.12-linux-x86_64.zip && \
  unzip /tmp/protoc-21.12-linux-x86_64.zip -d /opt/protoc
$ PATH="/opt/protoc/bin:$PATH"
$ ~/wspace/electrum/electrum/plugins/keepkey/device-protocol/build_pb.sh
```
now that the keepkey pb2's are regenerated using the "new" format,
we don't need an old python3-protobuf to parse them

ref spesmilo#7922
@SomberNight
Copy link
Member Author

note: we could alternatively make this a git submodule,

or we could also just rm the keepkey support.

@SomberNight SomberNight marked this pull request as draft February 28, 2025 18:08
@SomberNight
Copy link
Member Author

Upstream keepkeylib is effectively unmaintained

Hmm, looks like there is actually some recent work in branches:
https://github.com/keepkey/python-keepkey/tree/btc-only
https://github.com/keepkey/python-keepkey/tree/feature-p2tr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

protobuf breaking changes between 3.20.x and 4.21 (4.x)
1 participant