1
0
Commit Graph

14139 Commits

Author SHA1 Message Date
SomberNight
b726fe85e1 contrib: add docker_notes.md 2022-03-03 19:24:22 +01:00
SomberNight
0df8392c86 build: rm need for sudo in most places; and do not run as root
This includes two logically separate changes:
- on the host, try not to require sudo when running the build scripts
    - namely when interacting with the docker daemon, this requires
      the unix user on the host to be part of the `docker` group
    - this solves part of https://github.com/spesmilo/electrum/issues/7602
- while running inside the docker containers, do not run as root
    - this means that e.g. files created in mounted folders should
      no longer be owned by root on the host
    - there is some code duplication involved here - not sure
      how it could be deduped.
2022-03-03 19:24:18 +01:00
SomberNight
cdfc75ff2b appimage: update package (libc) in dockerfile
Ubuntu no longer serves old version
2022-03-03 19:22:52 +01:00
scgbckbone
122c09cc04 BUGFIX: invalid client loaded for identical wallet with different HW type (#7689)
* typecheck client selected by keystore - check if plugin types match

* add log msg + refactor if branching

* moved type check to own function; moved from 'client_for_keystore' to 'force_pair_xpub' and 'client_by_xpub'

* refactor

Co-authored-by: avirgovi <avirgovi@cisco.com>
2022-03-03 12:24:28 +00:00
ThomasV
c862dbf9d9 Merge pull request #7694 from benma/README-unit-tests
README: docs on how to run unit tests
2022-03-03 10:41:51 +01:00
ghost43
2b17cb1eb7 Merge pull request #7695 from benma/unit-test-payload
tests: unit test address_to_payload
2022-03-02 14:38:43 +00:00
Marko Bencun
1d652a2a04 tests: unit test address_to_payload 2022-03-02 14:54:11 +01:00
Marko Bencun
d18b05043d README: docs on how to run unit tests
It is helpful for contributors to discover how to run unit tests easily.
2022-03-02 14:51:37 +01:00
ghost43
8acda5f48d Merge pull request #7693 from benma/bb02
bitbox02: bump dependency to v6.0.0, support sending to taproot
2022-03-02 13:29:24 +00:00
Marko Bencun
01b4b35f9f bitbox02: bump dependency to v6.0.0, support sending to taproot 2022-03-02 14:14:24 +01:00
nndiaye-ledger
7e083824b7 Add support for Ledger Nano S Plus (#7692) 2022-03-02 12:59:51 +00:00
Federico
f42ae3f01c fix rpcsock (#7691)
some heuristics re default rpcsock type: if tcp-related other config keys are set, use tcp

closes https://github.com/spesmilo/electrum/issues/7686
2022-03-02 11:42:49 +00:00
ThomasV
eb07d5503a Merge pull request #7685 from coval3nte/fix/get_balance
docs-compliant get_balance method
2022-02-28 15:43:14 +01:00
coval3nte
f60bbf96d8 fix 2022-02-28 15:17:56 +01:00
coval3nte
bbb96b6e25 fix get_balance method 2022-02-28 14:16:43 +01:00
SomberNight
03df14b27a wallet_db: handle legacy channels in convert_version_44
I still have a mainnet wallet with some pre-static-remotekey channels
(though those channels are closed) that I do not want to delete yet.

follow-up https://github.com/spesmilo/electrum/pull/7636

```
E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\__init__.py", line 307, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\gui\qt\__init__.py", line 332, in start_new_window
    wallet = self._start_wizard_to_select_or_create_wallet(path)
  File "...\electrum\electrum\gui\qt\__init__.py", line 377, in _start_wizard_to_select_or_create_wallet
    db = WalletDB(storage.read(), manual_upgrades=False)
  File "...\electrum\electrum\wallet_db.py", line 73, in __init__
    self.load_data(raw)
  File "...\electrum\electrum\wallet_db.py", line 106, in load_data
    self.upgrade()
  File "...\electrum\electrum\util.py", line 439, in <lambda>
    return lambda *args, **kw_args: do_profile(args, kw_args)
  File "...\electrum\electrum\util.py", line 435, in do_profile
    o = func(*args, **kw_args)
  File "...\electrum\electrum\wallet_db.py", line 195, in upgrade
    self._convert_version_44()
  File "...\electrum\electrum\wallet_db.py", line 859, in _convert_version_44
    if item['static_remotekey_enabled']:
KeyError: 'static_remotekey_enabled'
```
2022-02-25 20:44:05 +01:00
SomberNight
7d74fd0201 interface: add comment about monitor_connection 2022-02-23 18:37:21 +01:00
SomberNight
e8b53d0240 android build: set SOURCE_DATE_EPOCH to cur time for debug builds
Otherwise One would have to git commit every change to be tested on a phone.
2022-02-23 17:49:26 +01:00
ghost43
22e6094eff Merge pull request #7679 from SomberNight/202202_build_bump_libsecp
bump libsecp256k1 version
2022-02-22 18:25:52 +00:00
SomberNight
376fc01b27 keystore.sign_message: add optional script_type argument
this is used by trezor
(and also by bitbox02, which was using a workaround previously)

fixes https://github.com/spesmilo/electrum/issues/7670
2022-02-22 19:20:03 +01:00
ghost43
6603359c20 Merge pull request #7668 from SomberNight/202202_signmessage_segwit_trezor
signmessage: also accept Trezor-type sigs for p2wpkh and p2wpkh-p2sh addrs
2022-02-22 17:10:08 +00:00
ghost43
57eac4e2ca Merge pull request #7671 from SomberNight/202202_rerun_freeze_packages
rerun freeze_packages
2022-02-22 16:38:47 +00:00
SomberNight
5cf5c03f50 bump libsecp256k1 version 2022-02-22 17:35:14 +01:00
SomberNight
5e2cee6a31 build appimage: rm importlib-metadata workaround
The importlib-metadata pkg is no longer needed apparently (since we bumped the min python to 3.8).
2022-02-22 17:14:23 +01:00
SomberNight
f4cfc6c7c3 interface: set got_disconnected earlier
related: https://github.com/spesmilo/electrum/issues/7677
related: prev commit
2022-02-22 15:22:08 +01:00
SomberNight
2acecc5859 interface: speed up handle_disconnect via shorter flush-buffer-timeout
Note in particular that _RSClient.__aexit__ calls session.close()
so a lot of time can pass between interface.taskgroup raising and
handle_disconnect seeing the exception.

related https://github.com/spesmilo/electrum/issues/7677
2022-02-22 15:16:55 +01:00
SomberNight
4f102d7752 exchange_rate: don't log full exception trace for timeouts
```
20220222T134125.306163Z |    ERROR | exchange_rate.CoinGecko | failed fx quotes: TimeoutError()
Traceback (most recent call last):
  File "...\electrum\electrum\exchange_rate.py", line 81, in update_safe
    self.quotes = await self.get_rates(ccy)
  File "...\electrum\electrum\exchange_rate.py", line 306, in get_rates
    json = await self.get_json('api.coingecko.com', '/api/v3/exchange_rates')
  File "...\electrum\electrum\exchange_rate.py", line 65, in get_json
    async with session.get(url) as response:
  File "...\Python39\site-packages\aiohttp\client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "...\Python39\site-packages\aiohttp\client.py", line 634, in _request
    break
  File "...\Python39\site-packages\aiohttp\helpers.py", line 721, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
```
2022-02-22 15:04:37 +01:00
SomberNight
d7af868ed8 network: test if interface is alive before iface.taskgroup.spawn
closes https://github.com/spesmilo/electrum/issues/7677

```
 E/n | network | taskgroup died.
 Traceback (most recent call last):
   File "/opt/electrum/electrum/network.py", line 1204, in main
     [await group.spawn(job) for job in self._jobs]
   File "/home/voegtlin/.local/lib/python3.8/site-packages/aiorpcx/curio.py", line 297, in __aexit__
     await self.join()
   File "/opt/electrum/electrum/util.py", line 1255, in join
     task.result()
   File "/opt/electrum/electrum/network.py", line 1277, in _maintain_sessions
     await maintain_main_interface()
   File "/opt/electrum/electrum/network.py", line 1268, in maintain_main_interface
     await self._ensure_there_is_a_main_interface()
   File "/opt/electrum/electrum/network.py", line 1245, in _ensure_there_is_a_main_interface
     await self._switch_to_random_interface()
   File "/opt/electrum/electrum/network.py", line 648, in _switch_to_random_interface
     await self.switch_to_interface(random.choice(servers))
   File "/opt/electrum/electrum/network.py", line 714, in switch_to_interface
     await i.taskgroup.spawn(self._request_server_info(i))
   File "/home/voegtlin/.local/lib/python3.8/site-packages/aiorpcx/curio.py", line 204, in spawn
     self._add_task(task)
   File "/home/voegtlin/.local/lib/python3.8/site-packages/aiorpcx/curio.py", line 150, in _add_task
     raise RuntimeError('task group terminated')
 RuntimeError: task group terminated
```

I believe the "suppress spurious cancellations" block was added as SilentTaskGroup raised
CancelledError instead of RuntimeError for this scenario.
2022-02-21 20:09:26 +01:00
SomberNight
556b98736e lnworker.try_force_closing: changed to not be async (and renamed)
This is to ensure that the channel is "immediately" set to FORCE_CLOSING.
(previously it took at least one event loop iteration)
2022-02-21 18:09:45 +01:00
ThomasV
b268877d53 Merge pull request #7636 from bitromortac/2201-channel-type
lightning: implement channel types
2022-02-21 12:08:54 +01:00
ThomasV
4ebe41b3a7 Trampoline MPP: save fee level in sent_htlcs_info.
If multiple HTLCs fail at the same fee level with
TRAMPOLINE_INSUFFICIENT_FEE, bump trampoline_fee_level only once.
2022-02-19 15:20:54 +01:00
ThomasV
9fd18ae7f4 Merge pull request #7623 from bitromortac/2201-multi-trampoline-mpp
Multi-trampoline multipart payments
2022-02-19 14:44:21 +01:00
ThomasV
395911b086 follow-up previous: set exception to be raised after we have sent channel_reestablish 2022-02-19 13:44:58 +01:00
ThomasV
cf61b1ed89 move comment (minor, follow-up prev commit) 2022-02-19 10:54:33 +01:00
ThomasV
b2f84187bc Split code in reestablish_channel:
Messages are sent in reestablish_channel (async)
  Message checks and force_close are performed in on_channel_reestablish (not async).
  That task should not be cancelled if the connection is closed.
  Revert 57583c05cf
2022-02-19 10:37:50 +01:00
SomberNight
7a47eb9906 qt: again disable changing light/dark theme at runtime
partially reverts 11a04c0d72

related https://github.com/spesmilo/electrum/issues/7209
2022-02-18 22:17:44 +01:00
SomberNight
31b3673461 qt: follow-up changing light/dark theme at runtime
follow-up 11a04c0d72
2022-02-18 21:54:31 +01:00
SomberNight
2f549e84db fix tests: follow-up 96fcf68d84 2022-02-18 19:32:27 +01:00
SomberNight
11a04c0d72 qt: allow changing light/dark theme at runtime
Looks like the stylesheet can be changed at any time...
so we don't need to ask the user to restart the program.

closes https://github.com/spesmilo/electrum/issues/7209
2022-02-18 18:08:38 +01:00
SomberNight
96fcf68d84 lnworker.force_close_channel: set chan state before broadcast
It is not safe to keep using the channel after we attempted to broadcast a force-close,
even if the broadcast errored: the server cannot be trusted wrt to errors.

Note that if there is a network-error, due to the state-transition, the GUI won't offer
the force-close option to the user again. However, LNWallet will periodically rebroadcast
the tx automatically (in on_channel_update); and we also save the tx as local into the
wallet.
2022-02-18 17:20:30 +01:00
SomberNight
88121d7924 kivy ln invoice: handle missing 'd' tag
fixes https://github.com/spesmilo/electrum/issues/6262
2022-02-18 16:37:46 +01:00
SomberNight
75af5b1542 lnchannel.set_state: add "force" option for debugging use 2022-02-18 15:43:16 +01:00
bitromortac
a4f5cfc91a trampoline: refactor routes, enable e2e mpp
* Refactor `create_trampoline_route`.
* Enables end-to-end multi-trampoline multipart payments.
  Trampoline-to-legacy payments are still not enabled, as this is
  currently not supported by Eclair.
* Reverts to a global trampoline fee level, as trampoline failures
  are currently not handled properly, see (#7648), which doubles
  fee rates.
2022-02-18 10:14:51 +01:00
bitromortac
8ed0f58277 trampoline: add electrum testnet node 2022-02-18 10:14:51 +01:00
ghost43
dcbbcf9fb1 Merge pull request #7662 from johlar/master
Add support for cli --version command
2022-02-17 17:28:43 +00:00
johlar
c3506911c0 Add support for cli --version command 2022-02-17 17:53:51 +01:00
SomberNight
b79656e54c rerun freeze_packages 2022-02-17 17:07:06 +01:00
SomberNight
bb5b52f2d7 binaries: bump python 3.9.7->3.9.10 2022-02-17 16:51:13 +01:00
SomberNight
9e96414bb8 update block header checkpoints 2022-02-17 15:44:47 +01:00
sgmoore
3f20215d03 trivial: minor grammar fixes
closes https://github.com/spesmilo/electrum/pull/7664
closes https://github.com/spesmilo/electrum/pull/7665
closes https://github.com/spesmilo/electrum/pull/7666
closes https://github.com/spesmilo/electrum/pull/7667
2022-02-17 15:36:13 +01:00