1
0
Commit Graph

14098 Commits

Author SHA1 Message Date
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
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
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
SomberNight
9bbf92b80b tests: add test for signmessage with segwit address 2022-02-16 19:24:43 +01:00
SomberNight
4f9e4c520f ecc: API changes: verify_message_hash to return bool instead of raising
verify_message_hash and verify_message_for_address now return bool
instead of raising Exceptions on bad signatures.
2022-02-16 19:24:38 +01:00
ThomasV
57583c05cf request_force_close: add 1s delay before closing the tranport,
so that the remote task does not get cancelled.
2022-02-16 18:54:42 +01:00
SomberNight
40c1597c0a lntransport: change name used in logs to make collisions unlikely
In particular, in the regtests, with incoming peers, we can have multiple transports open with the same node simultaneously
(see e.g. lnworker._request_force_close_from_backup).
We now use the first few bytes of peer_pubkey, as that is potentially familiar to users,
and the first few bytes of sha256(id(self)) to mitigate collisions in case the peer_pubkeys collide.

log excerpt:
```
I/P | lnpeer.Peer.[LNWallet, 030f0bf260-e0b33756] | handshake done for 030f0bf260acdbd3edcad84d7588ec7c5df4711e87e6a23016f989b8d3a4147230@163.172.94.64:9735
D/P | lnpeer.Peer.[LNWallet, 030f0bf260-e0b33756] | Sending INIT
I/P | lnpeer.Peer.[LNWallet, 03933884aa-5e5dce45] | handshake done for 03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134@34.250.234.192:9735
D/P | lnpeer.Peer.[LNWallet, 03933884aa-5e5dce45] | Sending INIT
D/P | lnpeer.Peer.[LNWallet, 030f0bf260-e0b33756] | Received INIT
I/P | lnpeer.Peer.[LNWallet, 02651acf4a-79696c42] | handshake done for 02651acf4a7096091bf42baad19b3643ea318d6979f6dcc16ebaec43d5b0f4baf2@82.119.233.36:19735
D/P | lnpeer.Peer.[LNWallet, 02651acf4a-79696c42] | Sending INIT
D/P | lnpeer.Peer.[LNWallet, 03933884aa-5e5dce45] | Received INIT
I/P | lnpeer.Peer.[LNWallet, 030f0bf260-e0b33756] | saved remote_update
D/P | lnpeer.Peer.[LNWallet, 030f0bf260-e0b33756] | Received CHANNEL_REESTABLISH
```
2022-02-16 18:53:24 +01:00
ThomasV
fa31e8ae25 Merge pull request #7663 from git-sgmoore/patch-1
Minor grammar fixes
2022-02-16 16:40:27 +01:00
sgmoore
a84eab964c Minor grammar fixes
Minor grammar fixes at lines 1403 and 1467.
2022-02-16 07:07:43 -08:00
ghost43
3e486b029c Merge pull request #7566 from SomberNight/202111_rpcsock_unix_default
daemon: change `rpcsock` default to "unix" where available
2022-02-16 14:50:29 +00:00
ghost43
586d3a4361 Merge pull request #7661 from SomberNight/202202_py38
bump min python to 3.8, and migrate to aiorpcx 0.22
2022-02-16 14:47:45 +00:00
SomberNight
de16934b47 tests: tox: python version matrix is fed from .cirrus.yml via TOXENV 2022-02-16 15:40:33 +01:00
SomberNight
5960072161 regtests: update electrumx 2022-02-15 18:41:45 +01:00
SomberNight
cf3f92531e aiorpcx: monkeypatch TimeoutAfter internals
see https://github.com/kyuupichan/aiorpcX/issues/44
2022-02-15 18:22:47 +01:00
SomberNight
c9c094cfab requirements: bump min aiorpcx to 0.22.0
aiorpcx 0.20 changed the behaviour/API of TaskGroups.
When used as a context manager, TaskGroups no longer propagate
exceptions raised by their tasks. Instead, the calling code has
to explicitly check the results of tasks and decide whether to re-raise
any exceptions.
This is a significant change, and so this commit introduces "OldTaskGroup",
which should behave as the TaskGroup class of old aiorpcx. All existing
usages of TaskGroup are replaced with OldTaskGroup.

