-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Upgrade trezorlib to 0.20
#10465
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
base: master
Are you sure you want to change the base?
Upgrade trezorlib to 0.20
#10465
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import sys, tempfile, subprocess | ||
| from pathlib import Path | ||
| from importlib.metadata import distribution | ||
|
|
||
|
|
||
| PYPROJECT_TOML = """ | ||
| [project] | ||
| name = "{name}" | ||
| version = "{version}" | ||
| description = "Ghost package to satisfy dependencies" | ||
| """ | ||
|
|
||
|
|
||
| def install_ghost(name: str, version: str) -> None: | ||
| with tempfile.TemporaryDirectory() as tmpdir: | ||
| pyproject_toml = PYPROJECT_TOML.format(name=name, version=version) | ||
| (Path(tmpdir) / "pyproject.toml").write_text(pyproject_toml) | ||
| subprocess.check_call([sys.executable, "-m", "pip", "install", tmpdir]) | ||
|
|
||
| dist = distribution(name) | ||
| for file in dist.files: | ||
| path = file.locate() | ||
| if path.name == "direct_url.json": | ||
| path.unlink() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| if len(sys.argv) != 2: | ||
| print("Usage: python install_ghost.py <package name>==<package version>") | ||
| sys.exit(1) | ||
| name, version = sys.argv[1].split("==") | ||
| install_ghost(name, version) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| click==8.3.1 | ||
| construct==2.10.70 | ||
| construct-classes==0.2.2 | ||
| platformdirs==4.9.4 | ||
| keyring==25.7.0 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,10 +33,12 @@ | |||||||||||||||||||||||||
| InputScriptType, OutputScriptType, MultisigRedeemScriptType, | ||||||||||||||||||||||||||
| TxInputType, TxOutputType, TxOutputBinType, TransactionType, AmountUnit) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| from trezorlib.client import PASSPHRASE_ON_DEVICE | ||||||||||||||||||||||||||
| from trezorlib.client import PassphraseSetting | ||||||||||||||||||||||||||
| import trezorlib.log | ||||||||||||||||||||||||||
| #trezorlib.log.enable_debug_output() | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| PASSPHRASE_ON_DEVICE = PassphraseSetting.ON_DEVICE | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| TREZORLIB = True | ||||||||||||||||||||||||||
| except Exception as e: | ||||||||||||||||||||||||||
| if not (isinstance(e, ModuleNotFoundError) and e.name == 'trezorlib'): | ||||||||||||||||||||||||||
|
|
@@ -153,8 +155,8 @@ class TrezorPlugin(HW_PluginBase): | |||||||||||||||||||||||||
| libraries_URL = 'https://pypi.org/project/trezor/' | ||||||||||||||||||||||||||
| minimum_firmware = (1, 5, 2) | ||||||||||||||||||||||||||
| keystore_class = TrezorKeyStore | ||||||||||||||||||||||||||
| minimum_library = (0, 13, 0) | ||||||||||||||||||||||||||
| maximum_library = (0, 14) | ||||||||||||||||||||||||||
| minimum_library = (0, 20, 0) | ||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please see SomberNight@f8226f9 and cherry-pick that or add something similar manually I built an appimage and found that the plugin is broken at runtime due to the change to We atm have a whitelist for which packages get .dist-info/ included and trezor needs to be put on that list now. The issue in general with the .dist-info metadata stuff is that the RECORD file is often not reproducible, making the whole build not deterministic (see c52a29f). Usually it is due to packages building electrum/contrib/build-linux/appimage/make_appimage.sh Lines 196 to 207 in 3695e00
but I just built two appimages and trezorlib's RECORD file is reproducible, so it can get whitelisted. |
||||||||||||||||||||||||||
| maximum_library = (0, 21) | ||||||||||||||||||||||||||
| SUPPORTED_XTYPES = ('standard', 'p2wpkh-p2sh', 'p2wpkh', 'p2wsh-p2sh', 'p2wsh') | ||||||||||||||||||||||||||
| DEVICE_IDS = (TREZOR_PRODUCT_KEY,) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
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.
I have tested this on a T1 with fw 1.12.1 and with a model T with fw 2.6.4. Worked ok.
I expect you tested cutting edge fw, so no point for me to repeat that.
I also have another T1 with fw 1.8.3. That device works with electrum master and trezorlib 0.13.x, but not with this branch and new trezorlib.
This is what I get in the Electrum Wizard when trying to create a wallet with that trezor model one:
I did not investigate the root cause. I guess if you think that's the best way to handle, we could just bump
minimum_firmware. but you need to investigate at least to the degree that you know which version to bump to. :)OTOH note that some people with geo-distributed cold multisigs likely won't be happy if we bump the minimum. Up to you.
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! Will take a look tomorrow.
Uh oh!
There was an error while loading. Please reload this page.
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.
trezor/trezor-firmware#6580 should support old FWs.