1
0
Commit Graph

14068 Commits

Author SHA1 Message Date
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
62e1d8ed78 daemon: (trivial) subservices log when they start listening 2021-11-15 17:43:34 +01:00
SomberNight
2f2821f9ee qt tray tooltip: don't include wallet balance
closes https://github.com/spesmilo/electrum/issues/5665
2021-11-15 16:57:40 +01:00
SomberNight
7e2d9c48d1 blockchain: fix bugs in bits_to_target and target_to_bits
This fixes three bugs:
- too large targets: the fixme in target_to_bits, which meant that we could
  not handle targets where the first bit was non-zero. This however cannot
  happen due to these being over MAX_TARGET. (difficulty 1)
- too small targets: in bits_to_target, very small targets were not handled well:
  ```
  >>> Blockchain.bits_to_target(0x03008000)
  32768
  ```
  We could not process headers with targets smaller than the above value.
  (note that these small targets would only occur at astronomically high mining difficulty)
- non-canonically encoded targets:
  we would not accept headers that had targets encoded in compact form (nBits) in a non-canonical way.
  I think this bug could actually be triggered by mining such a header.
  E.g. consider the target "1167130406913723784571467005534932607254396928"
  ```
  Blockchain.target_to_bits(1167130406913723784571467005534932607254396928).to_bytes(4, "big").hex()
  '13345600'
  ```
  Bitcoin Core when used to e.g. mine a block would encode this target as 0x13345600 in compact form.
  However, AFAICT, when validating Bitcoin Core would equally accept 0x14003456 which decodes to the
  same target. We were however rejecting such non-canonical compact nBits.
  ```
  >>> from electrum.blockchain import Blockchain
  >>> Blockchain.bits_to_target(0x14003456)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/user/wspace/electrum/electrum/blockchain.py", line 548, in bits_to_target
      raise Exception("Second part of bits should be in [0x8000, 0x7fffff]")
  Exception: Second part of bits should be in [0x8000, 0x7fffff]
  >>> Blockchain.bits_to_target(0x13345600)
  1167130406913723784571467005534932607254396928
  ```
2021-11-13 04:31:08 +01:00
SomberNight
ee10e8e4d3 blockchain: bits_to_target: small clean-up
note: why is the first byte cut unconditionally? what if it's non-zero?
Maybe the intention of cutting the first two chars in the hex case intended to
cut a "0x" prefix?? But there was no such prefix with the given format string...
2021-11-13 03:07:36 +01:00
SomberNight
6033471853 blockchain: clarify MAX_TARGET by referencing bitcoin core source
change is no-op as the compact nBits form of both values are equal, that is:
```
>>> from electrum.blockchain import Blockchain
>>> MAX_TARGET1 = 0x00000000FFFF0000000000000000000000000000000000000000000000000000
>>> MAX_TARGET2 = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
>>> Blockchain.bits_to_target(Blockchain.target_to_bits(MAX_TARGET2)) == Blockchain.bits_to_target(Blockchain.target_to_bits(MAX_TARGET1))
True
```
2021-11-13 03:02:31 +01:00
SomberNight
2599010eed interface: scripthash.get_history: fix tx order check
logic bug
2021-11-11 15:28:16 +01:00
SomberNight
88a1c1a618 python 3.10: fix some deprecation warnings and compat with 3.10 2021-11-09 01:02:57 +01:00
SomberNight
ed0dd6eb22 kivy: implement ElectrumGui.stop 2021-11-05 20:35:28 +01:00
SomberNight
ca9b48e2d6 gui: add BaseElectrumGui base class for guis 2021-11-05 20:21:50 +01:00
SomberNight
c331c311db crash reporter: add EarlyExceptionsQueue
`util.send_exception_to_crash_reporter` is now useful and can be transparently
used even before the exception hook is set up.
2021-11-05 20:01:43 +01:00
SomberNight
e0246b30b9 daemon: if taskgroup dies, show error in GUI
If daemon.taskgroup dies
- in GUI mode, show a crash reporter window to the user,
  instead of immediately stopping the whole process.
- in daemon mode, log exception and stop process, as before.
2021-11-05 20:01:38 +01:00
SomberNight
3643b9f056 daemon: rework stopping
The CLI stop() command can now also stop the GUI.
2021-11-05 19:57:39 +01:00
ghost43
a5c4b9e719 Merge pull request #7545 from yanmaani/unix_sockets
Add support for Unix domain sockets
2021-11-04 19:32:33 +01:00
SomberNight
56b03e2e8d lnpeer: more forwarding is now event-driven
This should make unit tests less reliant on sleeps.
2021-11-04 19:16:02 +01:00
SomberNight
12f3525df0 lnpeer: disable msg processing rate-limiting in tests 2021-11-04 18:04:16 +01:00
SomberNight
4f907e3889 lnworker: change api of 'htlc_{fulfilled,failed}' events 2021-11-04 16:41:23 +01:00
SomberNight
16c6655892 lnpeer: make forwarding partly event-driven 2021-11-04 16:32:40 +01:00
yanmaani
82b9cd12eb tests: Add rudimentary integration test for Unix domain socket functionality 2021-11-03 12:00:00 +00:00
yanmaani
b1005694ec cli: Add support for Unix domain sockets 2021-11-03 12:00:00 +00:00