1
0
Commit Graph

17970 Commits

Author SHA1 Message Date
Josh Geden
6331448860 qml: add config setting for max brightness on qr display 2025-01-22 09:47:10 +01:00
ThomasV
a084ccc74c lnworker: fix how lightning balance is affected when a channel is
force-closed. Assert final balance in lnworker.get_history().

If we offered some HTLCs, we do not know yet whether they will be
redeemed by us or by the remote.
2025-01-21 17:14:17 +01:00
accumulator
08688c3523 Merge pull request #9461 from f321x/fix_rswap_exception
Handle reverse swap exception more gracefully
2025-01-20 22:48:24 +01:00
f321x
18d3d26b8d handle swap exception more gracefully
remove redundant Nne

handle reverse swap exception more gracefully

change reverse swap error

handle reverse swap exception more gracefully
2025-01-20 17:49:53 +01:00
ghost43
142f1d55e4 Merge pull request #9458 from f321x/bump_aiorpcx
Bump allowed aiorpcx version to 0.24
2025-01-20 12:19:00 +00:00
f321x
171aa5ee5a bump aiorpcx version 2025-01-20 12:11:55 +01:00
SomberNight
f949c04cd2 gui/qt/history_list: (trivial) follow-up qt6 migration
ref https://github.com/spesmilo/electrum/pull/9189

```
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/my_treeview.py", line 166, in on_commitData
    self.tv.on_edited(idx, edit_key=edit_key, text=new_text)
  File "/home/user/wspace/electrum/electrum/gui/qt/history_list.py", line 699, in on_edited
    self.hm.update_fiat(index)
  File "/home/user/wspace/electrum/electrum/gui/qt/history_list.py", line 371, in update_fiat
    self.dataChanged.emit(idx, idx, [Qt.ItemDataRole.DisplayRole, Qt.ForegroundRole])
AttributeError: type object 'Qt' has no attribute 'ForegroundRole'
```
2025-01-17 15:25:19 +00:00
Sander van Grieken
897327da5a android: support regtest builds in a similar fashion to testnet builds, by package name. 2025-01-17 15:37:51 +01:00
ThomasV
28c053027f Merge branch 'master' of github.com:spesmilo/electrum 2025-01-17 14:43:15 +01:00
ThomasV
f23971660e simplify helpconfig
Co-authored-by: ghost43 <somber.night@protonmail.com>
2025-01-17 14:40:33 +01:00
Sander van Grieken
19a4b149d3 qml: show proper Payment failed message when reason is empty (e.g. from previous session)
also capitalisation consistency.
2025-01-17 13:02:28 +01:00
Sander van Grieken
010b153ab2 qml: fix regression caused by ee42e09387
in qml, we need the password in-memory as the auth wrapper (@auth_protect) does not
pass the password to the wrapped fn.
2025-01-17 12:16:46 +01:00
ThomasV
aacc6a9dd6 cmdline: add listconfig/helpconfig 2025-01-17 11:27:34 +01:00
ThomasV
d25aca7a53 Merge pull request #9447 from f321x/node_ann_dns
Add gossip address field serialization, parsing and tests
2025-01-17 10:52:14 +01:00
ThomasV
64e07732f8 Merge pull request #9430 from SomberNight/202501_funding_pubkey_deriv
lightning: change derivation of funding_pubkey
2025-01-17 10:49:16 +01:00
f321x
1f626f3ad8 add gossip address field serialization, parsing and tests
add space

add gossip address field serialization, parsing and tests

fix linter

consolidate tests, fix intendation

refactor test in loops

add gossip address field serialization, parsing and tests
2025-01-17 10:33:56 +01:00
ThomasV
217b1d5c61 Merge pull request #9434 from SomberNight/202501_lnpeer_tramp_test1
tests: lnpeer: add test payment_trampoline_e2e A->T1->C>T2->E
2025-01-17 09:21:12 +01:00
Sander van Grieken
8ce7519558 qml: wordwrap channel type 2025-01-16 15:46:39 +01:00
ThomasV
0ef7235147 swaps: ignore exceptions in publish_offers
nostr may temporarily raise an exception; we don't want to kill the taskgroup
2025-01-16 09:51:26 +01:00
ThomasV
4672681c0c Merge pull request #9435 from f321x/debugging_gossip_toggle
Add fallback list of signet nodes and use it for ln peer discovery
2025-01-16 08:44:50 +01:00
f321x
b1e1a39997 add fallback list of signet nodes 2025-01-15 16:40:30 +01:00
SomberNight
6c2a4b61a1 tests: lnpeer: add test payment_trampoline_e2e A->T1->C>T2->E
Adds a new test case for e2e trampoline payment, where there are multiple
Trampoline Forwarders which themselves are not directly connected.

