1
0
Commit Graph

18810 Commits

Author SHA1 Message Date
SomberNight
b6e4ec8f95 mac build: fix broken symlinks inside .app, due to rm-ed qt parts
probably since qt6 migration many symlinks inside the .app in bundled PyQt were broken:
```
$ cp -r $HOME/electrum/dist/Electrum.app Electrum-ghost3.app
cp: /Users/vagrant/electrum/dist/Electrum.app/Contents/Resources/PyQt6/Qt6/lib/QtMultimediaQuick.framework/QtMultimediaQuick: No such file or directory
cp: /Users/vagrant/electrum/dist/Electrum.app/Contents/Resources/PyQt6/Qt6/lib/QtQuickTimeline.framework/QtQuickTimeline: No such file or directory
cp: /Users/vagrant/electrum/dist/Electrum.app/Contents/Resources/PyQt6/Qt6/lib/QtQuickControls2.framework/QtQuickControls2: No such file or directory
```
We were stripping out lots of datas/binaries from Qt from the mac build artifact, leaving behind dangling symlinks.

Instead of adding more hacks on top of the current hacks to also rm the dangling links, I tried to clean up this blacklisting.

There was no issue re the Windows build, no symlinks there, but I like to keep these two spec files in sync.

-----

Some numbers:
- mac:
  - without any exclusions at all, the mac .dmg is 80 MiB.
  - with these exclusions it is 57 MiB.