closes https://github.com/spesmilo/electrum/issues/7446
2022-02-15 18:22:44 +01:00
SomberNight
c131831373 util: rm SilentTaskGroup. this does not seem to be needed anymore
I think this was originally needed due to incorrect management of group lifecycles,
which our current code is doing better.

also note that if we needed this, in newer aiorpcx, the name of
the field was ~changed from `_closed` to `joined`:
239002689a
2022-02-15 18:22:40 +01:00
SomberNight
3f3212e94d some clean-ups now that we require python 3.8
In particular, asyncio.CancelledError no longer inherits Exception (it inherits BaseException directly)
2022-02-15 18:22:36 +01:00
SomberNight
dd2f8541b7 bump min required Python version to 3.8 2022-02-15 18:22:32 +01:00
SomberNight
f02e3b9d99 cirrus ci: change cache key for pip dependencies
the cache should be considered stale if requirements.txt changes
2022-02-15 18:19:41 +01:00
SomberNight
a3e1d2e25e follow-up prev
there must be a better way of doing this...
we should somehow automate figuring out the build-time dependencies of requirements.txt
2022-01-22 17:49:20 +01:00
SomberNight
8559d1eb72 build: android reprod: "pip install" needs "--no-build-isolation"
maybe fixes https://github.com/spesmilo/electrum/issues/7640

Looks like by default pip is ignoring the locally available setuptools and wheel,
and downloading the latest ones from the internet at build time...

https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/?highlight=no-build-isolation#disabling-build-isolation
https://stackoverflow.com/a/62889268

> When making build requirements available, pip does so in an isolated environment. That is, pip does not install those requirements into the user’s site-packages, but rather installs them in a temporary directory which it adds to the user’s sys.path for the duration of the build. This ensures that build requirements are handled independently of the user’s runtime environment. For example, a project that needs a recent version of setuptools to build can still be installed, even if the user has an older version installed (and without silently replacing that version).
>
> In certain cases, projects (or redistributors) may have workflows that explicitly manage the build environment. For such workflows, build isolation can be problematic. If this is the case, pip provides a --no-build-isolation flag to disable build isolation. Users supplying this flag are responsible for ensuring the build environment is managed appropriately (including ensuring that all required build dependencies are installed).

If only it were that easy!
If we add the "--no-build-isolation" flag, it becomes our responsibility to install *all* build time deps,
hence we now have "requirements-build-makepackages.txt".
2022-01-22 14:49:35 +01:00
SomberNight
46dc675b1f scripts: fix py3.6 compat in update_default_servers.py
Note: this was causing a weird flake8 error on CI. Presumably due to CI running flake8 via py3.7.

```
flake8 . --count --select=$ELECTRUM_LINTERS --show-source --statistics
./electrum/scripts/update_default_servers.py:1:26: E999 SyntaxError: invalid syntax
#!/usr/bin/env python3

^
1     E999 SyntaxError: invalid syntax
1
```
2022-01-20 16:59:10 +01:00
SomberNight
1ad30e86b6 build: relax qdarkstyle version bound
Historically, there have often been (visual) issues with new versions of qdarkstyle.
The upper bound restriction was mainly there for this reason: to ~force manually testing new versions.
There is no known issue with newer versions atm.

Remove the upper bound, as there have not been issues with newer versions recently,
and this makes it clear to e.g. packagers that it's fine to use newer versions.

Add a lower bound for a version that has been tested in the past and is known to work ok.

