From 395447bf30673cf4bd9cfe90c4834871ab44b2f3 Mon Sep 17 00:00:00 2001 From: pasta Date: Wed, 4 Dec 2024 11:06:06 -0600 Subject: [PATCH 1/3] Merge #6451: depends: update 'src/dashbls' to dashpay/bls-signatures@7e747e8a as 62fa6652 f25a93647b10d838a0722de4dc74304ce5dbe646 build: stop tracking cmake dependency relic_conf.h.in (Kittywhiskers Van Gogh) 62fa66524c5ec4a5a005285a05b7a3314a523a16 Squashed 'src/dashbls/' changes from 4e070243ae..7e747e8a07 (Kittywhiskers Van Gogh) b1b3840ac540ae5980cbb4258a4b44d75ee27d75 revert: stop tracking cmake dependency relic_conf.h.in (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Closes https://github.com/dashpay/dash/issues/6343 * Includes [bls-signatures#102](https://github.com/dashpay/bls-signatures/pull/102) and [bls-signatures#104](https://github.com/dashpay/bls-signatures/pull/104) ## Breaking Changes None expected. ## Checklist: - [x] I have performed a self-review of my own code **(note: N/A)** - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK f25a93647b10d838a0722de4dc74304ce5dbe646 UdjinM6: utACK f25a93647b10d838a0722de4dc74304ce5dbe646 Tree-SHA512: 394a02a50f57538e9d12f836fd1ea1598d8a20e2d0079fcb44bb317a42a64a638a1ef906222f2d3bab06d2c0b8cfac43c6e0055d87fbdb86abe680c53ecd6b7a --- src/dashbls/.github/workflows/build-binds.yml | 4 +- src/dashbls/configure.ac | 135 +++++++++++------- 2 files changed, 85 insertions(+), 54 deletions(-) diff --git a/src/dashbls/.github/workflows/build-binds.yml b/src/dashbls/.github/workflows/build-binds.yml index f57acbd7e2..6fc729109d 100644 --- a/src/dashbls/.github/workflows/build-binds.yml +++ b/src/dashbls/.github/workflows/build-binds.yml @@ -23,8 +23,8 @@ jobs: fail-fast: false matrix: os: [macos-latest, ubuntu-latest] - golang: [ '1.17' ] - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + golang: [ '1.22' ] + python: ['3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout code diff --git a/src/dashbls/configure.ac b/src/dashbls/configure.ac index e60fca8fc1..df411ced0c 100644 --- a/src/dashbls/configure.ac +++ b/src/dashbls/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([libdashbls],[1.3.3]) +AC_INIT([libdashbls],[1.3.4]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([build-aux/m4]) @@ -100,7 +100,7 @@ dnl warning about something unrelated, for example about some path issue. If tha dnl -Werror cannot be used because all of those warnings would be turned into errors. AX_CHECK_COMPILE_FLAG([-Werror], [FLAG_WERROR="-Werror"], [FLAG_WERROR=""]) -if [[[ "$use_debug" == "yes" || "$use_optimizations" == "no" ]]]; then +if test x"$use_debug" = x"yes" -o x"$use_optimizations" = x"no"; then dnl Clear default -g -O2 flags if test x"$CFLAGS_overridden" = x"no"; then CFLAGS="" @@ -112,7 +112,7 @@ if [[[ "$use_debug" == "yes" || "$use_optimizations" == "no" ]]]; then dnl Disable optimizations AX_CHECK_COMPILE_FLAG([-O0], [[DEBUG_FLAGS="$DEBUG_FLAGS -O0"]], [], [[$FLAG_WERROR]]) - if [[[ "$use_debug" == "yes" ]]]; then + if test x"$use_debug" = x"yes"; then dnl Prefer -g3, fall back to -g if that is unavailable. AX_CHECK_COMPILE_FLAG( [-g3], @@ -220,7 +220,11 @@ case $host in GMP_LDFLAGS="-L$gmp_prefix/lib" fi fi - ;; + ;; + *freebsd*) + GMP_CPPFLAGS="-I/usr/local/include" + GMP_LDFLAGS="-L/usr/local/lib" + ;; esac if test x"$want_backend" = x"auto"; then @@ -432,44 +436,74 @@ fi use_pkgconfig=yes -if [[[ "$host_cpu" == x86_64 && "$use_optimizations" == "yes" ]]]; then - dnl Support for AMD64 (also known as x86_64 on some platforms) processors - CPU_ARCH="x64" - AC_DEFINE([ARCH], [X64], [Architecture.]) - AC_DEFINE([WSIZE], [64], [Size of word in this architecture.]) -elif [[[ "$host_cpu" == aarch* && "$use_optimizations" == "yes" ]]]; then - dnl Support for 64-bit ARM processors - dnl Relic doesn't support aarch64 yet, set CPU_ARCH to none and ARCH to RELIC_NONE. - CPU_ARCH="none" - AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) - AC_DEFINE([WSIZE], [64], [Size of word in this architecture.]) -elif [[[ "$host_cpu" == i?86 && "$use_optimizations" == "yes" ]]]; then - dnl Support for Intel x86 processors - CPU_ARCH="x86" - AC_DEFINE([ARCH], [X86], [Architecture.]) - AC_DEFINE([WSIZE], [32], [Size of word in this architecture.]) -elif [[[ "$host_cpu" == arm* && "$use_optimizations" == "yes" ]]]; then - dnl Support for 32-bit native ARM processors - CPU_ARCH="arm" - AC_DEFINE([ARCH], [ARM], [Architecture.]) - AC_DEFINE([WSIZE], [32], [Size of word in this architecture.]) -elif [[[ "$host_cpu" == *64* ]]]; then - dnl Support for an undefined 64-bit architecture - CPU_ARCH="none" - AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) - AC_DEFINE([WSIZE], [64], [Size of word in this architecture.]) -elif [[[ "$host_cpu" == *32* || "$host_cpu" == arm* || "$host_cpu" == i?86 ]]]; then - dnl Support for an undefined 32-bit architecture - CPU_ARCH="none" - AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) - AC_DEFINE([WSIZE], [32], [Size of word in this architecture.]) +if test x"$use_optimizations" = x"yes"; then + case $host_cpu in + amd64 | x86_64) + dnl Support for AMD64 (also known as x86_64 on some platforms) processors + CPU_ARCH="x64" + AC_DEFINE([ARCH], [X64], [Architecture.]) + AC_DEFINE([WSIZE], [64], [Size of word in this architecture.]) + ;; + aarch*) + dnl Support for 64-bit ARM processors + dnl Relic does not support aarch64 yet, set CPU_ARCH to none and ARCH to RELIC_NONE. + CPU_ARCH="none" + AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) + AC_DEFINE([WSIZE], [64], [Size of word in this architecture.]) + ;; + i?86) + dnl Support for Intel x86 processors + CPU_ARCH="x86" + AC_DEFINE([ARCH], [X86], [Architecture.]) + AC_DEFINE([WSIZE], [32], [Size of word in this architecture.]) + ;; + arm*) + dnl Support for 32-bit native ARM processors + CPU_ARCH="arm" + AC_DEFINE([ARCH], [ARM], [Architecture.]) + AC_DEFINE([WSIZE], [32], [Size of word in this architecture.]) + ;; + *64*) + dnl Support for an undefined 64-bit architecture + CPU_ARCH="none" + AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) + AC_DEFINE([WSIZE], [64], [Size of word in this architecture.]) + ;; + *32*) + dnl Support for an undefined 32-bit architecture + CPU_ARCH="none" + AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) + AC_DEFINE([WSIZE], [32], [Size of word in this architecture.]) + ;; + *) + AC_MSG_ERROR([Unable to determine host architecture, may not be supported!]) + ;; + esac else - AC_MSG_ERROR([Unable to determine host architecture, may not be supported!]) + case $host_cpu in + *64*) + dnl Support for an undefined 64-bit architecture + CPU_ARCH="none" + AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) + AC_DEFINE([WSIZE], [64], [Size of word in this architecture.]) + ;; + *32* | arm* | i?86) + dnl Support for an undefined 32-bit architecture + CPU_ARCH="none" + AC_DEFINE([ARCH], [RELIC_NONE], [Architecture.]) + AC_DEFINE([WSIZE], [32], [Size of word in this architecture.]) + ;; + *) + AC_MSG_ERROR([Unable to determine host architecture, may not be supported!]) + ;; + esac fi case $host in *darwin*) AC_DEFINE([OPSYS], [MACOSX], [Detected operation system.]) + TARGET_OS=darwin + AC_PATH_PROG([BREW],brew,) if test x$BREW = x; then AC_PATH_PROG([PORT],port,) @@ -482,8 +516,10 @@ case $host in fi ;; *mingw*) - use_pkgconfig=no AC_DEFINE([OPSYS], [WINDOWS], [Detected operation system.]) + TARGET_OS=windows + + use_pkgconfig=no LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against. @@ -496,16 +532,21 @@ case $host in ;; *linux*) AC_DEFINE([OPSYS], [LINUX], [Detected operation system.]) + TARGET_OS=linux + RELIC_CPPFLAGS="-D_GNU_SOURCE" ;; *android*) AC_DEFINE([OPSYS], [DROID], [Detected operation system.]) + TARGET_OS=android ;; *freebsd*) AC_DEFINE([OPSYS], [FREEBSD], [Detected operation system.]) + TARGET_OS=freebsd ;; *netbsd*) AC_DEFINE([OPSYS], [NETBSD], [Detected operation system.]) + TARGET_OS=netbsd ;; *) AC_DEFINE([OPSYS], [RELIC_NONE], [Detected operation system.]) @@ -555,7 +596,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])], CFLAGS="$saved_CFLAGS" ]) -if [[[ "$CFLAGS_overridden" == "no" && "$CXXFLAGS_overridden" == "no" ]]]; then +if test x"$CFLAGS_overridden" = x"no" -a x"$CXXFLAGS_overridden" = x"no"; then dnl Enable warnings AX_CHECK_COMPILE_FLAG([-Wall],[WARN_FLAGS="$WARN_FLAGS -Wall"], [], [[$FLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wcast-align],[WARN_FLAGS="$WARN_FLAGS -Wcast-align"], [], [[$FLAG_WERROR]]) @@ -743,7 +784,6 @@ CORE_CPPFLAGS="$CORE_CPPFLAGS -DHAVE_BUILD_INFO" case $host in *mingw*) - TARGET_OS=windows AC_CHECK_LIB([user32], [main], [], [AC_MSG_ERROR([libuser32 missing])]) AC_CHECK_LIB([shell32], [SHGetSpecialFolderPathW], [], [AC_MSG_ERROR([libshell32 missing])]) AC_CHECK_LIB([advapi32], [CryptAcquireContextW], [], [AC_MSG_ERROR([libadvapi32 missing])]) @@ -771,15 +811,10 @@ case $host in AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"], [], []) ;; *darwin*) - TARGET_OS=darwin - AX_CHECK_LINK_FLAG([-Wl,-headerpad_max_install_names], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"], [], []) CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0" OBJCXXFLAGS="$CXXFLAGS" ;; - *linux*) - TARGET_OS=linux - ;; esac dnl These flags are specific to ld64, and may cause issues with other linkers. @@ -799,19 +834,15 @@ AC_LANG_POP([C]) AC_MSG_CHECKING([whether to build runtest]) if test x$use_tests = xyes; then AC_MSG_RESULT([yes]) - BUILD_TEST="yes" else AC_MSG_RESULT([no]) - BUILD_TEST="" fi AC_MSG_CHECKING([whether to build runbench]) if test x$use_bench = xyes; then AC_MSG_RESULT([yes]) - BUILD_BENCH="yes" else AC_MSG_RESULT([no]) - BUILD_BENCH="" fi AM_CONDITIONAL([TARGET_DARWIN], [test "$TARGET_OS" = "darwin"]) @@ -836,8 +867,8 @@ AM_CONDITIONAL(WITH_MPC, test 1 -eq 1) AM_CONDITIONAL(WITH_DV, test 1 -eq 1) AM_CONDITIONAL(WITH_FBX, test 1 -eq 1) -AM_CONDITIONAL([USE_TESTS], [test x$BUILD_TEST = xyes]) -AM_CONDITIONAL([USE_BENCH], [test x$BUILD_BENCH = xyes]) +AM_CONDITIONAL([USE_TESTS], [test x"$use_tests" = x"yes"]) +AM_CONDITIONAL([USE_BENCH], [test x"$use_bench" = x"yes"]) AM_CONDITIONAL([HARDEN], [test "$use_hardening" = "yes"]) AM_CONDITIONAL([OPTIMIZE], [test "$use_optimizations" = "yes"]) @@ -874,8 +905,8 @@ echo echo "Options used to compile and link:" echo " target os = $TARGET_OS" echo " backend = $want_backend" -echo " build bench = $BUILD_BENCH" -echo " build test = $BUILD_TEST" +echo " build bench = $use_tests" +echo " build test = $use_bench" echo " use debug = $use_debug" echo " use hardening = $use_hardening" echo " use optimizations = $use_optimizations" From 758cd646a1fee7d9a4d0d08b7651f068eae83be9 Mon Sep 17 00:00:00 2001 From: pasta Date: Thu, 5 Dec 2024 19:40:07 -0600 Subject: [PATCH 2/3] Merge #6452: fix: store ready queues on the mixing masternode 24dcce979be16b4482b65e43faaf3f040064e8de fix: store ready queues on the mixing masternode (UdjinM6) Pull request description: ## Issue being fixed or feature implemented We normally do not re-relay/store "ready" `dsq`-s because these are ment to be relayed between mixing clients and the mixing masternode only. I works ok when you simply send `dsq` messages because no extra steps are required. However since 70235 we send `dsq` _`inv`-s_ first and we send actual `dsq`-s only if they are requested via `getdata`. The problem here is that `ProcessGetData()` queries `vecCoinJoinQueue` via `GetQueueFromHash()` to get the data to send back but there is none because we never saved it. ## What was done? ## How Has This Been Tested? To test this patch you need a MN but you can test 2 cases _without this patch_ to indirectly test the idea: 1. try mixing on develop: almost no mixing txes, maybe 10 or so in an hour if you are lucky to mix on an old MN that often 2. ignore old MNs (`MIN_PEER_PROTO_VERSION = 70235`): 0 mixing txes, no matter how long you wait 3. pretend being an old client to receive no-inv `dsq` only (`PROTOCOL_VERSION = 70233`): no issues, mixing on these nodes is as fast as usual, several txes per block (need a couple of nodes like that on the network so that a mixing session could be completed, I'm running one node for now so that anyone could join and test it) I'm running a testnet MN with this fix and applied "ignore old mn" patch on my local machine. Local wallet got mixing tx when it finally hit the patched mn. Also confirmed this via MN`debug.log` (`Create`/`Relay`/`CommitFinalTransaction` in logs). ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 24dcce979be16b4482b65e43faaf3f040064e8de Tree-SHA512: 69cee5401d26eec3f66166a754b8020e7f550dac4a0fdea8ec48ea1082f1286e647ac0a26a189c4d39e1a9da4e7ac36f71913684b13ea0fb4b3cfe831174970e --- src/coinjoin/server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coinjoin/server.cpp b/src/coinjoin/server.cpp index bb65990dd9..6e0ee38474 100644 --- a/src/coinjoin/server.cpp +++ b/src/coinjoin/server.cpp @@ -520,6 +520,7 @@ void CCoinJoinServer::CheckForCompleteQueue() "with %d participants\n", dsq.ToString(), vecSessionCollaterals.size()); dsq.Sign(*m_mn_activeman); m_peerman->RelayDSQ(dsq); + WITH_LOCK(cs_vecqueue, vecCoinJoinQueue.push_back(dsq)); } } From fa29ed5b5eef69dcf7735734309f378852c61173 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 6 Dec 2024 16:51:57 -0600 Subject: [PATCH 3/3] Merge #6456: fix(qt): allow refreshing wallet data without crashing d296005194c7bd8c65006ddf1b25052b2655c923 fix(qt): allow refreshing wallet data without crashing (UdjinM6) Pull request description: ## Issue being fixed or feature implemented We re-use `refreshWallet` method to optimise loading for huge wallets https://github.com/dashpay/dash/pull/5453. However gui121 backport (via 25f87b9434b98a524d38a97d9fe580acc0fa47ce) added a condition that prevents this logic. Fix it by allowing explicit wallet refresh (force=true). ## What was done? ## How Has This Been Tested? Open a wallet with 10k+ txes, do `rescanblockchain` via rpc console ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK d296005194c7bd8c65006ddf1b25052b2655c923; Tree-SHA512: d308b3fe9c4fbbfbf2e2339aa14c825aa6f69c72d1f04dab7a14dc1c8721138beca47c7b3801db9782d6cecf2c54023a19a6d22e04b84615f9bddb0b8ec1696c --- src/qt/transactiontablemodel.cpp | 16 +++++++++------- src/qt/transactiontablemodel.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 01de92c61d..3d2052d445 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -106,10 +106,11 @@ public: /* Query entire wallet anew from core. */ - void refreshWallet(interfaces::Wallet& wallet) + void refreshWallet(interfaces::Wallet& wallet, bool force = false) { parent->beginResetModel(); - assert(!m_loaded); + assert(!m_loaded || force); + cachedWallet.clear(); try { for (const auto& wtx : wallet.getWalletTxs()) { if (TransactionRecord::showTransaction()) { @@ -284,9 +285,9 @@ TransactionTableModel::~TransactionTableModel() delete priv; } -void TransactionTableModel::refreshWallet() +void TransactionTableModel::refreshWallet(bool force) { - priv->refreshWallet(walletModel->wallet()); + priv->refreshWallet(walletModel->wallet(), force); } /** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ @@ -846,12 +847,13 @@ void TransactionTablePriv::DispatchNotifications() vQueueNotifications[i].invoke(parent); } + vQueueNotifications.clear(); } else { - // it's much faster to just refresh the whole thing instead - bool invoked = QMetaObject::invokeMethod(parent, "refreshWallet", Qt::QueuedConnection); + // it's much faster to just drop all the queued notifications and refresh the whole thing instead + vQueueNotifications.clear(); + bool invoked = QMetaObject::invokeMethod(parent, "refreshWallet", Qt::QueuedConnection, Q_ARG(bool, true)); assert(invoked); } - vQueueNotifications.clear(); } void TransactionTableModel::subscribeToCoreSignals() diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index b1f933e255..630fec039f 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -114,7 +114,7 @@ private: public Q_SLOTS: /* Refresh the whole wallet, helpful for huge notification queues */ - void refreshWallet(); + void refreshWallet(bool foce = false); /* New transaction, or transaction changed status */ void updateTransaction(const QString &hash, int status, bool showTransaction); void updateAddressBook(const QString &address, const QString &label,