- win:
  - (haven't built without exclusions.)
  - with the previous stripping strategy, exes were 68M/68M/50M
  - with these exclusions, exes are 66M/66M/50M
2025-06-11 21:35:44 +00:00
SomberNight
2645456130 build: pyinstaller: add type hint imports for spec namespace stuff
see cef4d530e3/PyInstaller/building/build_main.py (L1189)
2025-06-11 21:35:41 +00:00
SomberNight
a042eb9eac mac build: take control of pip's caching mechanism
just like in e.g. appimage build
2025-06-11 18:15:08 +00:00
SomberNight
fc574b4c2f mac build: readme: add more sanity checks for repro 2025-06-11 16:54:15 +00:00
SomberNight
8398a8ae2e mac build: don't compile C extensions for "propcache"
makes build not reproducible

random temporary paths leak into a compiled .so:
dist_ghost43/Electrum.app/Contents/Resources/propcache/_helpers_c.cpython-312-darwin.so
2025-06-11 16:54:12 +00:00
SomberNight
376d5eb6e0 mac build: call "git describe" without "--dirty"
as we dirty the git clone ourselves, well the locale submodule, when we rm the .po files
2025-06-11 16:54:09 +00:00
ThomasV
1d7a5cbe16 android/build.sh: do not log password 2025-06-11 15:03:17 +02:00
ghost43
39371fb0e6 Merge pull request #9939 from f321x/allow_more_genesis_in_crash_reporter
allow testnet4 and signet in crash reporter
2025-06-11 12:34:01 +00:00
f321x
6a8478695d allow testnet4 and signet in crash reporter
allows to submit crash reports from testnet 4 and signet too in addition
to testnet3 and mainnet.
2025-06-11 14:14:49 +02:00
ThomasV
3f24cea5bb Merge pull request #9938 from f321x/fix_history_export
fix: update do_export_history to use wallet.get_full_history
2025-06-11 13:12:18 +02:00
ThomasV
213d182f30 Merge pull request #9933 from f321x/prevent_fail_swap_exception
fix: prevent KeyError if _fail_swap gets called multiple times
2025-06-11 13:09:52 +02:00
f321x
8b15d64dc9 fix: prevent KeyError if _fail_swap gets called multiple times
If `_fail_swap()` gets called multiple times (e.g. from callbacks) this
would race a `KeyError` as the swap got already popped from
`self._swaps`.
In theory `_fail_swap` unregisters itself from the lnwatcher callback
but the callback may is scheduled multiple times before it has the
chance to unregister itself.
2025-06-11 11:37:24 +02:00
f321x
86183797db fix: update do_export_history to use wallet.get_full_history
`do_export_history()` which is used by the qt history export function was
broken as it used a method that did not exist anymore.
this updates `do_export_history()` to use `get_full_history()` and also
adds support for payment grouping and lightning transactions to the
generated CSV file.
2025-06-11 11:03:57 +02:00
ghost43
e30392cd16 Merge pull request #9934 from f321x/matplotlib_warning
qt: provide more detailed warning for plot feature, change matplotlib backend
2025-06-10 18:41:42 +00:00
ThomasV
b8761ca006 payserver plugin: fix config var names 2025-06-10 20:39:14 +02:00
SomberNight
af01cba5f7 fix macos build: pyinstaller.spec: copy_metadata was undefined
regression from aecc22dc08
2025-06-10 18:33:29 +00:00
ghost43
448cbc7869 Merge pull request #9936 from f321x/nwc_incoming_event_filtering
plugin: nwc: improve filtering of expired requests
2025-06-10 18:32:13 +00:00
SomberNight
52e8675dd1 build: bump electrum-aionostr to 0.0.11 2025-06-10 18:31:46 +00:00
f321x
0f442f4c85 plugin: nwc: improve filtering of expired requests
improve the filtering of incoming requests by checking if they have
explicitly set an expiration tag. If so, they will only be ignored if
this timestamp is exceeded. Otherwise requests older than 30 secons will
get ignored and an error will get sent to the client so the client is
aware it's request arrived too late.
This is done to prevent handling requests the user may already expects
to have failed.
2025-06-10 19:29:19 +02:00
SomberNight
47e76b25b1 swaps: add some type hints, and force kwargs 2025-06-10 16:20:43 +00:00
SomberNight
2fb4debc7c commands: fix normal_swap cmd 2025-06-10 16:20:39 +00:00
SomberNight
527d9e8215 plugins: nwc: clean-up imports
Try to follow PEP-8 import grouping, to make things readable.
I want to be able to quickly spot 3rd-party library imports! :P
2025-06-10 15:22:13 +00:00
SomberNight
dd7a284fd9 plugins: nwc: fix constants.net import
"# don't import net directly, import the module instead (so that net is singleton)"

set_as_network does not work if net is not a singleton, it results in a split worldview.
2025-06-10 15:22:10 +00:00
SomberNight
65bc28056c plugins: psbt_nostr: trivial rename
pycharm static analyser was getting confused and thinking this line was rebinding "_" from i18n._
(but AFAICT that's a bug in the static analyser)
2025-06-10 15:01:27 +00:00
SomberNight
f846a16f07 plugins: psbt_nostr: add comment about testnet/mainnet separation 2025-06-10 15:01:24 +00:00
SomberNight
bbe3350937 plugins: psbt_nostr: use wallet.up_to_date_changed_event 2025-06-10 15:01:20 +00:00
f321x
dc3406d561 change matplotlib backend from qt5agg to QtAgg
according to the matplotlib docs
(https://matplotlib.org/stable/api/backend_qt_api.html) specifing the
exact qt version is depreceated and from now on only QtAgg should be
specified for the qt backend.
2025-06-10 16:14:04 +02:00
f321x
229219da9c qt: provide clearer warning for plot feature
this warning is more detailed and explains the user why the plotting
feature is not available to prevent confusion.
2025-06-10 16:03:30 +02:00
ghost43
724ddf0b41 Merge pull request #9930 from SomberNight/202506_iface_headers_backwards
interface: start headers backwards search with small delta
2025-06-10 12:25:05 +00:00
ThomasV
bb5aebebdd release notes: minor changes 2025-06-10 14:01:42 +02:00
ThomasV
2dfe3cf6d8 txbatcher: add comment about batch_input.pop 2025-06-10 13:30:47 +02:00
ThomasV
660b97c906 follow-up prev: show the plugin dialog 2025-06-10 11:32:39 +02:00
ThomasV
32f5184493 Merge pull request #9932 from f321x/disable_unavailable_plugins
plugins: disable "Enable" button of unavailable plugins in PluginsDialog
2025-06-10 11:26:02 +02:00
f321x
df66126389 disable "Enable" button of unavailable plugins
this changes PluginsDialog to disable the "Enable" button of plugins
that are missing dependencies (e.g. amodem) instead of not showing them
at all. A tooltip is shown explaining the user why the plugin is
disabled.
2025-06-10 11:19:55 +02:00
ThomasV
630124136e plugins dialog: fix is_available, do not show plugins that are not available 2025-06-10 11:02:18 +02:00
ThomasV
86f3eec8e6 fix user-facing exception refreshing history after swap is refunded
(txbatcher first adds the tx unsigned)
2025-06-10 10:44:10 +02:00
ThomasV
15e77d2d80 Merge pull request #9929 from f321x/swapserver_icon
qt: show deterministic colors for swapservers
2025-06-10 09:57:36 +02:00
ThomasV
e6ba90f219 Merge pull request #9928 from f321x/swap_fee_slider
swaps: use eta:2 instead of config fee policy in qml, disable qt fee slider on reverse swaps
2025-06-10 09:51:00 +02:00
f321x
6af54866c9 qt: show deterministic colors for swapservers
shows a little color icon which generated deterministically from
the server pubkey for easier differentiation.
2025-06-10 09:49:03 +02:00
SomberNight
c2e8188568 tests: test_network: add more header chain resolution test cases 2025-06-09 20:31:05 +00:00
SomberNight
eb69b6b516 interface: _search_headers_backwards: start at small delta
- interface.tip is the server's tip.
- consider scenario:
  - client has chain len 800_000, is up to date
  - client goes offline
  - suddenly there is a short reorg
      e.g. blocks 799_998, 799_999, 800_000 are reorged
  - client was offline for long time, finally comes back online again
  - server tip is 1_000_000, tip_header does not connect to client's local chain
  - PREVIOUSLY before commit, client would start backwards search
    - first it asks for header 800_001, which does not connect
    - then client asks for header ~600k, which checks
    - client will do long binary search to find the forkpoint
  - AFTER commit, client starts backwards search
    - first it asks for header 800_001, which does not connect
    - then client asks for header 799_999, etc
- that is, previously, on average, client did a short backwards search, followed by a long binary search
- now, on average, client does a longer backwards search, followed by a shorter binary search
  - this works much nicer with the headers_cache
  (- and thomasv said the old behaviour was not intentional)
2025-06-09 19:34:37 +00:00
SomberNight
02c6e118f0 tests: test_network: intro MockBlockchain. rewrite tests to use it.
interface.py no longer has knowledge about mocking! :P
2025-06-09 19:34:34 +00:00
SomberNight
cb1789a59c tests: test_network: try to explain test cases
no functional changes
2025-06-09 17:57:36 +00:00
SomberNight
09e412baf8 tests: enable verbose stderr logging
note: print() statements and stderr logging don't have a consistent printing order.
Either can buffer log lines and flush them later, and the buffers are independent.
2025-06-09 17:40:27 +00:00
SomberNight
ffb12b2833 tests: test_network: shorten lines 2025-06-09 17:22:49 +00:00
ThomasV
2b8a0d5a1d Merge pull request #9927 from SomberNight/202506_gui_swapserver_pubkey
gui: "Choose Swap Provider" screen: show hex pubkey, and longer prefix
2025-06-09 17:53:20 +02:00
SomberNight
9016c36df0 tests: test_network.py: rm test_fork_conflict, no longer applicable
Just prior to this commit, test_fork_conflict and test_fork_noconflict were essentially identical copies.
The only diff was that test_fork_conflict set the global blockchain.blockchains,
but this was not even affecting its behaviour anymore.

Originally when this test was added, we had the concept of chain fork conflicting with each other:
we could not handle three-way chain-splits. As in, there could only be a single fork forking away
from the main chain at any given height.
see 7221fb3231

However, this restriction was removed and generalised later:
141ff99580
After which the "test_fork_conflict" test did not make sense anymore.
2025-06-09 15:46:02 +00:00
ghost43
0d83e5690f Merge pull request #9926 from SomberNight/202506_iface_headers3
interface: faster chain resolution: add headers_cache
2025-06-09 15:37:41 +00:00
f321x
37181cd3a8 disable qt swap fee slider on reverse swaps, change eta
disables the fee slider in the swap dialog for reverse swaps as the tx
fee for claiming is not configurable by the user. Also replaces calls to
`sm.get_swap_tx_fee()` with `sm.get_fee_for_txbatcher()` as this is the
correct fee estimate for claim transactions, instead of the config fee
eta used by `get_swap_tx_fee()`.
2025-06-09 17:36:38 +02:00
SomberNight
dbb9673139 interface: faster chain resolution: add headers_cache
We try to predict the next headers the interface will ask for,
and request them ahead of time, to be kept in the headers_cache.

This saves network latency/round-trips, for a bit more memory usage
and in some cases for more bandwidth.
Note that due to PaddedRSTransport.WAIT_FOR_BUFFER_GROWTH_SECONDS,
latency saved here can be longer than "real" network latency.

This speeds up
- binary search greatly,
- backwards search to a small degree
  (although not that much as its algorithm should be changed a bit to make it cache-friendly)
- catch-up greatly, if it's <10 blocks behind

What remains is to speed up catch-up in case we are behind by many thousands of block.
That behaviour is left unchanged here. The issue there is that we request chunks sequentially.
So e.g. 1 chunk (2016 blocks) per 1 second.
2025-06-09 15:36:04 +00:00