1
0
Commit Graph

14086 Commits

Author SHA1 Message Date
bitromortac
8ed0f58277 trampoline: add electrum testnet node 2022-02-18 10:14:51 +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
SomberNight
7354feeffe follow-up fix tests: logic typo
follow-up https://github.com/spesmilo/electrum/pull/7202

defaultdict[int] is a type!

```
>>> from collections import defaultdict
>>> d = defaultdict[int]
>>> d[2]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: There are no type variables left in collections.defaultdict[int]
```

Also, prior to py3.9, it is a TypeError.
2021-12-17 15:21:21 +01:00
ghost43
c8f47ed4fe Merge pull request #7562 from SomberNight/202111_blockchain_target
blockchain.py: bugfixes re `bits_to_target` and `target_to_bits`
2021-12-17 14:07:55 +00:00
ghost43
ce44a03c24 Merge pull request #7202 from bitromortac/2104-mpp-channel-splitting
MPP splitting algorithm: redesign and split within channels
2021-12-17 13:58:54 +00:00
ghost43
97e61cfacd Merge pull request #7590 from matejcik/matejcik/trezorlib-0.13
trezorlib 0.13 compatibility
2021-12-17 12:05:35 +00:00
upgradvisor-bot
a044d7df01 Update qdarkstyle to <3.1 (allow 3.0.x) (#7561)
Co-authored-by: the-new-kai-lu <freddylukai@gmail.com>
2021-12-17 11:50:48 +00:00
ThomasV
0eebf9df43 Merge pull request #7588 from bitromortac/2112-fix-closing-to-remote
lnpeer: fix possibly nonexistant to_remote check
2021-12-17 12:45:45 +01:00
Pavol Rusnak
1e8e2890d5 trezor: use the same amount unit (satoshi, etc.) on device 2021-12-13 14:30:27 +01:00
matejcik
9a975a5200 trezorlib 0.13 compatibility 2021-12-09 13:55:03 +01:00
bitromortac
ffba3fb7fc lnpeer: fix possibly nonexistant to_remote check
`drop_to_remote` can be False and at the same time the to_remote output
is not present, because it is below dust. Therefore, we have to explicitly
check if to_remote is present when checking for the allowed script types and
dust limits. This affects channels which have sent only dust values, they
can't be closed unilaterally without this fix.

Fixes a regression introduced by 947693c90d.
2021-12-08 14:23:55 +01:00
SomberNight
0df05dd914 qt preferences: always show cb for LN/"Create recoverable channels"
This makes it explicit that the option cannot be enabled if so (instead of hiding the checkbox).
2021-11-17 17:54:52 +01:00
SomberNight
12b659ff99 daemon: change rpcsock default to "unix" where available
The daemon by default listens for RPC over a socket.
Before this change, this socket was a TCP/IP network socket (over localhost),
but now we change it to be a unix domain socket by default (if available).

This socket is used not only when sending commands over JSON-RPC,
but also when using the CLI, and to a tiny extent even used when running the GUI.
The type of socket used (and hence this change) is invisible to CLI and GUI users.
JSON-RPC users might want to use either the --rpcsock CLI flag
or set the "rpcsock" config key (to "tcp") to switch back to using a TCP/IP socket.

In practice it seems unix domain sockets are available on
all mainstream OSes/platforms, except for Windows.

closes https://github.com/spesmilo/electrum/issues/7553
2021-11-15 17:44:20 +01:00
SomberNight
62e1d8ed78 daemon: (trivial) subservices log when they start listening 2021-11-15 17:43:34 +01:00