Skip to content

Commit 50ae633

Browse files
committed
Merge branch 'master' of https://github.com/spesmilo/electrum
� Conflicts: � contrib/android/Readme.md � electrum_vtc/gui/kivy/uix/dialogs/cpfp_dialog.py � electrum_vtc/gui/qt/__init__.py � electrum_vtc/tests/test_wallet_vertical.py � electrum_vtc/version.py � run_electrum
2 parents 9e07984 + 6346112 commit 50ae633

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+513
-241
lines changed

RELEASE-NOTES

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# Release 4.2.1 - (March 26, 2022)
2+
* Binaries:
3+
- Windows: we are dropping support for Windows 7. (#7728)
4+
Version 4.2.0 already unintentionally broke compatibility with
5+
Win7 and there is no easy way to restore and maintain support.
6+
Existing users can keep using version 4.1.5 for now, but should
7+
consider upgrading or changing their OS.
8+
Win8.1 still works but only Win10 is regularly tested.
9+
- bump bundled Python version (win, mac, appimage) to 3.9.11,
10+
(android) to 3.8.13 (1bb7ef92, #7721)
11+
(note these include a fix to an openssl DOS-vector CVE-2022-0778)
12+
- windows: bump pyinstaller to 4.10 and wine to 7.0 (#7721)
13+
* Kivy GUI:
14+
- fix "Child Pays For Parent" not working on Android (#7723)
15+
- revert to defaulting the UI language to English (25fee6a6)
16+
* Qt GUI:
17+
- macOS: fix opening "Preferences" segfaulting for some (#7725)
18+
- more resilient startup: better error-handling and fallback (#7447)
19+
* Library:
20+
- fix LN error/warning message-handling, and fix regression that
21+
errors during channel-open were not properly shown in GUI (a92dede4)
22+
- during LN chan open, do not backup wallet automatically (#7733)
23+
- Imported wallets: fix delete_address rm-ing too many txs (#7587)
24+
- fix potential deadlock in wallet.py (d3476b6b)
25+
* Hardware wallets:
26+
- ledger: add progress indicator to sign_transaction (#7516)
27+
* fix the "--portable" flag for AppImage, and for pip installs (#7732)
28+
29+
130
# Release 4.2.0 - (March 16, 2022)
231
* The minimum python version was increased to 3.8 (#7661)
332
* Lightning:

contrib/add_cosigner

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
#!/usr/bin/python3
2+
#
3+
# This script is part of the workflow for BUILDERs to reproduce and sign the
4+
# release binaries. (for builders who do not have sftp access to "electrum-downloads-airlock")
5+
#
6+
# - BUILDER builds all binaries and checks they match the official releases
7+
# (using release.sh, and perhaps some manual steps)
8+
# - BUILDER creates a PR against https://github.com/spesmilo/electrum-signatures/
9+
# to add their sigs for a given release, which then gets merged
10+
# - SFTPUSER runs `$ electrum/contrib/add_cosigner $BUILDER`
11+
# - SFTPUSER runs `$ SSHUSER=$SFTPUSER electrum/contrib/upload`
12+
# - SFTPUSER runs `$ electrum/contrib/make_download $WWW_DIR`
13+
# - $ (cd $WWW_DIR; git commit -a -m "add_cosigner"; git push)
14+
# - SFTPUSER runs `$ electrum-web/publish.sh $SFTPUSER`
15+
# - (for the website to be updated, both ThomasV and SomberNight needs to run publish.sh)
16+
217
import re
318
import os
419
import sys

contrib/android/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@ RUN chown ${USER} /opt
145145
USER ${USER}
146146

147147

148+
COPY contrib/deterministic-build/requirements-build-base.txt /opt/deterministic-build/
148149
COPY contrib/deterministic-build/requirements-build-android.txt /opt/deterministic-build/
149-
RUN python3 -m pip install --no-dependencies --user \
150+
RUN python3 -m pip install --no-build-isolation --no-dependencies --user \
151+
-r /opt/deterministic-build/requirements-build-base.txt
152+
RUN python3 -m pip install --no-build-isolation --no-dependencies --user \
150153
-r /opt/deterministic-build/requirements-build-android.txt
151154

152155
# install buildozer
@@ -157,7 +160,7 @@ RUN cd /opt \
157160
&& git fetch --all \
158161
# commit: from branch sombernight/electrum_20210421
159162
&& git checkout "d570116e88184b0eca0c6b59a25edd49d977da23^{commit}" \
160-
&& python3 -m pip install --no-dependencies --user -e .
163+
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e .
161164

162165
# install python-for-android
163166
RUN cd /opt \
@@ -168,7 +171,7 @@ RUN cd /opt \
168171
&& git fetch --all \
169172
# commit: from branch accumulator/qt5-wip
170173
&& git checkout "ebbe8dcc271e36468666feb98f936d0a96936cf2^{commit}" \
171-
&& python3 -m pip install --no-dependencies --user -e .
174+
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e .
172175

173176
# build env vars
174177
ENV USE_SDK_WRAPPER=1

contrib/android/Readme.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ To generate an APK file, follow these instructions.
55

66
## Android binary with Docker
77

8-
_These binaries should be reproducible.
8+
_These binaries should be reproducible, meaning you should be able to generate
9+
binaries that match the official releases._
910

1011
This assumes an Ubuntu (x86_64) host, but it should not be too hard to adapt to another
1112
similar system.
@@ -16,13 +17,20 @@ similar system.
1617

1718
2. Build binaries (Note that this only works for debug builds! Otherwise the security model of Android does not let you access the internal storage of an app without root)
1819

20+
The build script takes a few arguments. To see syntax, run it without providing any:
1921
```
2022
$ ./build.sh debug
2123
```
22-
If you want reproducibility, try instead e.g.:
24+
For development, consider e.g. `$ ./build.sh kivy arm64-v8a debug`
25+
26+
If you want reproducibility, try instead e.g.:
2327
```
2428
$ ELECBUILD_COMMIT=HEAD ELECBUILD_NOCACHE=1 ./build.sh debug
2529
```
30+
31+
Note: `build.sh` takes an optional parameter which can be
32+
`release`, `release-unsigned`, or `debug` (default).
33+
2634
2735
3. The generated binary is in `./dist`.
2836
@@ -43,6 +51,7 @@ similar system.
4351
$ adb shell run-as org.electrum.electrum cp /data/local/tmp/verthash.dat /data/data/org.electrum.electrum/files/app
4452
```
4553
54+
4655
## FAQ
4756
4857
### I changed something but I don't see any differences on the phone. What did I do wrong?
@@ -89,6 +98,15 @@ Build atlas: `(cd contrib/android/; make theming)`
8998
9099
Run electrum with the `-g` switch: `electrum -g kivy`
91100
101+
### debug vs release build
102+
If you just follow the instructions above, you will build the apk
103+
in debug mode. The most notable difference is that the apk will be
104+
signed using a debug keystore. If you are planning to upload
105+
what you build to e.g. the Play Store, you should create your own
106+
keystore, back it up safely, and run `./contrib/make_apk release`.
107+
108+
See e.g. [kivy wiki](https://github.com/kivy/kivy/wiki/Creating-a-Release-APK)
109+
and [android dev docs](https://developer.android.com/studio/build/building-cmdline#sign_cmdline).
92110
93111
### Access datadir on Android from desktop (e.g. to copy wallet file)
94112
Note that this only works for debug builds! Otherwise the security model
@@ -99,3 +117,22 @@ $ adb shell
99117
$ run-as org.electrum.electrum ls /data/data/org.electrum.electrum/files/data
100118
$ run-as org.electrum.electrum cp /data/data/org.electrum.electrum/files/data/wallets/my_wallet /sdcard/some_path/my_wallet
101119
```
120+
121+
### How to investigate diff between binaries if reproducibility fails?
122+
```
123+
cd dist/
124+
unzip Electrum-*.apk1 -d apk1
125+
mkdir apk1/assets/private_mp3/
126+
tar -xzvf apk1/assets/private.mp3 --directory apk1/assets/private_mp3/
127+
128+
unzip Electrum-*.apk2 -d apk2
129+
mkdir apk2/assets/private_mp3/
130+
tar -xzvf apk2/assets/private.mp3 --directory apk2/assets/private_mp3/
131+
132+
sudo chown --recursive "$(id -u -n)" apk1/ apk2/
133+
chmod -R +Xr apk1/ apk2/
134+
$(cd apk1; find -type f -exec sha256sum '{}' \; > ./../sha256sum1)
135+
$(cd apk2; find -type f -exec sha256sum '{}' \; > ./../sha256sum2)
136+
diff sha256sum1 sha256sum2 > d
137+
cat d
138+
```

contrib/android/make_apk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ elif [[ "$3" == "release-unsigned" ]] ; then
5555
# do release build, but do not sign the APKs.
5656
TARGET="release"
5757
elif [[ "$3" == "debug" ]] ; then
58-
# do debug build; the default.
58+
# do debug build.
5959
TARGET="apk"
6060
export P4A_DEBUG_KEYSTORE="$CONTRIB_ANDROID"/android_debug.keystore
6161
export P4A_DEBUG_KEYSTORE_PASSWD=unsafepassword

contrib/android/p4a_recipes/hostpython3/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212

1313
class HostPython3RecipePinned(util.InheritedRecipeMixin, HostPython3Recipe):
14-
version = "3.8.12"
15-
sha512sum = "f7227c9d82c37a3f21d4e4ec352b75424d8103b5144e7accec13dca626c79268db76143782629131525a07bb026630e55fccd4381bd78990b3561cc565681190"
14+
version = "3.8.13"
15+
sha512sum = "e57f5f5b441e46a742b0147dd7fbfa6b52d550a86e60c9765ecc3c4690e2cdedf197e151c07cd2ea1f75ed9022a2b8ce4850c3d65916eaede1db6feed40b52f6"
1616

1717

1818
recipe = HostPython3RecipePinned()

contrib/android/p4a_recipes/python3/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212

1313
class Python3RecipePinned(util.InheritedRecipeMixin, Python3Recipe):
14-
version = "3.8.12"
15-
sha512sum = "f7227c9d82c37a3f21d4e4ec352b75424d8103b5144e7accec13dca626c79268db76143782629131525a07bb026630e55fccd4381bd78990b3561cc565681190"
14+
version = "3.8.13"
15+
sha512sum = "e57f5f5b441e46a742b0147dd7fbfa6b52d550a86e60c9765ecc3c4690e2cdedf197e151c07cd2ea1f75ed9022a2b8ce4850c3d65916eaede1db6feed40b52f6"
1616

1717

1818
recipe = Python3RecipePinned()

contrib/build-linux/appimage/make_appimage.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PIP_CACHE_DIR="$CACHEDIR/pip_cache"
1414
export GCC_STRIP_BINARIES="1"
1515

1616
# pinned versions
17-
PYTHON_VERSION=3.9.10
17+
PYTHON_VERSION=3.9.11
1818
PKG2APPIMAGE_COMMIT="eb8f3acdd9f11ab19b78f5cb15daa772367daf15"
1919

2020

@@ -38,7 +38,7 @@ download_if_not_exist "$CACHEDIR/appimagetool" "https://github.com/AppImage/AppI
3838
verify_hash "$CACHEDIR/appimagetool" "df3baf5ca5facbecfc2f3fa6713c29ab9cefa8fd8c1eac5d283b79cab33e4acb"
3939

4040
download_if_not_exist "$CACHEDIR/Python-$PYTHON_VERSION.tar.xz" "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz"
41-
verify_hash "$CACHEDIR/Python-$PYTHON_VERSION.tar.xz" "0a8fbfb5287ebc3a13e9baf3d54e08fa06778ffeccf6311aef821bb3a6586cc8"
41+
verify_hash "$CACHEDIR/Python-$PYTHON_VERSION.tar.xz" "66767a35309d724f370df9e503c172b4ee444f49d62b98bc4eca725123e26c49"
4242

4343

4444

@@ -110,22 +110,24 @@ info "preparing electrum-locale."
110110

111111

112112
info "Installing build dependencies."
113-
"$python" -m pip install --no-dependencies --no-binary :all: --no-warn-script-location \
113+
"$python" -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
114+
--cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-build-base.txt"
115+
"$python" -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
114116
--cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-build-appimage.txt"
115117

116118
info "installing electrum and its dependencies."
117119
# note: we prefer compiling C extensions ourselves, instead of using binary wheels,
118120
# hence "--no-binary :all:" flags. However, we specifically allow
119121
# - PyQt5, as it's harder to build from source
120122
# - cryptography, as building it would need openssl 1.1, not available on ubuntu 16.04
121-
"$python" -m pip install --no-dependencies --no-binary :all: --no-warn-script-location \
123+
"$python" -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
122124
--cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements.txt"
123-
"$python" -m pip install --no-dependencies --no-binary :all: --only-binary PyQt5,PyQt5-Qt5,cryptography --no-warn-script-location \
125+
"$python" -m pip install --no-build-isolation --no-dependencies --no-binary :all: --only-binary PyQt5,PyQt5-Qt5,cryptography --no-warn-script-location \
124126
--cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-binaries.txt"
125-
"$python" -m pip install --no-dependencies --no-binary :all: --no-warn-script-location \
127+
"$python" -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
126128
--cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-hw.txt"
127129

128-
"$python" -m pip install --no-dependencies --no-warn-script-location \
130+
"$python" -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
129131
--cache-dir "$PIP_CACHE_DIR" "$PROJECT_ROOT"
130132

131133
# was only needed during build time, not runtime
@@ -199,7 +201,7 @@ PYDIR="$APPDIR"/usr/lib/python3.9
199201
rm -rf "$PYDIR"/{test,ensurepip,lib2to3,idlelib,turtledemo}
200202
rm -rf "$PYDIR"/{ctypes,sqlite3,tkinter,unittest}/test
201203
rm -rf "$PYDIR"/distutils/{command,tests}
202-
rm -rf "$PYDIR"/config-3.9m-x86_64-linux-gnu
204+
rm -rf "$PYDIR"/config-3.*-x86_64-linux-gnu
203205
rm -rf "$PYDIR"/site-packages/{opt,pip,setuptools,wheel}
204206
rm -rf "$PYDIR"/site-packages/Cryptodome/SelfTest
205207
rm -rf "$PYDIR"/site-packages/{psutil,qrcode,websocket}/tests

contrib/build-wine/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ RUN wget -nc https://dl.winehq.org/wine-builds/Release.key && \
4545
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ && \
4646
apt-get update -q && \
4747
apt-get install -qy \
48-
wine-stable-amd64:amd64=6.0.2~focal-1 \
49-
wine-stable-i386:i386=6.0.2~focal-1 \
50-
wine-stable:amd64=6.0.2~focal-1 \
51-
winehq-stable:amd64=6.0.2~focal-1 \
48+
wine-stable-amd64:amd64=7.0.0.0~focal-1 \
49+
wine-stable-i386:i386=7.0.0.0~focal-1 \
50+
wine-stable:amd64=7.0.0.0~focal-1 \
51+
winehq-stable:amd64=7.0.0.0~focal-1 \
5252
&& \
5353
rm -rf /var/lib/apt/lists/* && \
5454
apt-get autoremove -y && \

contrib/build-wine/README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Windows binaries
2-
================
1+
# Windows binaries
32

43
_These binaries should be reproducible, meaning you should be able to generate
54
binaries that match the official releases._
@@ -29,8 +28,7 @@ similar system.
2928
3029
3130
32-
Code Signing
33-
============
31+
## Code Signing
3432
3533
Electrum Windows builds are signed with a Microsoft Authenticode™ code signing
3634
certificate in addition to the GPG-based signatures.
@@ -57,8 +55,7 @@ certificate/key) and one or multiple trusted verifiers:
5755
5856
5957
60-
Verify Integrity of signed binary
61-
=================================
58+
## Verify Integrity of signed binary
6259
6360
Every user can verify that the official binary was created from the source code in this
6461
repository. To do so, the Authenticode signature needs to be stripped since the signature
@@ -73,3 +70,20 @@ This procedure removes the differences between the signed and unsigned binary:
7370
of 8.
7471
7572
The script `unsign.sh` performs these steps.
73+
74+
## FAQ
75+
76+
### How to investigate diff between binaries if reproducibility fails?
77+
`pyi-archive_viewer` is needed, for that run `$ pip install pyinstaller`.
78+
As a first pass overview, run:
79+
```
80+
pyi-archive_viewer -l electrum-*.exe1 > f1
81+
pyi-archive_viewer -l electrum-*.exe2 > f2
82+
diff f1 f2 > d
83+
cat d
84+
```
85+
Then investigate manually:
86+
```
87+
$ pyi-archive_viewer electrum-*.exe1
88+
? help
89+
```

0 commit comments

Comments
 (0)