related https://github.com/spesmilo/electrum/issues/7361
2022-01-20 15:09:12 +01:00
SomberNight
d9b55ae5c8 build: relax dnspython version bound
The <2.1 pin had been put there as dnspython 2.1 added "poetry" as a build time dep,
which pulled in a significant number of transitive dependencies, and it was also
causing issues with our appimage build.

dnspython 2.2.0 was released since, which no longer needs full poetry, only "poetry-core":
da279dec7e

related https://github.com/spesmilo/electrum/issues/7361
2022-01-20 15:09:08 +01:00
SomberNight
1705c1999a build: rm "dataclasses" from pinned requirements-hw.txt
trezorlib requires "dataclasses ; python_version<'3.7'", and our min supported python version is 3.6,
so freeze_packages.sh pins down a version of "dataclasses". However, when creating binaries we
use newer versions of python (typically py3.9 atm), for which dataclasses is not available (it's a backport of py3.7 stuff).
Hmhm, what to do... short-term, I am manually removing the dataclasses pin, so it won't be installed in our binaries.

```
Collecting construct==2.10.67
  Downloading construct-2.10.67.tar.gz (57 kB)
     |████████████████████████████████| 57 kB 2.7 MB/s
  Preparing metadata (setup.py) ... done
Requirement already satisfied: cryptography==36.0.1 in ./build/appimage/electrum.AppDir/usr/lib/python3.9/site-packages (from -r /opt/electrum/contrib/build-linux/appimage/../../../contrib/deterministic-build/requirements-hw.txt (line 74)) (36.0.1)
ERROR: Could not find a version that satisfies the requirement dataclasses==0.8 (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
ERROR: No matching distribution found for dataclasses==0.8
```
2022-01-20 15:09:04 +01:00
SomberNight
6421ff015d rerun freeze_packages 2022-01-20 14:11:54 +01:00
SomberNight
27fb5a6dbd network: update hardcoded mainnet servers (and testnet)
Many servers on the old list were down.
```
got reply from 18/71 old servers
len(newly_added_servers)=67. total: len(res_servers)=83
```
2022-01-18 19:54:24 +01:00
SomberNight
3851ce5dd1 scripts: add "update_default_servers.py" 2022-01-18 19:50:46 +01:00
ghost43
47132790c1 Merge pull request #7426 from bitromortac/2107-trampoline-test
flexible lnpeer test graphs and spp trampoline tests
2022-01-18 15:20:47 +00:00
vertion
906c4c4e2c appimage build: update libudev-dev libudev1 (#7629)
(cherry picked from commit 19a9a151e8832a55444f3815df3a1ca35fdb1674)
2022-01-18 14:47:29 +00:00
ghost43
c01c37288d Merge pull request #7609 from JeremyRand/cirrus-regtest-vm-v3
Cirrus: Use VM instead of Docker for functional tests
2022-01-18 14:45:48 +00:00
Jeremy Rand
8ab97d7d40 Cirrus: Use hardcoded ElectrumX v1.15.0 in functional tests 2021-12-28 07:05:39 +00:00
Jeremy Rand
d79de7ac2e Cirrus: Use VM instead of Docker for functional tests 2021-12-28 07:04:57 +00:00
bitromortac
a3ec3f3228 trampoline: forwarding, use correct secret for legacy case 2021-12-20 16:45:15 +01:00
bitromortac
58dd8996fb trampoline: use trampoline policy for intermediate forwarders 2021-12-20 16:45:15 +01:00
bitromortac
2d2b889312 lnpeer tests: add spp trampoline payment 2021-12-20 16:45:14 +01:00
bitromortac
e8c94cf5d7 tests: implement graph with flexible definitions 2021-12-20 16:45:07 +01:00
ThomasV
bdbd59300f Prepare scripts for aggregated signatures:
- fetch file signatures in contrib/add_cosigner.
 - detect cosigners in make_download.
 - format download page for aggregated signatures.
2021-12-19 17:10:41 +01:00
ThomasV
195b470d70 contrip/upload: do not fail sftp if directory already exists 2021-12-19 17:02:27 +01:00