1
0
Commit Graph

18053 Commits

Author SHA1 Message Date
SomberNight
a3fc43cc2d qml: remove dependency "Pillow" (and its transitive deps)
closes https://github.com/spesmilo/electrum/issues/9572
2025-02-20 18:53:08 +00:00
ThomasV
ea4adbb4d6 Merge pull request #9573 from f321x/simplify_subswap_fee
Simplify submarine swap onchain fee model to single base fee 'mining_fee'
2025-02-20 18:42:56 +01:00
ThomasV
d714ef130a Merge pull request #9039 from accumulator/onion_messages
onion messages
2025-02-20 18:12:40 +01:00
ThomasV
7eec7e6a20 increase sleep time in TestOnionMessageManager.test_forward
Co-authored-by: ghost43 <somber.night@protonmail.com>
2025-02-20 18:05:21 +01:00
accumulator
6996574c8e Update electrum/onion_message.py _get_request_for_path_id return type
Co-authored-by: ghost43 <somber.night@protonmail.com>
2025-02-20 17:17:14 +01:00
f321x
6f97b7b5f9 simplify submarine swap onchain fee model to single base fee 2025-02-20 16:51:48 +01:00
ThomasV
0bbdad3efa lnsweep: sweep_our_ctx was returning redundant objects 2025-02-20 15:34:57 +01:00
ThomasV
f9c427124d qml: fix follow-up 392c219913 2025-02-20 09:38:47 +01:00
Sander van Grieken
ad6eb73dd3 onion_messages: guard onion message forwarding behind config option
EXPERIMENTAL_LN_FORWARD_PAYMENTS (default False)
2025-02-20 00:31:36 +01:00
Sander van Grieken
c3c5aaab3d onion_messages: add tests for forwards, receive unsolicited. 2025-02-19 17:43:36 +01:00
SomberNight
19b2536da2 wallet: add method "can_rbf_tx"
from https://github.com/spesmilo/electrum/pull/8821
2025-02-19 16:10:52 +00:00
SomberNight
2d6ad49a38 github: migrate to new-style issue templates 2025-02-19 15:51:59 +00:00
Sander van Grieken
0b86e39121 onion_messages: additional checks and comments;
- check on initial_node_id as the type can in theory contain a sciddir.
- log allowed_features if present in recipient_data, with an additional comment describing
the handling of allowed_features in the future.
- document the SHOULD constraint on onion_message payload size
2025-02-19 14:29:50 +01:00
Sander van Grieken
560b244b4d onion_messages: replace more hardcoded test vector values with symbols 2025-02-19 14:29:50 +01:00
Sander van Grieken
f9a374729e onion_messages: generalize List parameter typing to more abstract Sequence 2025-02-19 14:29:50 +01:00
Sander van Grieken
6e35ffe4b5 lnmsg: support both primitive and complex types (subtypes) in LNSerializer.
This renames lnmsg._{read,write}_field to lnmsg._{read,write}_primitive_field, renames
LNSerializer._{read,write}_complex_type to LNSerializer.{read,write}_field and allows
LNSerializer.{read,write}_field to handle both primitive and complex types.

Also makes these funcs public, as these encodings are used outside of lnmsg as well
(e.g. encoding blinded paths in BOLT12 invoice_request)
2025-02-19 14:29:50 +01:00
Sander van Grieken
e216f1b324 onion_messages: add parameter typing and comments 2025-02-19 14:29:50 +01:00
ThomasV
71b9761981 onion_messages_manager:
- use namedtuple instead of dict for pending messages
 - use asyncio.Future instead of event and result
2025-02-19 14:29:50 +01:00
ThomasV
d814796484 Deobfuscate names
The name 'requestreply' do not mean anything. If something can either
be a request or a reply, perhaps we can call it 'message', instead of
introducing a new name?

In general, coming up with new names comes at a cost, because you
are forcing other developers to learn and use your terminology.
Please minimize that.
2025-02-19 14:29:50 +01:00
ThomasV
aeaec452a0 Remove unnecessary events
We do not need asyncio Events in order to signal that a queue is
empty. Instead, we should use asyncio queues.
2025-02-19 14:29:34 +01:00
ThomasV
86432f55ee Remove redundant code: this line is duplicated 2 lines below 2025-02-19 14:29:34 +01:00
ThomasV
3314ee1de1 test_onion_messages: cleanup time constants, make speedup homogeneous.
1. Do not pass request_reply_timeout and request_reply_retry_delay
to OnionMessageManager.

Arguments passed to a function are useful only if their value might
change during the execution of a program. If that is not the case,
it is preferable to define them as constants. That makes the code
easier to read, because the reader can focus on arguments that are
actually relevant.

2 . Multiply all time constants by the same factor, instead
of doing so incompletely and on a per parameter basis. (note
that before this commit, the speedup factor was not consistent)

3. Do not use util.now(), because it is rounded as integer.