This adds a regression test for https://github.com/spesmilo/electrum/pull/9431
dffdebf778
2025-01-15 15:12:05 +00:00
ThomasV
d6630640ce Merge pull request #9432 from f321x/increase_pay_to_node_attempts
Increase attempts when forwarding trampoline payment
2025-01-15 13:48:34 +01:00
ThomasV
2ac17d0633 Merge pull request #9433 from f321x/change_onion_message
Change OnionFailureCode returned when failing trampoline forwarding
2025-01-15 13:46:41 +01:00
f321x
c921100de3 return TRAMPOLINE_FEE_INSUFFICIENT instead of UNKNOWN_NEXT_PEER on payment failure in forwarding 2025-01-15 13:18:11 +01:00
ThomasV
dffdebf778 Merge pull request #9431 from f321x/fix_trampoline_onion_index
Fix trampoline onion construction by selecting correct last hop
2025-01-15 12:30:16 +01:00
f321x
8f94261fc3 increase attempts when forwarding trampoline payment 2025-01-15 11:48:51 +01:00
ThomasV
b0886d2a4d Merge pull request #9427 from f321x/limit_pay_to_node_attempts
Limit payment attempts if client uses trampoline
2025-01-15 11:36:58 +01:00
f321x
39b56fa922 change hops_data index in trampoline onion construction 2025-01-15 11:36:09 +01:00
f321x
48c53053d6 don't inline logic and add comment 2025-01-15 10:44:01 +01:00
SomberNight
cba073dfd1 lightning: change derivation of funding_pubkey
Ideally, given an on-chain backup, after the remote force-closes, we should be able to spend our anchor output,
to CPFP the remote commitment tx (assuming the channel used OPTION_ANCHORS).
To spend the anchor output, we need to be able to sign with the local funding_privkey.

Previously we derived the funding_key from the channel_seed (which comes from os.urandom).
Prior to anchors, there was no use case for signing with the funding_key given a channel backup.
Now with anchors, we should make its derivation deterministic somehow, in a way so that it can
be derived given just an on-chain backup.
- one way would be to put some more data into the existing OP_RETURN
  - uses block space
  - the OP_RETURNs can be disabled via "use_recoverable_channels"
  - only the initiator can use OP_RETURNs (so what if channel is in incoming dir?)
- instead, new scheme for our funding_key:
  - we derive the funding_privkey from the lnworker root secret (derived from our bip32 seed)
  - for outgoing channels:
    - lnworker_root_secret + remote_node_id + funding_tx_nlocktime
  - for incoming channels:
    - lnworker_root_secret + remote_node_id + remote_funding_pubkey
  - a check is added to avoid reusing the same key between channels:
      not letting to user open more than one channel with the same peer in a single block
  - only the first 16 bytes of the remote_node_id are used, as the onchain backup OP_RETURNs only contain that
- as the funding_privkey cannot be derived from the channel_seed anymore, it is included in the
imported channel backups, which in turn need a new version defined
  - a wallet db upgrade is used to update already stored imported cbs
  - alternatively we could keep the imported cbs as-is, so no new version, no new funding_privkey field, as it is clearly somewhat redundant given on-chain backups can reconstruct it
    - however adding the field seems easier
      - otherwise the existing code would try to derive the funding_privkey from the channel_seed
      - also note: atm there is no field in the imported backups to distinguish anchor channels vs static-remotekey channels
2025-01-14 17:56:48 +00:00
ThomasV
4f9f4351b8 Merge pull request #9428 from f321x/remove_lnd_signet_node
Remove wakiyamap lnd node from signet trampoline nodes
2025-01-14 12:40:08 +01:00
f321x
3034df61c7 remove wakiyamap lnd node from signet nodes 2025-01-14 11:21:33 +01:00
f321x
4c93c9a26c limit payment attempts if client uses trampoline
revert line break

