Note that this will not fix the value for already existing channels
that have been created with onchain backup; one would need a wallet_db
upgrade in order to fix them (probably not worth the effort).
- use_recoverable_channel is a user setting, available
only in standard wallets with a 'segwit' seed_type
- if enabled, 'lightning_xprv' is derived from seed
- otherwise, wallets use the existing 'lightning_privkey2'
Recoverable channels:
- channel recovery data is added funding tx using an OP_RETURN
- recovery data = 4 magic bytes + node id[0:16]
- recovery data is chacha20 encrypted using funding_address as nonce.
(this will allow to fund multiple channels in the same tx)
GUI:
- whether channels are recoverable is shown in wallet info dialog.
- if the wallet can have recoverable channels but has an old node_id,
users are told to close their channels and restore from seed
to have that feature.
Pre kivy 2.0, "orientation" was undefined for GridLayouts, not sure why we were setting it, it was a no-op.
kivy 2.0 added meaning to the field, and the values we were setting it to are invalid.
related:
https://github.com/kivy/kivy/pull/6741https://github.com/kivy/kivy/issues/7142
-----
traceback:
E | gui.kivy.uix.dialogs.crash_reporter.ExceptionHook | exception caught by crash reporter
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 705, in _apply_rule
setattr(widget_set, key, value)
File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
File "kivy/properties.pyx", line 498, in kivy.properties.Property.__set__
File "kivy/properties.pyx", line 542, in kivy.properties.Property.set
File "kivy/properties.pyx", line 533, in kivy.properties.Property.set
File "kivy/properties.pyx", line 1253, in kivy.properties.OptionProperty.check
ValueError: GridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "kivy/_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events
File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/ui_screens/receive.kv", line 141, in <lambda>
on_release: Clock.schedule_once(lambda dt: s.expiration_dialog(s))
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 517, in expiration_dialog
d = ChoiceDialog(_('Expiration date'), pr_expiration_values, self.expiry(), callback)
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/dialogs/choice_dialog.py", line 53, in __init__
Factory.Popup.__init__(self)
File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/modalview.py", line 187, in __init__
super(ModalView, self).__init__(**kwargs)
File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/anchorlayout.py", line 68, in __init__
super(AnchorLayout, self).__init__(**kwargs)
File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/layout.py", line 76, in __init__
super(Layout, self).__init__(**kwargs)
File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/widget.py", line 359, in __init__
self.apply_class_lang_rules(
File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/widget.py", line 463, in apply_class_lang_rules
Builder.apply(
File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 541, in apply
self._apply_rule(
File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 710, in _apply_rule
raise BuilderException(rule.ctx, rule.line,
kivy.lang.builder.BuilderException: Parser: File "<inline>", line 21:
...
19: GridLayout:
20: row_default_height: '48dp'
>> 21: orientation: 'vertical'
22: id: choices
23: cols: 2
...
ValueError: GridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']
File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 705, in _apply_rule
setattr(widget_set, key, value)
File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
File "kivy/properties.pyx", line 498, in kivy.properties.Property.__set__
File "kivy/properties.pyx", line 542, in kivy.properties.Property.set
File "kivy/properties.pyx", line 533, in kivy.properties.Property.set
File "kivy/properties.pyx", line 1253, in kivy.properties.OptionProperty.check
- trampoline is enabled by default in config, to prevent download of `gossip_db`.
(if disabled, `gossip_db` will be downloaded, regardless of the existence of channels)
- if trampoline is enabled:
- the wallet can only open channels with trampoline nodes
- already-existing channels with non-trampoline nodes are frozen for sending.
- there are two types of trampoline payments: legacy and end-to-end (e2e).
- we decide to perform legacy or e2e based on the invoice:
- we use trampoline_routing_opt in features to detect Eclair and Phoenix invoices
- we use trampoline_routing_hints to detect Electrum invoices
- when trying a legacy payment, we add a second trampoline to the path to preserve privacy.
(we fall back to a single trampoline if the payment fails for all trampolines)
- the trampoline list is hardcoded, it will remain so until `trampoline_routing_opt` feature flag is in INIT.
- there are currently only two nodes in the hardcoded list, it would be nice to have more.
- similar to Phoenix, we find the fee/cltv by trial-and-error.
- if there is a second trampoline in the path, we use the same fee for both.
- the final spec should add fee info in error messages, so we will be able to fine-tune fees
Main motivation is that I often use wallet.remove_transaction
from the Qt console, and would find this behaviour more intuitive.
Note that previously if one were to call this on a tx with children,
the crash reporter would appear with "wallet.get_history() failed balance sanity-check".
related: https://github.com/spesmilo/electrum/issues/6960#issuecomment-764716533