From 6441d992797490a48538b7a3c78e3fa512a0bb29 Mon Sep 17 00:00:00 2001 From: malinero Date: Sun, 2 Oct 2022 09:46:06 +0200 Subject: [PATCH 01/18] Android: useRemoteNode default to true --- main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.qml b/main.qml index 4be6be0690..abf08edb11 100644 --- a/main.qml +++ b/main.qml @@ -1395,7 +1395,7 @@ ApplicationWindow { property bool historyShowAdvanced: false property bool historyHumanDates: true property string blockchainDataDir: "" - property bool useRemoteNode: false + property bool useRemoteNode: isAndroid property string remoteNodeAddress: "" // TODO: drop after v0.17.2.0 release property string remoteNodesSerialized: JSON.stringify({ selected: 0, From 8cf76cf7c27ee5c2cbfdf644c2518451ce0c3791 Mon Sep 17 00:00:00 2001 From: malinero Date: Sun, 2 Oct 2022 10:24:10 +0200 Subject: [PATCH 02/18] Android: hide mining tab --- pages/Advanced.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/Advanced.qml b/pages/Advanced.qml index 6aa8ac4650..e41390db98 100644 --- a/pages/Advanced.qml +++ b/pages/Advanced.qml @@ -52,6 +52,7 @@ ColumnLayout { active: state == "Mining" text: qsTr("Mining") + translationManager.emptyString onSelected: state = "Mining" + visible: !isAndroid } MoneroComponents.NavbarItem { active: state == "Prove" @@ -81,7 +82,7 @@ ColumnLayout { Layout.fillWidth: true Layout.preferredHeight: panelHeight color: "transparent" - state: "Mining" + state: isAndroid ? "Prove" : "Mining" onCurrentViewChanged: { if (previousView) { @@ -120,7 +121,7 @@ ColumnLayout { StackView { id: stackView - initialItem: stateView.miningView + initialItem: isAndroid ? stateView.prooveView : stateView.miningView anchors.fill: parent clip: false // otherwise animation will affect left panel From 499eeee59a890409700041d51e18143344c3105f Mon Sep 17 00:00:00 2001 From: malinero Date: Sun, 2 Oct 2022 10:24:39 +0200 Subject: [PATCH 03/18] Android: hide log tab --- pages/settings/Settings.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/settings/Settings.qml b/pages/settings/Settings.qml index fdf03ce6a5..414b61a105 100644 --- a/pages/settings/Settings.qml +++ b/pages/settings/Settings.qml @@ -74,6 +74,7 @@ ColumnLayout { active: settingsStateView.state == "Log" text: qsTr("Log") + translationManager.emptyString onSelected: settingsStateView.state = "Log" + visible: !isAndroid } MoneroComponents.NavbarItem { active: settingsStateView.state == "Info" From 22a15093163e1c50ec61d9840c4edf00c4bcdf21 Mon Sep 17 00:00:00 2001 From: malinero Date: Sun, 2 Oct 2022 10:24:58 +0200 Subject: [PATCH 04/18] Android: hide local node settings --- pages/settings/SettingsNode.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index ab3d49f1bb..e0ae009aea 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -55,6 +55,7 @@ Rectangle{ Layout.fillWidth: true Layout.preferredHeight: 90 color: "transparent" + visible: !isAndroid Rectangle { id: localNodeDivider From 7954661100dddcecbf472d7f470d4b5a57a59f25 Mon Sep 17 00:00:00 2001 From: malinero Date: Sun, 2 Oct 2022 10:39:31 +0200 Subject: [PATCH 05/18] Android: disable simple mode --- wizard/WizardModeSelection.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wizard/WizardModeSelection.qml b/wizard/WizardModeSelection.qml index 5411735c29..eb6b36d4a1 100644 --- a/wizard/WizardModeSelection.qml +++ b/wizard/WizardModeSelection.qml @@ -41,7 +41,7 @@ Rectangle { property alias pageHeight: pageRoot.height property string viewName: "wizardModeSelection1" property bool portable: persistentSettings.portable - property bool simpleModeAvailable: !isTails && appWindow.persistentSettings.nettype == 0 + property bool simpleModeAvailable: !isTails && appWindow.persistentSettings.nettype == 0 && !isAndroid function applyWalletMode(mode, wizardState) { if (!persistentSettings.setPortable(portable)) { From acf876f4b232d5d7aa6377be3d62b99c1a288e3f Mon Sep 17 00:00:00 2001 From: malinero Date: Sun, 11 Jul 2021 00:30:09 +0200 Subject: [PATCH 06/18] Docker android: avoid gradle auto download --- Dockerfile.android | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile.android b/Dockerfile.android index b077fb3f99..3ea401d7ce 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -206,6 +206,16 @@ RUN git clone -b v3.24.2 --depth 1 https://github.com/Kitware/CMake \ && PATH=${HOST_PATH} make -j${THREADS} install \ && rm -rf $(pwd) +RUN GRADLE_VERSION=5.6.4 \ + && GRADLE_HASH=1f3067073041bc44554d0efe5d402a33bc3d3c93cc39ab684f308586d732a80d \ + && wget -q https\://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip \ + && echo "${GRADLE_HASH} gradle-${GRADLE_VERSION}-bin.zip" | sha256sum -c \ + && GRADLE_LOCAL_PATH=gradle/wrapper/dists/gradle-${GRADLE_VERSION}-bin/bxirm19lnfz6nurbatndyydux \ + && mkdir -p ${GRADLE_LOCAL_PATH} \ + && mv gradle-${GRADLE_VERSION}-bin.zip ${GRADLE_LOCAL_PATH} + +ENV GRADLE_USER_HOME=${WORKDIR}/gradle + CMD set -ex \ && cd /monero-gui \ && mkdir -p build/Android/release \ From 83921a4bc8d44071e2c2b4841d5b0a02cf0e7475 Mon Sep 17 00:00:00 2001 From: selsta Date: Fri, 7 Oct 2022 02:00:28 +0200 Subject: [PATCH 07/18] main: update blockchain size --- main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.qml b/main.qml index 4be6be0690..dd3c8a9476 100644 --- a/main.qml +++ b/main.qml @@ -94,7 +94,7 @@ ApplicationWindow { readonly property string localDaemonAddress : "localhost:" + getDefaultDaemonRpcPort(persistentSettings.nettype) property string currentDaemonAddress; property int disconnectedEpoch: 0 - property int estimatedBlockchainSize: persistentSettings.pruneBlockchain ? 40 : 105 // GB + property int estimatedBlockchainSize: persistentSettings.pruneBlockchain ? 55 : 150 // GB property alias viewState: rootItem.state property string prevSplashText; property bool splashDisplayedBeforeButtonRequest; From 80ade41905cff40eef94e27d39f14f41e887c96d Mon Sep 17 00:00:00 2001 From: selsta Date: Fri, 7 Oct 2022 01:49:31 +0200 Subject: [PATCH 08/18] DaemonManager: take dataDir into account when sending cmd --- components/NetworkStatusItem.qml | 1 + main.qml | 6 ++--- pages/Mining.qml | 2 +- pages/settings/SettingsLog.qml | 2 +- src/daemon/DaemonManager.cpp | 43 ++++++++++++++++++-------------- src/daemon/DaemonManager.h | 14 +++++------ 6 files changed, 37 insertions(+), 31 deletions(-) diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml index 48eeccc276..46e9fbd60e 100644 --- a/components/NetworkStatusItem.qml +++ b/components/NetworkStatusItem.qml @@ -201,6 +201,7 @@ Rectangle { daemonManager.sendCommandAsync( ["set_bootstrap_daemon", "auto"], appWindow.currentWallet.nettype, + persistentSettings.blockchainDataDir, callback); refreshMouseArea.visible = false; diff --git a/main.qml b/main.qml index 4be6be0690..9a97b4a192 100644 --- a/main.qml +++ b/main.qml @@ -469,7 +469,7 @@ ApplicationWindow { // If wallet isnt connected, advanced wallet mode and no daemon is running - Ask if (appWindow.walletMode >= 2 && !persistentSettings.useRemoteNode && !walletInitialized && disconnected) { - daemonManager.runningAsync(persistentSettings.nettype, function(running) { + daemonManager.runningAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, function(running) { if (!running) { daemonManagerDialog.open(); } @@ -714,7 +714,7 @@ ApplicationWindow { appWindow.showProcessingSplash(qsTr("Waiting for daemon to stop...")); } p2poolManager.exit() - daemonManager.stopAsync(persistentSettings.nettype, function(result) { + daemonManager.stopAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, function(result) { daemonStartStopInProgress = 0; if (splash) { hideProcessingSplash(); @@ -2141,7 +2141,7 @@ ApplicationWindow { if (currentWallet) { handler(!currentWallet.disconnected); } else { - daemonManager.runningAsync(persistentSettings.nettype, handler); + daemonManager.runningAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, handler); } } } diff --git a/pages/Mining.qml b/pages/Mining.qml index 8d5a2522f6..e9ab1d07df 100644 --- a/pages/Mining.qml +++ b/pages/Mining.qml @@ -297,7 +297,7 @@ Rectangle { startP2Pool() } else { - daemonManager.stopAsync(persistentSettings.nettype, startP2PoolLocal) + daemonManager.stopAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, startP2PoolLocal) } } else { diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml index 4c393ee9ce..d11201b08b 100644 --- a/pages/settings/SettingsLog.qml +++ b/pages/settings/SettingsLog.qml @@ -254,7 +254,7 @@ Rectangle { onAccepted: { if(text.length > 0) { consoleArea.logCommand(">>> " + text) - daemonManager.sendCommandAsync(text.split(" "), currentWallet.nettype, function(result) { + daemonManager.sendCommandAsync(text.split(" "), currentWallet.nettype, persistentSettings.blockchainDataDir, function(result) { if (!result) { appWindow.showStatusMessage(qsTr("Failed to send command"), 3); } diff --git a/src/daemon/DaemonManager.cpp b/src/daemon/DaemonManager.cpp index ad8bab1634..6a5a823390 100644 --- a/src/daemon/DaemonManager.cpp +++ b/src/daemon/DaemonManager.cpp @@ -130,8 +130,8 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const } // Start start watcher - m_scheduler.run([this, nettype, noSync] { - if (startWatcher(nettype)) { + m_scheduler.run([this, nettype, dataDir, noSync] { + if (startWatcher(nettype, dataDir)) { emit daemonStarted(); m_noSync = noSync; } else { @@ -142,13 +142,13 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const return true; } -void DaemonManager::stopAsync(NetworkType::Type nettype, const QJSValue& callback) +void DaemonManager::stopAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) { - const auto feature = m_scheduler.run([this, nettype] { + const auto feature = m_scheduler.run([this, nettype, dataDir] { QString message; - sendCommand({"exit"}, nettype, message); + sendCommand({"exit"}, nettype, dataDir, message); - return QJSValueList({stopWatcher(nettype)}); + return QJSValueList({stopWatcher(nettype, dataDir)}); }, callback); if (!feature.first) @@ -157,14 +157,14 @@ void DaemonManager::stopAsync(NetworkType::Type nettype, const QJSValue& callbac } } -bool DaemonManager::startWatcher(NetworkType::Type nettype) const +bool DaemonManager::startWatcher(NetworkType::Type nettype, const QString &dataDir) const { // Check if daemon is started every 2 seconds QElapsedTimer timer; timer.start(); while(true && !m_app_exit && timer.elapsed() / 1000 < DAEMON_START_TIMEOUT_SECONDS ) { QThread::sleep(2); - if(!running(nettype)) { + if(!running(nettype, dataDir)) { qDebug() << "daemon not running. checking again in 2 seconds."; } else { qDebug() << "daemon is started. Waiting 5 seconds to let daemon catch up"; @@ -175,14 +175,14 @@ bool DaemonManager::startWatcher(NetworkType::Type nettype) const return false; } -bool DaemonManager::stopWatcher(NetworkType::Type nettype) const +bool DaemonManager::stopWatcher(NetworkType::Type nettype, const QString &dataDir) const { // Check if daemon is running every 2 seconds. Kill if still running after 10 seconds int counter = 0; while(true && !m_app_exit) { QThread::sleep(2); counter++; - if(running(nettype)) { + if(running(nettype, dataDir)) { qDebug() << "Daemon still running. " << counter; if(counter >= 5) { qDebug() << "Killing it! "; @@ -236,10 +236,10 @@ void DaemonManager::printError() } } -bool DaemonManager::running(NetworkType::Type nettype) const +bool DaemonManager::running(NetworkType::Type nettype, const QString &dataDir) const { QString status; - sendCommand({"sync_info"}, nettype, status); + sendCommand({"sync_info"}, nettype, dataDir, status); qDebug() << status; return status.contains("Height:"); } @@ -249,14 +249,14 @@ bool DaemonManager::noSync() const noexcept return m_noSync; } -void DaemonManager::runningAsync(NetworkType::Type nettype, const QJSValue& callback) const +void DaemonManager::runningAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const { - m_scheduler.run([this, nettype] { - return QJSValueList({running(nettype)}); + m_scheduler.run([this, nettype, dataDir] { + return QJSValueList({running(nettype, dataDir)}); }, callback); } -bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettype, QString &message) const +bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, QString &message) const { QProcess p; QStringList external_cmd(cmd); @@ -267,6 +267,11 @@ bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettyp else if (nettype == NetworkType::STAGENET) external_cmd << "--stagenet"; + // Custom data-dir + if (!dataDir.isEmpty()) { + external_cmd << "--data-dir" << dataDir; + } + qDebug() << "sending external cmd: " << external_cmd; @@ -278,11 +283,11 @@ bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettyp return started; } -void DaemonManager::sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QJSValue& callback) const +void DaemonManager::sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const { - m_scheduler.run([this, cmd, nettype] { + m_scheduler.run([this, cmd, nettype, dataDir] { QString message; - return QJSValueList({sendCommand(cmd, nettype, message)}); + return QJSValueList({sendCommand(cmd, nettype, dataDir, message)}); }, callback); } diff --git a/src/daemon/DaemonManager.h b/src/daemon/DaemonManager.h index 2f8846651b..5a48a48947 100644 --- a/src/daemon/DaemonManager.h +++ b/src/daemon/DaemonManager.h @@ -48,23 +48,23 @@ class DaemonManager : public QObject ~DaemonManager(); Q_INVOKABLE bool start(const QString &flags, NetworkType::Type nettype, const QString &dataDir = "", const QString &bootstrapNodeAddress = "", bool noSync = false, bool pruneBlockchain = false); - Q_INVOKABLE void stopAsync(NetworkType::Type nettype, const QJSValue& callback); + Q_INVOKABLE void stopAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback); Q_INVOKABLE bool noSync() const noexcept; // return true if daemon process is started - Q_INVOKABLE void runningAsync(NetworkType::Type nettype, const QJSValue& callback) const; + Q_INVOKABLE void runningAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const; // Send daemon command from qml and prints output in console window. - Q_INVOKABLE void sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QJSValue& callback) const; + Q_INVOKABLE void sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const; Q_INVOKABLE void exit(); Q_INVOKABLE QVariantMap validateDataDir(const QString &dataDir) const; Q_INVOKABLE bool checkLmdbExists(QString datadir); private: - bool running(NetworkType::Type nettype) const; - bool sendCommand(const QStringList &cmd, NetworkType::Type nettype, QString &message) const; - bool startWatcher(NetworkType::Type nettype) const; - bool stopWatcher(NetworkType::Type nettype) const; + bool running(NetworkType::Type nettype, const QString &dataDir) const; + bool sendCommand(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, QString &message) const; + bool startWatcher(NetworkType::Type nettype, const QString &dataDir) const; + bool stopWatcher(NetworkType::Type nettype, const QString &dataDir) const; signals: void daemonStarted() const; void daemonStopped() const; From c390afd25872fcd8736fec7599ed9144b4214466 Mon Sep 17 00:00:00 2001 From: selsta Date: Sat, 29 Oct 2022 04:55:01 +0200 Subject: [PATCH 09/18] main: fix a potential warning --- main.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.qml b/main.qml index 4be6be0690..72531ab264 100644 --- a/main.qml +++ b/main.qml @@ -694,7 +694,8 @@ ApplicationWindow { // Daemon connected leftPanel.networkStatus.connected = currentWallet ? currentWallet.connected() : Wallet.ConnectionStatus_Disconnected - currentWallet.refreshHeightAsync(); + if (currentWallet) + currentWallet.refreshHeightAsync(); } function startDaemon(flags){ From 43cc666e779cd060fcc020cec77bed22bfbe0158 Mon Sep 17 00:00:00 2001 From: 2l47 <2l47@protonmail.com> Date: Sun, 30 Oct 2022 23:31:56 -0500 Subject: [PATCH 10/18] README: update Debian dependencies --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 21b9cb5909..ee56ff153a 100644 --- a/README.md +++ b/README.md @@ -221,15 +221,15 @@ Packaging for your favorite distribution would be a welcome contribution! 2. Install Qt: - *Note*: The Qt 5.9.7 or newer requirement makes **some** distributions (mostly based on debian, like Ubuntu 16.x or Linux Mint 18.x) obsolete due to their repositories containing an older Qt version. + *Note*: The Qt 5.9.7 or newer requirement makes **some** distributions (mostly based on Debian, like Ubuntu 16.x or Linux Mint 18.x) obsolete due to their repositories containing an older Qt version. The recommended way is to install 5.9.7 from the [official Qt installer](https://www.qt.io/download-qt-installer) or [compiling it yourself](https://wiki.qt.io/Install_Qt_5_on_Ubuntu). This ensures you have the correct version. Higher versions *can* work but as it differs from our production build target, slight differences may occur. The following instructions will fetch Qt from your distribution's repositories instead. Take note of what version it installs. Your mileage may vary. - - For Ubuntu 17.10+ + - For Debian distributions (Debian, Ubuntu, Mint, Tails...) - `sudo apt install qtbase5-dev qt5-default qtdeclarative5-dev qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-platform qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev` + `sudo apt install qtbase5-dev qtdeclarative5-dev qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-platform qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev` - For Gentoo @@ -240,7 +240,7 @@ The following instructions will fetch Qt from your distribution's repositories i - Optional : To build the flag `WITH_SCANNER` - - For Ubuntu + - For Debian distributions (Debian, Ubuntu, Mint, Tails...) `sudo apt install qtmultimedia5-dev qml-module-qtmultimedia` From 4743e443dc801bafa86ca9482329014b0eb9b03c Mon Sep 17 00:00:00 2001 From: selsta Date: Tue, 1 Nov 2022 00:11:42 +0100 Subject: [PATCH 11/18] deploy: update libicu to 72 --- cmake/Deploy.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/Deploy.cmake b/cmake/Deploy.cmake index bda241dd56..f069996b1b 100644 --- a/cmake/Deploy.cmake +++ b/cmake/Deploy.cmake @@ -74,19 +74,19 @@ if(APPLE OR (WIN32 AND NOT STATIC)) ) if(CMAKE_BUILD_TYPE STREQUAL "Debug") list(APPEND WIN_DEPLOY_DLLS - libicudtd71.dll - libicuind71.dll - libicuiod71.dll - libicutud71.dll - libicuucd71.dll + libicudtd72.dll + libicuind72.dll + libicuiod72.dll + libicutud72.dll + libicuucd72.dll ) else() # assume release list(APPEND WIN_DEPLOY_DLLS - libicudt71.dll - libicuin71.dll - libicuio71.dll - libicutu71.dll - libicuuc71.dll + libicudt72.dll + libicuin72.dll + libicuio72.dll + libicutu72.dll + libicuuc72.dll ) endif() list(TRANSFORM WIN_DEPLOY_DLLS PREPEND "$ENV{MSYSTEM_PREFIX}/bin/") From 2fa79c670ecc1a22c575225c60b98a5e64294a47 Mon Sep 17 00:00:00 2001 From: plowsof Date: Wed, 2 Nov 2022 13:32:20 +0000 Subject: [PATCH 12/18] workflows: verify p2pool hashes --- .github/verify_p2pool.py | 103 ++++++++++++++++++++++++++++ .github/workflows/verify_p2pool.yml | 16 +++++ 2 files changed, 119 insertions(+) create mode 100644 .github/verify_p2pool.py create mode 100644 .github/workflows/verify_p2pool.yml diff --git a/.github/verify_p2pool.py b/.github/verify_p2pool.py new file mode 100644 index 0000000000..051cf0b5af --- /dev/null +++ b/.github/verify_p2pool.py @@ -0,0 +1,103 @@ +import requests +import subprocess +from urllib.request import urlretrieve +import difflib + +sech_key = "https://p2pool.io/SChernykh.asc" +sech_key_backup = "https://raw.githubusercontent.com/monero-project/gitian.sigs/master/gitian-pubkeys/SChernykh.asc" +sech_key_fp = "1FCA AB4D 3DC3 310D 16CB D508 C47F 82B5 4DA8 7ADF" + +p2pool_files = [{ + "os": "WIN", + "filename": "windows-x64.zip", + }, + { + "os": "LINUX", + "filename": "linux-x64.tar.gz" + }, + { + "os": "MACOS", + "filename": "macos-x64.tar.gz", + }] + +def get_hash(fname): + fhash = subprocess.check_output(["sha256sum", fname]).decode("utf-8") + print(fhash.strip()) + return fhash.split()[0] + +def main(): + global p2pool_files, sech_key, sech_key_backup, sech_key_fp + p2pool_tag_api = "https://api.github.com/repos/SChernykh/p2pool/releases/latest" + data = requests.get(p2pool_tag_api).json() + tag = data["tag_name"] + head = f"p2pool-{tag}-" + url = f"https://github.com/SChernykh/p2pool/releases/download/{tag}/" + + try: + urlretrieve(sech_key,"SChernykh.asc") + except: + urlretrieve(sech_key_backup,"SChernykh.asc") + + urlretrieve(f"{url}sha256sums.txt.asc","sha256sums.txt.asc") + + subprocess.check_call(["gpg", "--import", "SChernykh.asc"]) + subprocess.check_call(["gpg", "--verify", "sha256sums.txt.asc"]) + fingerprint = subprocess.check_output(["gpg","--fingerprint", "SChernykh"]).decode("utf-8").splitlines()[1].strip() + + assert fingerprint == sech_key_fp + + with open("sha256sums.txt.asc","r") as f: + lines = f.readlines() + + signed_hashes = {} + for line in lines: + if "Name:" in line: + signed_fname = line.split()[1] + if "SHA256:" in line: + signed_hashes[signed_fname] = line.split()[1].lower() + + expected = "" + for i in range(len(p2pool_files)): + fname = p2pool_files[i]["filename"] + str_os =p2pool_files[i]["os"] + dl = f"{url}{head}{fname}" + urlretrieve(dl,f"{head}{fname}") + fhash = get_hash(f"{head}{fname}") + assert signed_hashes[f"{head}{fname}"] == fhash + if i == 0: + expected += f" #ifdef Q_OS_{str_os}\n" + else: + expected += f" #elif defined(Q_OS_{str_os})\n" + expected += f" url = \"https://github.com/SChernykh/p2pool/releases/download/{tag}/{head}{fname}\";\n" + expected += f" fileName = m_p2poolPath + \"/{head}{fname}\";\n" + expected += f" validHash = \"{fhash}\";\n" + expected += " #endif\n" + + print(f"Expected:\n{expected}") + + with open("src/p2pool/P2PoolManager.cpp","r") as f: + p2pool_lines = f.readlines() + + unexpected = "" + ignore = 1 + for line in p2pool_lines: + if ignore == 0: + unexpected += line + if "QString validHash;" in line: + ignore = 0 + if "#endif" in line and ignore == 0: + break + + d = difflib.Differ() + diff = d.compare(str(unexpected).splitlines(True),str(expected).splitlines(True)) + + print("Unexpected:") + for i in diff: + if i.startswith("?"): + continue + print(i.replace("\n","")) + + assert unexpected == expected + +if __name__ == "__main__": + main() diff --git a/.github/workflows/verify_p2pool.yml b/.github/workflows/verify_p2pool.yml new file mode 100644 index 0000000000..c16535708f --- /dev/null +++ b/.github/workflows/verify_p2pool.yml @@ -0,0 +1,16 @@ +name: ci/gh-actions/verify +on: + push: + paths: + - 'src/p2pool/P2PoolManager.cpp' + pull_request: + paths: + - 'src/p2pool/P2PoolManager.cpp' +jobs: + p2pool-hashes: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Verify Hashes + run: | + python3 .github/verify_p2pool.py From 2d254542f32da99a42eef92fe08465167c60caa3 Mon Sep 17 00:00:00 2001 From: selsta Date: Mon, 7 Nov 2022 06:16:38 +0100 Subject: [PATCH 13/18] docker: update zlib on android --- Dockerfile.android | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.android b/Dockerfile.android index b077fb3f99..d81c4476cb 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -43,8 +43,8 @@ RUN echo y | ${ANDROID_SDK_ROOT}/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} " ENV HOST_PATH=${PATH} ENV PATH=${TOOLCHAIN_DIR}/aarch64-linux-android/bin:${TOOLCHAIN_DIR}/bin:${PATH} -ARG ZLIB_VERSION=1.2.12 -ARG ZLIB_HASH=91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9 +ARG ZLIB_VERSION=1.2.13 +ARG ZLIB_HASH=b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30 RUN wget -q https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz \ && echo "${ZLIB_HASH} zlib-${ZLIB_VERSION}.tar.gz" | sha256sum -c \ && tar -xzf zlib-${ZLIB_VERSION}.tar.gz \ From c0a739c9fa3089bcb57eb1fd513c156e89520047 Mon Sep 17 00:00:00 2001 From: selsta Date: Fri, 11 Nov 2022 01:59:28 +0100 Subject: [PATCH 14/18] Transfer: update mixin, silence warning --- pages/Transfer.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Transfer.qml b/pages/Transfer.qml index a768538d8e..5719c74448 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -51,7 +51,7 @@ Rectangle { color: "transparent" property alias transferHeight1: pageRoot.height property alias transferHeight2: advancedLayout.height - property int mixin: 10 // (ring size 11) + property int mixin: 15 // (ring size 16) property string warningContent: "" property string sendButtonWarning: { // Currently opened wallet is not view-only From 6984bb8113d1fc4143707e2ac66789a746c6df14 Mon Sep 17 00:00:00 2001 From: selsta Date: Sat, 12 Nov 2022 04:10:34 +0100 Subject: [PATCH 15/18] docker: update Qt to 5.15.7 --- Dockerfile.android | 4 ++-- Dockerfile.linux | 2 +- Dockerfile.windows | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.android b/Dockerfile.android index b077fb3f99..7f42244ede 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -5,12 +5,12 @@ ARG ANDROID_NDK_REVISION=21e ARG ANDROID_NDK_HASH=c3ebc83c96a4d7f539bd72c241b2be9dcd29bda9 ARG ANDROID_SDK_REVISION=7302050_latest ARG ANDROID_SDK_HASH=7a00faadc0864f78edd8f4908a629a46d622375cbe2e5814e82934aebecdb622 -ARG QT_VERSION=v5.15.6-lts-lgpl +ARG QT_VERSION=v5.15.7-lts-lgpl WORKDIR /opt/android ENV WORKDIR=/opt/android -ENV ANDROID_NATIVE_API_LEVEL=29 +ENV ANDROID_NATIVE_API_LEVEL=30 ENV ANDROID_API=android-${ANDROID_NATIVE_API_LEVEL} ENV ANDROID_CLANG=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang ENV ANDROID_CLANGPP=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang++ diff --git a/Dockerfile.linux b/Dockerfile.linux index 442ffaf81b..2dd02fb45e 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -1,7 +1,7 @@ FROM ubuntu:16.04 ARG THREADS=1 -ARG QT_VERSION=v5.15.6-lts-lgpl +ARG QT_VERSION=v5.15.7-lts-lgpl ENV CFLAGS="-fPIC" ENV CPPFLAGS="-fPIC" diff --git a/Dockerfile.windows b/Dockerfile.windows index e302c8e544..abadcc7511 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,7 +1,7 @@ FROM ubuntu:20.04 ARG THREADS=1 -ARG QT_VERSION=v5.15.6-lts-lgpl +ARG QT_VERSION=v5.15.7-lts-lgpl ENV SOURCE_DATE_EPOCH=1397818193 RUN apt update && \ From 9e2ae684ed77e3a263c47a1bb42c80a31e130478 Mon Sep 17 00:00:00 2001 From: selsta Date: Mon, 31 Oct 2022 20:01:45 +0100 Subject: [PATCH 16/18] p2pool: update to 2.6 --- src/p2pool/P2PoolManager.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/p2pool/P2PoolManager.cpp b/src/p2pool/P2PoolManager.cpp index f1b8c26995..575f6d414c 100644 --- a/src/p2pool/P2PoolManager.cpp +++ b/src/p2pool/P2PoolManager.cpp @@ -49,17 +49,17 @@ void P2PoolManager::download() { QString fileName; QString validHash; #ifdef Q_OS_WIN - url = "https://github.com/SChernykh/p2pool/releases/download/v2.2.1/p2pool-v2.2.1-windows-x64.zip"; - fileName = m_p2poolPath + "/p2pool-v2.2.1-windows-x64.zip"; - validHash = "06b6fe302600c959007bf94e7a5b445f45f823dc4e43ae6cf03b3b98a805167a"; + url = "https://github.com/SChernykh/p2pool/releases/download/v2.6/p2pool-v2.6-windows-x64.zip"; + fileName = m_p2poolPath + "/p2pool-v2.6-windows-x64.zip"; + validHash = "9b5aabd1194c7e5cb5ade81f7763a68c49658f4e2a4726994e8106ee2db20cff"; #elif defined(Q_OS_LINUX) - url = "https://github.com/SChernykh/p2pool/releases/download/v2.2.1/p2pool-v2.2.1-linux-x64.tar.gz"; - fileName = m_p2poolPath + "/p2pool-v2.2.1-linux-x64.tar.gz"; - validHash = "02f1daea0f8f99076b7da3368a43cc3989b800f8b5afaf4dfc7e8f9bdc27d274"; + url = "https://github.com/SChernykh/p2pool/releases/download/v2.6/p2pool-v2.6-linux-x64.tar.gz"; + fileName = m_p2poolPath + "/p2pool-v2.6-linux-x64.tar.gz"; + validHash = "28f55976022e78e8a2ca87b7ac0b9582d665527b399f4f48a3f4045129ca5fa3"; #elif defined(Q_OS_MACOS) - url = "https://github.com/SChernykh/p2pool/releases/download/v2.2.1/p2pool-v2.2.1-macos-x64.tar.gz"; - fileName = m_p2poolPath + "/p2pool-v2.2.1-macos-x64.tar.gz"; - validHash = "d973a8dca922f209dfb6f203006f93664e19d870975621bec07e9d855e79d7d5"; + url = "https://github.com/SChernykh/p2pool/releases/download/v2.6/p2pool-v2.6-macos-x64.tar.gz"; + fileName = m_p2poolPath + "/p2pool-v2.6-macos-x64.tar.gz"; + validHash = "af7d35946ea0be00e78ed16aaaed10d2fe6d5b3064d284eddf80e15f207e1962"; #endif QFile file(fileName); epee::net_utils::http::http_simple_client http_client; From 7faec48c0a0a404fe66af3f211fd34555b647716 Mon Sep 17 00:00:00 2001 From: selsta Date: Fri, 2 Dec 2022 05:56:51 +0100 Subject: [PATCH 17/18] History: add open folder button after CSV export --- pages/History.qml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pages/History.qml b/pages/History.qml index 48befeaaa7..88a2b76786 100644 --- a/pages/History.qml +++ b/pages/History.qml @@ -1765,18 +1765,25 @@ Rectangle { var written = currentWallet.history.writeCSV(currentWallet.currentSubaddressAccount, dataDir); if(written !== ""){ - informationPopup.title = qsTr("Success") + translationManager.emptyString; + confirmationDialog.title = qsTr("Success") + translationManager.emptyString; var text = qsTr("CSV file written to: %1").arg(written) + "\n\n" text += qsTr("Tip: Use your favorite spreadsheet software to sort on blockheight.") + "\n\n" + translationManager.emptyString; - informationPopup.text = text; - informationPopup.icon = StandardIcon.Information; + confirmationDialog.text = text; + confirmationDialog.icon = StandardIcon.Information; + confirmationDialog.cancelText = qsTr("Open folder") + translationManager.emptyString; + confirmationDialog.onAcceptedCallback = null; + confirmationDialog.onRejectedCallback = function() { + oshelper.openContainingFolder(written); + } + confirmationDialog.open(); } else { informationPopup.title = qsTr("Error") + translationManager.emptyString; informationPopup.text = qsTr("Error exporting transaction data.") + "\n\n" + translationManager.emptyString; informationPopup.icon = StandardIcon.Critical; + informationPopup.onCloseCallback = null; + informationPopup.open(); + } - informationPopup.onCloseCallback = null; - informationPopup.open(); } Component.onCompleted: { var _folder = 'file://' + appWindow.accountsDir; From a9b52f6752f3ba265ee396d7fe8e09609fb192fd Mon Sep 17 00:00:00 2001 From: plowsof Date: Thu, 1 Dec 2022 22:10:33 +0000 Subject: [PATCH 18/18] Sign/Verify: clear text fields on wallet close --- main.qml | 1 + pages/Advanced.qml | 6 ++++++ pages/Sign.qml | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/main.qml b/main.qml index 4be6be0690..9937eb08f2 100644 --- a/main.qml +++ b/main.qml @@ -1118,6 +1118,7 @@ ApplicationWindow { middlePanel.transferView.clearFields(); middlePanel.receiveView.clearFields(); middlePanel.historyView.clearFields(); + middlePanel.advancedView.clearFields(); // disable timers userInActivityTimer.running = false; }); diff --git a/pages/Advanced.qml b/pages/Advanced.qml index 6aa8ac4650..17904e3b7c 100644 --- a/pages/Advanced.qml +++ b/pages/Advanced.qml @@ -40,6 +40,7 @@ ColumnLayout { spacing: 0 property int panelHeight: 900 property alias miningView: stateView.miningView + property alias signView: stateView.signView property alias state: stateView.state MoneroComponents.Navbar { @@ -146,4 +147,9 @@ ColumnLayout { } } } + + function clearFields() { + signView.clearFields(); + } + } diff --git a/pages/Sign.qml b/pages/Sign.qml index 7466139197..bc037ac2d7 100644 --- a/pages/Sign.qml +++ b/pages/Sign.qml @@ -421,6 +421,16 @@ Rectangle { } } + function clearFields() { + verifyMessageLine.text = "" + signMessageLine.text = "" + signSignatureLine.text = "" + verifyAddressLine.text = "" + verifySignatureLine.text = "" + signFileLine.text = "" + verifyFileLine.text = "" + } + function onPageCompleted() { console.log("Sign/verify page loaded"); }