limit payment attempts if client uses trampoline
2025-01-14 11:18:21 +01:00
SomberNight
8f5b395ddc lnworker.open_channel: move max funding_sat check deeper in call stack
open_channel_with_peer was missing this check
2025-01-13 14:53:16 +00:00
ghost43
68a2e4e399 Merge pull request #9418 from SomberNight/202501_bump_min_python
bump min python to 3.10
2025-01-13 12:01:57 +00:00
ThomasV
ef08fb37a6 json_db: add StoredList.clear() method 2025-01-12 10:32:00 +01:00
ThomasV
3ffcac87ac maybe_forward_htlc: 'already_forwarded' must be passed to the recursive call.
if we are a trampoline and chain tip is stale, we must not fail the htlc.
2025-01-11 09:44:03 +01:00
SomberNight
450768ee6c sdist build: bump base image to debian 12 to have py3.10+
- debian 11 only has python 3.9, deb12 has py3.11
- pip install pip is no longer needed, atm apt has new enough pip
  - and on deb12, started getting "error: externally-managed-environment"
- faketime does not seem to work properly on debian 12
    (getting reproducibility issues for the tarball)
  - so instead we untar, fix the timestamps manually, and re-tar
2025-01-10 18:58:02 +00:00
SomberNight
be2cd02e54 some clean-ups now that we require python 3.10 2025-01-10 18:52:53 +00:00
SomberNight
fb5a1af666 bump min required Python version to 3.10 2025-01-10 18:52:49 +00:00
SomberNight
3aac8ff0b8 sdist build: simplify sourceonly handling 2025-01-10 18:51:04 +00:00
ThomasV
0efe7e9bc8 swaps: make the zeroconf option non-persisted
Since we allow swaps with random servers, we should not persist that setting.
2025-01-10 16:19:01 +01:00
SomberNight
c43a691eee qt gui: qrreader: lower strong_count in qtmultimedia based reader
The qtmultimedia-based qrreader has the concept of "strong_count":
before the scanner returns a decoded qr code result, it waits until
it has seen at least "strong_count" (e.g. 10) frames in which the qr code was seen and successfully decoded.
I think the idea might have been to reduce false positives, mis-decoding qr codes from bad frames.
However in practice it makes scanning even moderately sized qr codes really difficult for the user:
it takes several seconds (at least on my laptop cam) to obtain enough "clear" frames that count into the strong_count.

So I am lowering the strong_count to 2, down from CAMERA_FPS/3,
which makes it easier to scan, and I still haven't seen false positives even with this value.
2025-01-10 12:59:56 +00:00
SomberNight
838490fea4 adb.add_transaction: try to ser-deser tx early
Previously calling add_transaction with a malformed Transaction obj could
result in an exception late in the flow, after the walletdb was already side-effected.
Rollback of such side-effects is not implemented :/
  but this small patch should at least cover and prevent some common cases.

```
File "/opt/electrum/electrum/address_synchronizer.py", line 358, in add_transaction
  self.db.add_transaction(tx_hash, tx)
File "/opt/electrum/electrum/json_db.py", line 42, in wrapper
  return func(self, *args, **kwargs)
File "/opt/electrum/electrum/wallet_db.py", line 1434, in add_transaction
  tx = tx_from_any(str(tx))
File "/opt/electrum/electrum/transaction.py", line 1339, in tx_from_any
  raise SerializationError(f"Failed to recognise tx encoding, or to parse transaction. "
```
2025-01-10 12:24:26 +00:00
SomberNight
ce843fd454 Merge branch 'pr/9417': fix: add extra check to script_GetOp
manual merge of squashed https://github.com/spesmilo/electrum/pull/9417
2025-01-10 12:01:33 +00:00
SomberNight
043be2439e follow-up prev: add testcase and minor formatting
(minor reshuffling of check so that it matches following line
 and is more clear it is a bounds check)
2025-01-10 11:59:15 +00:00
thecockatiel
ddb67d9bca fix: transaction.py: add extra check to script_GetOp 2025-01-10 11:59:11 +00:00
ThomasV
fefd123275 wallet: always include wanted_height (for future tx) 2025-01-10 10:41:54 +01:00
ghost43
2547ac4e30 Merge pull request #9412 from f321x/plugin_hash
Add filehash of external plugins to PluginDialog
2025-01-09 17:54:24 +00:00