With these changes, the tests can effectively run with a 100x speedup
2025-02-19 14:29:34 +01:00
ThomasV
4efd4a0ff7 test_onion_message: enable logging so that we can see what is going on 2025-02-19 14:29:34 +01:00
ThomasV
a157108e75 onion_messages: fix code indentation 2025-02-19 14:29:34 +01:00
Sander van Grieken
7109c22317 unasync, no add_peer in create_onion_message_route_to, add manager tests 2025-02-19 14:29:34 +01:00
Sander van Grieken
7b4180202a add onion message support 2025-02-19 14:29:02 +01:00
Sander van Grieken
12ffbfc29e lnutil: add onion message feature flag 2025-02-19 14:28:11 +01:00
Sander van Grieken
7c8dfdecbb lnmsg: additional de/serialization support for onion messages
- add support for `subtype`/`subtypedata` type declarations
- add new primitive type `sciddir_or_pubkey`
- better assert message for cardinality errors
2025-02-19 14:27:47 +01:00
Sander van Grieken
00bba471ff onion_wire: use unqualified byte,... type for yet undefined nested tlv types 2025-02-19 14:27:45 +01:00
Sander van Grieken
dca6adcbf6 lnwire: add msg and tlv types for onion_message, including unknown_tags for test vectors 2025-02-19 14:27:36 +01:00
ThomasV
392c219913 simplify history-related commands:
- reduce number of methods
 - use nametuples instead of dicts
 - only two types: OnchainHistoryItem and LightningHistoryItem
 - channel open/closes are groups
 - move capital gains into separate RPC
2025-02-19 11:40:21 +01:00
SomberNight
ae8bfdcb51 qt: main_window: (trivial) fix typo on statusbar
a whitespace was missing
2025-02-18 15:36:27 +00:00
ghost43
3f9340270c Merge pull request #9568 from f321x/fix_node_ann_features
Ignore odd bits if even bit is set too in list_enabled_bits
2025-02-18 14:47:34 +00:00
f321x
9394b18b4e add method list_enabled_ln_feature_bits 2025-02-18 15:21:24 +01:00
ghost43
4f782fd687 Merge pull request #9566 from accumulator/lnworker_imports
lnworker: imports, whitespace
2025-02-17 15:01:31 +00:00
Sander van Grieken
c740057bc7 lnworker: imports, whitespace 2025-02-17 14:41:32 +01:00
ThomasV
18baf003d4 submarine swaps: backport changes from batch_payment_manager
- add 'is_funded' method to SwapData
 - sign claim transactions using the 'make_witness' method
2025-02-15 10:29:19 +01:00
SomberNight
2d8c26f211 qt swaps: fix _spend_max_reverse_swap: round down msats
Clicking "max" btn for a reverse swap was setting the text field to a too high value.

```
>>> wallet.lnworker.num_sats_can_send()
Decimal('1242647.947')
>>> util.format_satoshis_plain(Decimal('1242647.947'))
'0.01242648'
```
2025-02-14 14:33:51 +00:00
SomberNight
6749468866 swaps: add base class for transports. move "get_recent_offers" logic
the "get_recent_offers" logic is now shared between the GUIs
2025-02-14 14:10:24 +00:00
ThomasV
6ddd0b95ca workaround grouping bug with dummy values 2025-02-14 13:46:38 +01:00
ThomasV
5600e79edd fix swaps-over-nostr qml:
- post-rebase fixes
 - await sm.is_initalized.wait() instead of waiting 1 second
 - fix max_amount computation if channel recv capacity is higher
   than the max: the value returned by get_send_amount was zero
 - fix indentation
2025-02-14 10:57:01 +01:00
Sander van Grieken
993a575b7f submarine_swaps: implement swaps-over-nostr for qml 2025-02-14 09:54:09 +01:00
ThomasV
22995b4a34 follow-up 912e1a3a5b: password may be None if wallet is not file encrypted 2025-02-13 11:52:46 +01:00
ThomasV
c3faadf23f If a transaction uses make_witness, also set script_sig.
Other methods (remove_signatures) may have set script_sig to None
during the lifetime of the tx object.
2025-02-13 11:01:03 +01:00
ThomasV
b097150806 Merge pull request #9551 from f321x/swap_nostr_event_type
Change nostr swap event type, add PoW, rebroadcast events
2025-02-12 10:31:54 +01:00
f321x
a47421490d increase nonce size to 32 byte and make it hex in event 2025-02-12 10:09:11 +01:00
f321x
947094c1b0 add pow, more default relays, new event type 2025-02-11 18:16:15 +01:00
SomberNight
72c664856d qt gui: qrcodewidget: default size smaller for large codes
and use default sizing when displaying PSBTs.

Prior to this, when displaying a large PSBT (that should still fit within a QR),
the default window size was too small, and the user had to manually resize the window.
2025-02-10 18:32:09 +00:00
SomberNight
3de90952d1 tests: add a test for util.ShortID class 2025-02-10 16:36:19 +00:00
Sander van Grieken
36efae3875 imports, whitespace 2025-02-10 14:22:50 +01:00