LBRY-Vault/electrum/plugins
SomberNight f36cc5b6e0
trezor: cache whether TrezorBridge is available to speedup scan_devices
If the Bridge is unavailable, on my machine it takes 2 seconds to timeout.
i.e. call_bridge("enumerate") and BridgeTransport.enumerate() both take 2 seconds each.
With this change, if the Bridge is unavailable, DeviceMgr.scan_devices() takes 4 seconds less.
In below log, with 6 different hw devices connected, scan time was originally ~7.5 seconds;
with this change it became ~3.5 seconds.

Now the time is dominated by WebUsbTransport.enumerate(), called by Trezor,
KeepKey, SafeT, ~1.1 seconds each.

-----

I | plugin.DeviceMgr | scan_devices() entered. 1598666278.6756
I | plugin.DeviceMgr | scan_devices(). _scan_devices_with_hid() DONE. 1598666278.7583
I | plugin.DeviceMgr | scan_devices(). starting custom enumeration loop. 1598666278.7593
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method SafeTPlugin.enumerate of <electrum.plugins.safe_t.qt.Plugin object at 0x000001F60060A730>>. 1598666279.9345
I | plugins.trezor.qt.Plugin | trezor custom enumeration entered. 1598666279.9345
I | plugins.trezor.qt.Plugin | trezor custom enumeration. call_bridge('enumerate') DONE. 1598666281.9385
>> trezorlib enumerating <class 'trezorlib.transport.bridge.BridgeTransport'> DONE at 1598666283.9500.
>> trezorlib enumerating <class 'trezorlib.transport.webusb.WebUsbTransport'> DONE at 1598666285.0427.
>> trezorlib enumerating <class 'trezorlib.transport.hid.HidTransport'> DONE at 1598666285.1198.
>> trezorlib enumerating <class 'trezorlib.transport.udp.UdpTransport'> DONE at 1598666285.1237.
I | plugins.trezor.qt.Plugin | trezor custom enumeration. trezorlib.transport.enumerate_devices() DONE. 1598666285.1257
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method TrezorPlugin.enumerate of <electrum.plugins.trezor.qt.Plugin object at 0x000001F60C16F4C0>>. 1598666285.1257
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method KeepKeyPlugin.enumerate of <electrum.plugins.keepkey.qt.Plugin object at 0x000001F60BADF130>>. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method ColdcardPlugin.detect_simulator of <electrum.plugins.coldcard.qt.Plugin object at 0x000001F60BAA5AC0>>. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). custom enumeration loop DONE. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). find out what was disconnected DONE. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). Unpair disconnected devices DONE. 1598666286.2251
2020-08-29 04:22:55 +02:00
..
audio_modem integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
bitbox02 qt wallet>info: use QStackedWidget, one stack item for each keystore 2020-08-28 20:10:58 +02:00
coldcard fix the coldcard multi-sig show address issue 2020-08-18 15:42:39 +08:00
cosigner_pool cosigner pool: use single thread to send messages 2020-06-29 02:19:03 +02:00
digitalbitbox hww hidapi usage: try to mitigate some thread-safety issues 2020-04-17 19:53:39 +02:00
email_requests try fixing email plugin 2020-06-13 19:12:22 +02:00
hw_wallet HW_PluginBase: small clean-up for 'maximum_library' 2020-06-04 18:52:08 +02:00
keepkey hww: fix HardwareClientBase not having reference to plugin 2020-04-17 19:53:35 +02:00
labels plugins: fix labels plugin FIXME re "just enabled plugin" 2020-05-25 17:31:13 +02:00
ledger ledger: speed-up sign_transaction 2020-07-02 12:45:42 +02:00
revealer logging: basics 2019-05-02 15:19:03 +02:00
safe_t hww: fix HardwareClientBase not having reference to plugin 2020-04-17 19:53:35 +02:00
trezor trezor: cache whether TrezorBridge is available to speedup scan_devices 2020-08-29 04:22:55 +02:00
trustedcoin trustedcoin: (trivial) add a stub method in plugin base class 2020-05-29 20:51:52 +02:00
virtualkeyboard no more "import *" 2019-02-11 20:21:24 +01:00
__init__.py file reorganization with top-level module 2018-07-13 14:01:37 +02:00
README file reorganization with top-level module 2018-07-13 14:01:37 +02:00

Plugin rules:

 * The plugin system of Electrum is designed to allow the development
   of new features without increasing the core code of Electrum.

 * Electrum is written in pure python. if you want to add a feature
   that requires non-python libraries, then it must be submitted as a
   plugin. If the feature you want to add requires communication with
   a remote server (not an Electrum server), then it should be a
   plugin as well. If the feature you want to add introduces new
   dependencies in the code, then it should probably be a plugin.

 * We expect plugin developers to maintain their plugin code. However,
   once a plugin is merged in Electrum, we will have to maintain it
   too, because changes in the Electrum code often require updates in
   the plugin code. Therefore, plugins have to be easy to maintain. If
   we believe that a plugin will create too much maintenance work in
   the future, it will be rejected.

 * Plugins should be compatible with Electrum's conventions. If your
   plugin does not fit with Electrum's architecture, or if we believe
   that it will create too much maintenance work, it will not be
   accepted. In particular, do not duplicate existing Electrum code in
   your plugin.

 * We may decide to remove a plugin after it has been merged in
   Electrum. For this reason, a plugin must be easily removable,
   without putting at risk the user's bitcoins. If we feel that a
   plugin cannot be removed without threatening users who rely on it,
   we will not merge it.