Skip to content

plugins: keepkey: vendor keepkeylib#9581

Closed
SomberNight wants to merge 8 commits intospesmilo:masterfrom
SomberNight:202502_keepkey
Closed

plugins: keepkey: vendor keepkeylib#9581
SomberNight wants to merge 8 commits intospesmilo:masterfrom
SomberNight:202502_keepkey

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

@SomberNight
Copy link
Member Author

closed in favour of #9650

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