From fdb16635cbfe1d45a3d5869c0a55ec871d912ea0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 12:27:45 +0100 Subject: chore(deps): update zano digest to fe85ce2 (#116) * chore(deps): update zano digest to fe85ce2 * rebase needed patches * fix integration tests, generate checksum --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Czarek Nakamoto --- patches/zano/0001-add-missing-include.patch | 64 ---------------- patches/zano/0001-fix-build-issues.patch | 39 ++++++++++ patches/zano/0002-fix-build-issues.patch | 39 ---------- patches/zano/0002-fix-mingw-build-issues.patch | 61 +++++++++++++++ patches/zano/0003-fix-ios-builds.patch | 43 +++++++++++ patches/zano/0003-fix-mingw-build-issues.patch | 61 --------------- patches/zano/0004-update-tor-connect.patch | 33 -------- ...004-use-boost-filesystem-instead-of-stdfs.patch | 80 ++++++++++++++++++++ ...ade-cmake-version-so-LIB_DEPENDS-shows-up.patch | 22 ++++++ patches/zano/0005-fix-ios-builds.patch | 43 ----------- patches/zano/0006-increase-max-password.patch | 25 ++++++ ...006-use-boost-filesystem-instead-of-stdfs.patch | 80 -------------------- ...ade-cmake-version-so-LIB_DEPENDS-shows-up.patch | 22 ------ patches/zano/0007-relax-mutex-in-invoke-call.patch | 88 ++++++++++++++++++++++ patches/zano/0008-increase-max-password.patch | 25 ------ .../0009-add-keys-to-open_wallet_response.patch | 83 -------------------- patches/zano/0010-relax-mutex-in-invoke-call.patch | 88 ---------------------- 17 files changed, 358 insertions(+), 538 deletions(-) delete mode 100644 patches/zano/0001-add-missing-include.patch create mode 100644 patches/zano/0001-fix-build-issues.patch delete mode 100644 patches/zano/0002-fix-build-issues.patch create mode 100644 patches/zano/0002-fix-mingw-build-issues.patch create mode 100644 patches/zano/0003-fix-ios-builds.patch delete mode 100644 patches/zano/0003-fix-mingw-build-issues.patch delete mode 100644 patches/zano/0004-update-tor-connect.patch create mode 100644 patches/zano/0004-use-boost-filesystem-instead-of-stdfs.patch create mode 100644 patches/zano/0005-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch delete mode 100644 patches/zano/0005-fix-ios-builds.patch create mode 100644 patches/zano/0006-increase-max-password.patch delete mode 100644 patches/zano/0006-use-boost-filesystem-instead-of-stdfs.patch delete mode 100644 patches/zano/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch create mode 100644 patches/zano/0007-relax-mutex-in-invoke-call.patch delete mode 100644 patches/zano/0008-increase-max-password.patch delete mode 100644 patches/zano/0009-add-keys-to-open_wallet_response.patch delete mode 100644 patches/zano/0010-relax-mutex-in-invoke-call.patch (limited to 'patches/zano') diff --git a/patches/zano/0001-add-missing-include.patch b/patches/zano/0001-add-missing-include.patch deleted file mode 100644 index cd95528..0000000 --- a/patches/zano/0001-add-missing-include.patch +++ /dev/null @@ -1,64 +0,0 @@ -From a49fa9a64aebf69f15832291e70888ff18ed6040 Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Thu, 31 Oct 2024 13:07:20 +0000 -Subject: [PATCH 1/5] add missing #include - ---- - src/currency_core/genesis.cpp | 1 + - src/currency_core/genesis.h | 2 +- - src/wallet/plain_wallet_api.cpp | 1 + - src/wallet/plain_wallet_api.h | 1 + - 4 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/currency_core/genesis.cpp b/src/currency_core/genesis.cpp -index a58dcb4e..c34b0285 100644 ---- a/src/currency_core/genesis.cpp -+++ b/src/currency_core/genesis.cpp -@@ -4,6 +4,7 @@ - // file COPYING or http://www.opensource.org/licenses/mit-license.php. - - #include "genesis.h" -+#include - - namespace currency - { -diff --git a/src/currency_core/genesis.h b/src/currency_core/genesis.h -index 8ea77d89..d78cec97 100644 ---- a/src/currency_core/genesis.h -+++ b/src/currency_core/genesis.h -@@ -3,7 +3,7 @@ - // Copyright (c) 2014-2018 The Louisdor Project - // Distributed under the MIT/X11 software license, see the accompanying - // file COPYING or http://www.opensource.org/licenses/mit-license.php. -- -+#include - #pragma once - #include - namespace currency -diff --git a/src/wallet/plain_wallet_api.cpp b/src/wallet/plain_wallet_api.cpp -index bb322481..dccff76c 100644 ---- a/src/wallet/plain_wallet_api.cpp -+++ b/src/wallet/plain_wallet_api.cpp -@@ -6,6 +6,7 @@ - #ifdef ANDROID_BUILD - #include - #endif -+#include - #include "plain_wallet_api.h" - #include "plain_wallet_api_defs.h" - #include "currency_core/currency_config.h" -diff --git a/src/wallet/plain_wallet_api.h b/src/wallet/plain_wallet_api.h -index f12eba03..177b8173 100644 ---- a/src/wallet/plain_wallet_api.h -+++ b/src/wallet/plain_wallet_api.h -@@ -6,6 +6,7 @@ - #pragma once - - #include -+#include - #include "../common/error_codes.h" - - namespace plain_wallet --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0001-fix-build-issues.patch b/patches/zano/0001-fix-build-issues.patch new file mode 100644 index 0000000..4ddcff0 --- /dev/null +++ b/patches/zano/0001-fix-build-issues.patch @@ -0,0 +1,39 @@ +From 38da066606cb959497d9b8221bb29ee885bc7c31 Mon Sep 17 00:00:00 2001 +From: cyan +Date: Sat, 2 Nov 2024 20:50:26 +0000 +Subject: [PATCH 1/7] fix build issues + +--- + contrib/db/libmdbx/CMakeLists.txt | 2 +- + contrib/db/libmdbx/packages/rpm/CMakeLists.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/contrib/db/libmdbx/CMakeLists.txt b/contrib/db/libmdbx/CMakeLists.txt +index 75e9b3b0..01a5915c 100644 +--- a/contrib/db/libmdbx/CMakeLists.txt ++++ b/contrib/db/libmdbx/CMakeLists.txt +@@ -80,7 +80,7 @@ macro(add_mdbx_option NAME DESCRIPTION DEFAULT) + endmacro() + + # only for compatibility testing +-# set(CMAKE_CXX_STANDARD 14) ++set(CMAKE_CXX_STANDARD 17) + + if(NOT "$ENV{TEAMCITY_PROCESS_FLOW_ID}" STREQUAL "") + set(CI TEAMCITY) +diff --git a/contrib/db/libmdbx/packages/rpm/CMakeLists.txt b/contrib/db/libmdbx/packages/rpm/CMakeLists.txt +index 5949e9f0..e7b677bd 100644 +--- a/contrib/db/libmdbx/packages/rpm/CMakeLists.txt ++++ b/contrib/db/libmdbx/packages/rpm/CMakeLists.txt +@@ -12,7 +12,7 @@ set(MDBX_VERSION_STRING ${MDBX_VERSION_MAJOR}.${MDBX_VERSION_MINOR}.${MDBX_VERSI + enable_language(C) + enable_language(CXX) + +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED on) + + add_definitions(-DNDEBUG=1 -DMDBX_DEBUG=0 -DLIBMDBX_EXPORTS=1 -D_GNU_SOURCE=1) +-- +2.48.1 + diff --git a/patches/zano/0002-fix-build-issues.patch b/patches/zano/0002-fix-build-issues.patch deleted file mode 100644 index 9ff3f85..0000000 --- a/patches/zano/0002-fix-build-issues.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 627750b0f1471c5d34755ca446d452429945d5d6 Mon Sep 17 00:00:00 2001 -From: cyan -Date: Sat, 2 Nov 2024 20:50:26 +0000 -Subject: [PATCH 2/5] fix build issues - ---- - contrib/db/libmdbx/CMakeLists.txt | 2 +- - contrib/db/libmdbx/packages/rpm/CMakeLists.txt | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/contrib/db/libmdbx/CMakeLists.txt b/contrib/db/libmdbx/CMakeLists.txt -index 75e9b3b0..01a5915c 100644 ---- a/contrib/db/libmdbx/CMakeLists.txt -+++ b/contrib/db/libmdbx/CMakeLists.txt -@@ -80,7 +80,7 @@ macro(add_mdbx_option NAME DESCRIPTION DEFAULT) - endmacro() - - # only for compatibility testing --# set(CMAKE_CXX_STANDARD 14) -+set(CMAKE_CXX_STANDARD 17) - - if(NOT "$ENV{TEAMCITY_PROCESS_FLOW_ID}" STREQUAL "") - set(CI TEAMCITY) -diff --git a/contrib/db/libmdbx/packages/rpm/CMakeLists.txt b/contrib/db/libmdbx/packages/rpm/CMakeLists.txt -index 5949e9f0..e7b677bd 100644 ---- a/contrib/db/libmdbx/packages/rpm/CMakeLists.txt -+++ b/contrib/db/libmdbx/packages/rpm/CMakeLists.txt -@@ -12,7 +12,7 @@ set(MDBX_VERSION_STRING ${MDBX_VERSION_MAJOR}.${MDBX_VERSION_MINOR}.${MDBX_VERSI - enable_language(C) - enable_language(CXX) - --set(CMAKE_CXX_STANDARD 11) -+set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED on) - - add_definitions(-DNDEBUG=1 -DMDBX_DEBUG=0 -DLIBMDBX_EXPORTS=1 -D_GNU_SOURCE=1) --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0002-fix-mingw-build-issues.patch b/patches/zano/0002-fix-mingw-build-issues.patch new file mode 100644 index 0000000..cbaa537 --- /dev/null +++ b/patches/zano/0002-fix-mingw-build-issues.patch @@ -0,0 +1,61 @@ +From 9e55bde82de70a12d68249233d2d571bf388a409 Mon Sep 17 00:00:00 2001 +From: cyan +Date: Sun, 3 Nov 2024 08:59:22 +0000 +Subject: [PATCH 2/7] fix mingw build issues + +--- + contrib/epee/include/misc_os_dependent.h | 4 ++-- + src/common/callstack_helper.cpp | 2 +- + src/crypto/ecrypt-config.h | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/contrib/epee/include/misc_os_dependent.h b/contrib/epee/include/misc_os_dependent.h +index c06e5d94..a2a979b9 100644 +--- a/contrib/epee/include/misc_os_dependent.h ++++ b/contrib/epee/include/misc_os_dependent.h +@@ -110,14 +110,14 @@ namespace misc_utils + } + + +-#if defined(__GNUC__) && !defined(__ANDROID__) ++#if defined(__GNUC__) && !defined(__ANDROID__) && !defined(_WIN32) + #include + #include + #endif + inline std::string print_trace_default() + { + std::stringstream ss; +-#if defined(__GNUC__) && !defined(__ANDROID__) ++#if defined(__GNUC__) && !defined(__ANDROID__) && !defined(_WIN32) + ss << std::endl << "STACK" << std::endl; + const size_t max_depth = 100; + size_t stack_depth; +diff --git a/src/common/callstack_helper.cpp b/src/common/callstack_helper.cpp +index b84fe5a8..c9eae839 100644 +--- a/src/common/callstack_helper.cpp ++++ b/src/common/callstack_helper.cpp +@@ -9,7 +9,7 @@ + #define NOMINMAX + #endif + #include +-#include ++#include + #pragma comment(lib, "psapi.lib") + #pragma comment(lib, "dbghelp.lib") + +diff --git a/src/crypto/ecrypt-config.h b/src/crypto/ecrypt-config.h +index 9176de17..8b488135 100644 +--- a/src/crypto/ecrypt-config.h ++++ b/src/crypto/ecrypt-config.h +@@ -257,7 +257,7 @@ + + #ifdef _UI64_MAX + +-#if (_UI64_MAX / 0xFFFFFFFFui64 > 0xFFFFFFFFui64) ++#if (_UI64_MAX / 0xFFFFFFFF > 0xFFFFFFFF) + #ifndef I64T + #define I64T __int64 + #define U64C(v) (v##ui64) +-- +2.48.1 + diff --git a/patches/zano/0003-fix-ios-builds.patch b/patches/zano/0003-fix-ios-builds.patch new file mode 100644 index 0000000..880345e --- /dev/null +++ b/patches/zano/0003-fix-ios-builds.patch @@ -0,0 +1,43 @@ +From 2eccbb7b4dfef6aef3de75ed843353343b2cc0c8 Mon Sep 17 00:00:00 2001 +From: Czarek Nakamoto +Date: Tue, 5 Nov 2024 16:52:23 +0100 +Subject: [PATCH 3/7] fix ios builds + +--- + CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c480300f..7087d796 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -136,6 +136,8 @@ else() + set(ARCH default CACHE STRING "CPU to build for: -march value or default") + if("${ARCH}" STREQUAL "default") + set(ARCH_FLAG "") ++ elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") ++ set(ARCH_FLAG "") + else() + set(ARCH_FLAG "-march=${ARCH}") + endif() +@@ -207,7 +209,7 @@ else() + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") + if(STATIC) + if(APPLE) +- message(SEND_ERROR "Static build is not supported on MacOS X") ++ message("Static build is not supported on MacOS X") + else() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") + endif() +@@ -260,8 +262,6 @@ else() + find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale log) + endif() + +- +- + message(STATUS "Boost: ${Boost_VERSION} from ${Boost_LIBRARY_DIRS}") + + +-- +2.48.1 + diff --git a/patches/zano/0003-fix-mingw-build-issues.patch b/patches/zano/0003-fix-mingw-build-issues.patch deleted file mode 100644 index 48b4d65..0000000 --- a/patches/zano/0003-fix-mingw-build-issues.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 1f7604d5b661f4490a1757e5ed1d6ed367ffb739 Mon Sep 17 00:00:00 2001 -From: cyan -Date: Sun, 3 Nov 2024 08:59:22 +0000 -Subject: [PATCH 3/5] fix mingw build issues - ---- - contrib/epee/include/misc_os_dependent.h | 4 ++-- - src/common/callstack_helper.cpp | 2 +- - src/crypto/ecrypt-config.h | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/contrib/epee/include/misc_os_dependent.h b/contrib/epee/include/misc_os_dependent.h -index c06e5d94..a2a979b9 100644 ---- a/contrib/epee/include/misc_os_dependent.h -+++ b/contrib/epee/include/misc_os_dependent.h -@@ -110,14 +110,14 @@ namespace misc_utils - } - - --#if defined(__GNUC__) && !defined(__ANDROID__) -+#if defined(__GNUC__) && !defined(__ANDROID__) && !defined(_WIN32) - #include - #include - #endif - inline std::string print_trace_default() - { - std::stringstream ss; --#if defined(__GNUC__) && !defined(__ANDROID__) -+#if defined(__GNUC__) && !defined(__ANDROID__) && !defined(_WIN32) - ss << std::endl << "STACK" << std::endl; - const size_t max_depth = 100; - size_t stack_depth; -diff --git a/src/common/callstack_helper.cpp b/src/common/callstack_helper.cpp -index b84fe5a8..c9eae839 100644 ---- a/src/common/callstack_helper.cpp -+++ b/src/common/callstack_helper.cpp -@@ -9,7 +9,7 @@ - #define NOMINMAX - #endif - #include --#include -+#include - #pragma comment(lib, "psapi.lib") - #pragma comment(lib, "dbghelp.lib") - -diff --git a/src/crypto/ecrypt-config.h b/src/crypto/ecrypt-config.h -index 9176de17..8b488135 100644 ---- a/src/crypto/ecrypt-config.h -+++ b/src/crypto/ecrypt-config.h -@@ -257,7 +257,7 @@ - - #ifdef _UI64_MAX - --#if (_UI64_MAX / 0xFFFFFFFFui64 > 0xFFFFFFFFui64) -+#if (_UI64_MAX / 0xFFFFFFFF > 0xFFFFFFFF) - #ifndef I64T - #define I64T __int64 - #define U64C(v) (v##ui64) --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0004-update-tor-connect.patch b/patches/zano/0004-update-tor-connect.patch deleted file mode 100644 index 76cc59d..0000000 --- a/patches/zano/0004-update-tor-connect.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 7d05e6a8d62ad3302bd1bb1818db36bde5885bab Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Tue, 5 Nov 2024 10:35:03 -0500 -Subject: [PATCH 4/5] update tor-connect - ---- - .gitmodules | 2 +- - contrib/tor-connect | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/.gitmodules b/.gitmodules -index 57896bbb..4df859f8 100644 ---- a/.gitmodules -+++ b/.gitmodules -@@ -7,7 +7,7 @@ - branch = main - [submodule "contrib/tor-connect"] - path = contrib/tor-connect -- url = https://github.com/hyle-team/tor-connect.git -+ url = https://github.com/MrCyjaneK/tor-connect.git - branch = main - [submodule "contrib/jwt-cpp"] - path = contrib/jwt-cpp -diff --git a/contrib/tor-connect b/contrib/tor-connect -index b589edb1..cc445b2f 160000 ---- a/contrib/tor-connect -+++ b/contrib/tor-connect -@@ -1 +1 @@ --Subproject commit b589edb1906dccb387cfeded6ed12286c5f0405f -+Subproject commit cd7f0c4b583488a7fe9b50de8e533a9853b6a5c7 --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0004-use-boost-filesystem-instead-of-stdfs.patch b/patches/zano/0004-use-boost-filesystem-instead-of-stdfs.patch new file mode 100644 index 0000000..1ede500 --- /dev/null +++ b/patches/zano/0004-use-boost-filesystem-instead-of-stdfs.patch @@ -0,0 +1,80 @@ +From 1ba500f05c1b534c9fbec8d1dc534546febb5b43 Mon Sep 17 00:00:00 2001 +From: Czarek Nakamoto +Date: Wed, 4 Dec 2024 17:21:44 -0600 +Subject: [PATCH 4/7] use boost::filesystem instead of stdfs + +--- + CMakeLists.txt | 23 ++++------------------- + contrib/epee/include/file_io_utils.h | 6 +++--- + 2 files changed, 7 insertions(+), 22 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7087d796..6ded9711 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -232,24 +232,9 @@ if(STATIC) + endif() + + message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") +-if(CMAKE_SYSTEM_NAME STREQUAL "iOS") +- set(CMAKE_OSX_DEPLOYMENT_TARGET 12.00) +- if(NOT DEFINED SKIP_BOOST_FATLIB_LIB OR NOT SKIP_BOOST_FATLIB_LIB) +- message("Ios: libboost.a included as library") +- set(Boost_LIBRARIES "libboost.a") +- else() +- message("Ios: libboost.a not included as library") +- endif() +- #workaround for new XCode 12 policy for builds(now it includes a slice for the "arm64" when builds for simulator) +- set(__iphoneos_archs "arm64") +- #set(__iphonesimulator_archs "arm64,x86_64") +- set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}") +- set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}") +- #set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}") +- #set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}") +-elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") ++if(CMAKE_SYSTEM_NAME STREQUAL "Android") + if(CAKEWALLET) +- find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale) ++ find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options) + else() + set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}/${CMAKE_ANDROID_ARCH_ABI}/") + set(Boost_LIBRARIES "${Boost_LIBRARY_DIRS}libboost_system.a;${Boost_LIBRARY_DIRS}libboost_filesystem.a;${Boost_LIBRARY_DIRS}libboost_thread.a;${Boost_LIBRARY_DIRS}libboost_timer.a;${Boost_LIBRARY_DIRS}libboost_date_time.a;${Boost_LIBRARY_DIRS}libboost_chrono.a;${Boost_LIBRARY_DIRS}libboost_regex.a;${Boost_LIBRARY_DIRS}libboost_serialization.a;${Boost_LIBRARY_DIRS}libboost_atomic.a;${Boost_LIBRARY_DIRS}libboost_program_options.a") +@@ -257,7 +242,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC") + elseif(APPLE) +- find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale) ++ find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options) + else() + find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale log) + endif() +@@ -302,7 +287,7 @@ else() + find_package(Git QUIET) + if(Git_FOUND OR GIT_FOUND) + message(STATUS "Found Git: ${GIT_EXECUTABLE}") +- add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") ++ add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + else() + message(STATUS "WARNING: Git was not found!") + set(VERSION "${VERSION}-unknown") +diff --git a/contrib/epee/include/file_io_utils.h b/contrib/epee/include/file_io_utils.h +index bb21ae99..ced01092 100644 +--- a/contrib/epee/include/file_io_utils.h ++++ b/contrib/epee/include/file_io_utils.h +@@ -574,10 +574,10 @@ namespace file_io_utils + try + { + +- stdfs::directory_iterator end_itr; // default construction yields past-the-end +- for (stdfs::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr ) ++ boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end ++ for ( boost::filesystem::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr ) + { +- if ( only_files && stdfs::is_directory(itr->status()) ) ++ if ( only_files && boost::filesystem::is_directory(itr->status()) ) + { + continue; + } +-- +2.48.1 + diff --git a/patches/zano/0005-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch b/patches/zano/0005-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch new file mode 100644 index 0000000..0c5af27 --- /dev/null +++ b/patches/zano/0005-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch @@ -0,0 +1,22 @@ +From 00bfd0703db144cb51f667c183ff5d066dec2f9c Mon Sep 17 00:00:00 2001 +From: Czarek Nakamoto +Date: Thu, 5 Dec 2024 09:36:34 -0600 +Subject: [PATCH 5/7] downgrade cmake version so LIB_DEPENDS shows up + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6ded9711..47d24a81 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.16) ++cmake_minimum_required(VERSION 3.5) + + PROJECT(Zano) + +-- +2.48.1 + diff --git a/patches/zano/0005-fix-ios-builds.patch b/patches/zano/0005-fix-ios-builds.patch deleted file mode 100644 index f68244f..0000000 --- a/patches/zano/0005-fix-ios-builds.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 20975fed75b7255f6cb6df74a17f1923f7159c09 Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Tue, 5 Nov 2024 16:52:23 +0100 -Subject: [PATCH 5/5] fix ios builds - ---- - CMakeLists.txt | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c480300f..7087d796 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -136,6 +136,8 @@ else() - set(ARCH default CACHE STRING "CPU to build for: -march value or default") - if("${ARCH}" STREQUAL "default") - set(ARCH_FLAG "") -+ elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") -+ set(ARCH_FLAG "") - else() - set(ARCH_FLAG "-march=${ARCH}") - endif() -@@ -207,7 +209,7 @@ else() - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") - if(STATIC) - if(APPLE) -- message(SEND_ERROR "Static build is not supported on MacOS X") -+ message("Static build is not supported on MacOS X") - else() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") - endif() -@@ -260,8 +262,6 @@ else() - find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale log) - endif() - -- -- - message(STATUS "Boost: ${Boost_VERSION} from ${Boost_LIBRARY_DIRS}") - - --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0006-increase-max-password.patch b/patches/zano/0006-increase-max-password.patch new file mode 100644 index 0000000..83415b0 --- /dev/null +++ b/patches/zano/0006-increase-max-password.patch @@ -0,0 +1,25 @@ +From cefa69627a46ec6fd54e3c44e82f1d777e3c98c0 Mon Sep 17 00:00:00 2001 +From: Czarek Nakamoto +Date: Thu, 12 Dec 2024 09:00:57 -0500 +Subject: [PATCH 6/7] increase max password + +--- + src/currency_core/currency_format_utils.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp +index 56316dd5..d92e5793 100644 +--- a/src/currency_core/currency_format_utils.cpp ++++ b/src/currency_core/currency_format_utils.cpp +@@ -3653,7 +3653,7 @@ namespace currency + return true; + } + //------------------------------------------------------------------ +- #define PASSWORD_REGEXP R"([A-Za-z0-9~!?@#$%^&*_+|{}\[\]()<>:;"'\-=/.,]{0,40})" ++ #define PASSWORD_REGEXP R"([A-Za-z0-9~!?@#$%^&*_+|{}\[\]()<>:;"'\-=/.,]{0,2048})" + bool validate_password(const std::string& password) + { + // OLD: static const std::string allowed_password_symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!?@#$%^&*_+|{}[]()<>:;\"'-=\\/.,"; +-- +2.48.1 + diff --git a/patches/zano/0006-use-boost-filesystem-instead-of-stdfs.patch b/patches/zano/0006-use-boost-filesystem-instead-of-stdfs.patch deleted file mode 100644 index 64b7f4c..0000000 --- a/patches/zano/0006-use-boost-filesystem-instead-of-stdfs.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 033d71f4a8623dee3508c493431402bbbe5a8b2d Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Wed, 4 Dec 2024 17:21:44 -0600 -Subject: [PATCH] use boost::filesystem instead of stdfs - ---- - CMakeLists.txt | 23 ++++------------------- - contrib/epee/include/file_io_utils.h | 6 +++--- - 2 files changed, 7 insertions(+), 22 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7087d796..6ded9711 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -232,24 +232,9 @@ if(STATIC) - endif() - - message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") --if(CMAKE_SYSTEM_NAME STREQUAL "iOS") -- set(CMAKE_OSX_DEPLOYMENT_TARGET 12.00) -- if(NOT DEFINED SKIP_BOOST_FATLIB_LIB OR NOT SKIP_BOOST_FATLIB_LIB) -- message("Ios: libboost.a included as library") -- set(Boost_LIBRARIES "libboost.a") -- else() -- message("Ios: libboost.a not included as library") -- endif() -- #workaround for new XCode 12 policy for builds(now it includes a slice for the "arm64" when builds for simulator) -- set(__iphoneos_archs "arm64") -- #set(__iphonesimulator_archs "arm64,x86_64") -- set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}") -- set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}") -- #set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}") -- #set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}") --elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") -+if(CMAKE_SYSTEM_NAME STREQUAL "Android") - if(CAKEWALLET) -- find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale) -+ find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options) - else() - set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}/${CMAKE_ANDROID_ARCH_ABI}/") - set(Boost_LIBRARIES "${Boost_LIBRARY_DIRS}libboost_system.a;${Boost_LIBRARY_DIRS}libboost_filesystem.a;${Boost_LIBRARY_DIRS}libboost_thread.a;${Boost_LIBRARY_DIRS}libboost_timer.a;${Boost_LIBRARY_DIRS}libboost_date_time.a;${Boost_LIBRARY_DIRS}libboost_chrono.a;${Boost_LIBRARY_DIRS}libboost_regex.a;${Boost_LIBRARY_DIRS}libboost_serialization.a;${Boost_LIBRARY_DIRS}libboost_atomic.a;${Boost_LIBRARY_DIRS}libboost_program_options.a") -@@ -257,7 +242,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC") - elseif(APPLE) -- find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale) -+ find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options) - else() - find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale log) - endif() -@@ -302,7 +287,7 @@ else() - find_package(Git QUIET) - if(Git_FOUND OR GIT_FOUND) - message(STATUS "Found Git: ${GIT_EXECUTABLE}") -- add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") -+ add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") - else() - message(STATUS "WARNING: Git was not found!") - set(VERSION "${VERSION}-unknown") -diff --git a/contrib/epee/include/file_io_utils.h b/contrib/epee/include/file_io_utils.h -index bb21ae99..ced01092 100644 ---- a/contrib/epee/include/file_io_utils.h -+++ b/contrib/epee/include/file_io_utils.h -@@ -574,10 +574,10 @@ namespace file_io_utils - try - { - -- stdfs::directory_iterator end_itr; // default construction yields past-the-end -- for (stdfs::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr ) -+ boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end -+ for ( boost::filesystem::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr ) - { -- if ( only_files && stdfs::is_directory(itr->status()) ) -+ if ( only_files && boost::filesystem::is_directory(itr->status()) ) - { - continue; - } --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch b/patches/zano/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch deleted file mode 100644 index 0ac7e50..0000000 --- a/patches/zano/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch +++ /dev/null @@ -1,22 +0,0 @@ -From e6201106cd09416f96c8d83270c94565583cd356 Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Thu, 5 Dec 2024 09:36:34 -0600 -Subject: [PATCH] downgrade cmake version so LIB_DEPENDS shows up - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6ded9711..47d24a81 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.16) -+cmake_minimum_required(VERSION 3.5) - - PROJECT(Zano) - --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0007-relax-mutex-in-invoke-call.patch b/patches/zano/0007-relax-mutex-in-invoke-call.patch new file mode 100644 index 0000000..cb38d5f --- /dev/null +++ b/patches/zano/0007-relax-mutex-in-invoke-call.patch @@ -0,0 +1,88 @@ +From af034097788cb58518b794c1312f8a8df297dda7 Mon Sep 17 00:00:00 2001 +From: Czarek Nakamoto +Date: Tue, 18 Feb 2025 14:27:36 +0100 +Subject: [PATCH 7/7] relax mutex in invoke call + +--- + src/common/error_codes.h | 1 + + src/wallet/wallets_manager.cpp | 37 ++++++++++++++++++++++++++++++---- + 2 files changed, 34 insertions(+), 4 deletions(-) + +diff --git a/src/common/error_codes.h b/src/common/error_codes.h +index 1e3dc2ef..4723afe4 100644 +--- a/src/common/error_codes.h ++++ b/src/common/error_codes.h +@@ -45,3 +45,4 @@ + #define API_RETURN_CODE_HTLC_ORIGIN_HASH_MISSMATCHED "HTLC_ORIGIN_HASH_MISSMATCHED" + #define API_RETURN_CODE_WRAP "WRAP" + #define API_RETURN_CODE_MISSING_ZC_INPUTS "MISSING_ZC_INPUTS" ++#define API_RETURN_CODE_BAD_JSON "BAD_JSON" +\ No newline at end of file +diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp +index 5c8ef5c0..4b968a18 100644 +--- a/src/wallet/wallets_manager.cpp ++++ b/src/wallet/wallets_manager.cpp +@@ -1678,10 +1678,27 @@ std::string wallets_manager::get_wallet_status(uint64_t wallet_id) + return epee::serialization::store_t_to_json(wsi); + } + ++struct json_just_method ++{ ++ std::string method; ++ BEGIN_KV_SERIALIZE_MAP() ++ KV_SERIALIZE(method) ++ END_KV_SERIALIZE_MAP() ++}; ++ + std::string wallets_manager::invoke(uint64_t wallet_id, std::string params) + { + GET_WALLET_OPT_BY_ID(wallet_id, wo); + ++ json_just_method req = {}; ++ if (!epee::serialization::load_t_from_json(req, params)) ++ { ++ epee::json_rpc::response error_response = AUTO_VAL_INIT(error_response); ++ error_response.error.code = -1; ++ error_response.error.message = API_RETURN_CODE_BAD_JSON; ++ return epee::serialization::store_t_to_json(error_response); ++ } ++ + CRITICAL_REGION_LOCAL1(wo.long_refresh_in_progress_lock); + if (wo.long_refresh_in_progress) + { +@@ -1691,16 +1708,28 @@ std::string wallets_manager::invoke(uint64_t wallet_id, std::string params) + return epee::serialization::store_t_to_json(error_response); + } + +- +- auto locker_object = wo.w.lock(); +- + epee::net_utils::http::http_request_info query_info = AUTO_VAL_INIT(query_info); + epee::net_utils::http::http_response_info response_info = AUTO_VAL_INIT(response_info); + epee::net_utils::connection_context_base stub_conn_context = AUTO_VAL_INIT(stub_conn_context); + bool call_found = false; + query_info.m_URI = "/json_rpc"; + query_info.m_body = params; +- wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found); ++ ++ if (req.method != "assets_whitelist_get" && ++ req.method != "decrypt_data" && ++ req.method != "encrypt_data" && ++ req.method != "get_restore_info" && ++ req.method != "get_seed_phrase_info" && ++ req.method != "get_wallet_info" && ++ req.method != "getaddress" && ++ req.method != "getbalance" && ++ req.method != "sign_message") { ++ auto locker_object = wo.w.lock(); ++ wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found); ++ } else { ++ wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found); ++ } ++ + return response_info.m_body; + } + +-- +2.48.1 + diff --git a/patches/zano/0008-increase-max-password.patch b/patches/zano/0008-increase-max-password.patch deleted file mode 100644 index 0ce87c7..0000000 --- a/patches/zano/0008-increase-max-password.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 6812b5de7e0a52e9341e54dbe2fc0b790dc6de5a Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Thu, 12 Dec 2024 09:00:57 -0500 -Subject: [PATCH] increase max password - ---- - src/currency_core/currency_format_utils.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp -index 96d55b4..0c3d947 100644 ---- a/src/currency_core/currency_format_utils.cpp -+++ b/src/currency_core/currency_format_utils.cpp -@@ -3632,7 +3632,7 @@ namespace currency - return true; - } - //------------------------------------------------------------------ -- #define PASSWORD_REGEXP R"([A-Za-z0-9~!?@#$%^&*_+|{}\[\]()<>:;"'\-=/.,]{0,40})" -+ #define PASSWORD_REGEXP R"([A-Za-z0-9~!?@#$%^&*_+|{}\[\]()<>:;"'\-=/.,]{0,2048})" - bool validate_password(const std::string& password) - { - // OLD: static const std::string allowed_password_symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!?@#$%^&*_+|{}[]()<>:;\"'-=\\/.,"; --- -2.39.5 (Apple Git-154) - diff --git a/patches/zano/0009-add-keys-to-open_wallet_response.patch b/patches/zano/0009-add-keys-to-open_wallet_response.patch deleted file mode 100644 index 1ca4952..0000000 --- a/patches/zano/0009-add-keys-to-open_wallet_response.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 8f6c62f969ee38e7db5a0e639cd08216ba79d6d1 Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Tue, 18 Feb 2025 04:29:30 +0100 -Subject: [PATCH] add keys to open_wallet_response - ---- - src/wallet/view_iface.h | 8 ++++++++ - src/wallet/wallets_manager.cpp | 19 +++++++++++++++++++ - 2 files changed, 27 insertions(+) - -diff --git a/src/wallet/view_iface.h b/src/wallet/view_iface.h -index dce4b5ee0..bda58d05f 100644 ---- a/src/wallet/view_iface.h -+++ b/src/wallet/view_iface.h -@@ -452,6 +452,10 @@ public: - transfers_array recent_history; - wallet_info wi; - std::string seed; -+ std::string private_spend_key; -+ std::string private_view_key; -+ std::string public_spend_key; -+ std::string public_view_key; - bool recovered; - uint64_t wallet_local_bc_size; - uint64_t wallet_file_size; -@@ -463,6 +467,10 @@ public: - KV_SERIALIZE(recent_history) - KV_SERIALIZE(wi) - KV_SERIALIZE(seed) -+ KV_SERIALIZE(private_spend_key) -+ KV_SERIALIZE(private_view_key) -+ KV_SERIALIZE(public_spend_key) -+ KV_SERIALIZE(public_view_key) - KV_SERIALIZE(recovered) - KV_SERIALIZE(wallet_local_bc_size) - KV_SERIALIZE(wallet_file_size) -diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp -index 8859ec8d7..7155771d2 100644 ---- a/src/wallet/wallets_manager.cpp -+++ b/src/wallet/wallets_manager.cpp -@@ -1086,6 +1086,13 @@ std::string wallets_manager::open_wallet(const std::wstring& path, const std::st - - //workaround for missed fee - owr.seed = w->get_account().get_seed_phrase(""); -+ auto& keys = w->get_account().get_keys(); -+ -+ owr.private_view_key = epee::string_tools::pod_to_hex(keys.view_secret_key); -+ owr.public_view_key = epee::string_tools::pod_to_hex(keys.account_address.view_public_key); -+ owr.private_spend_key = epee::string_tools::pod_to_hex(keys.spend_secret_key); -+ owr.public_spend_key = epee::string_tools::pod_to_hex(keys.account_address.spend_public_key); -+ // open_wallet_response - break; - } - catch (const tools::error::file_not_found& /**/) -@@ -1197,6 +1204,12 @@ std::string wallets_manager::generate_wallet(const std::wstring& path, const std - w->generate(path, password, false); - w->set_minimum_height(m_last_daemon_height-1); - owr.seed = w->get_account().get_seed_phrase(""); -+ auto& keys = w->get_account().get_keys(); -+ -+ owr.private_view_key = epee::string_tools::pod_to_hex(keys.view_secret_key); -+ owr.public_view_key = epee::string_tools::pod_to_hex(keys.account_address.view_public_key); -+ owr.private_spend_key = epee::string_tools::pod_to_hex(keys.spend_secret_key); -+ owr.public_spend_key = epee::string_tools::pod_to_hex(keys.account_address.spend_public_key); - } - catch (const tools::error::file_exists&) - { -@@ -1306,6 +1319,12 @@ std::string wallets_manager::restore_wallet(const std::wstring& path, const std: - bool is_tracking = currency::account_base::is_seed_tracking(seed_phrase); - w->restore(path, password, seed_phrase, is_tracking, seed_password); - owr.seed = w->get_account().get_seed_phrase(""); -+ auto& keys = w->get_account().get_keys(); -+ -+ owr.private_view_key = epee::string_tools::pod_to_hex(keys.view_secret_key); -+ owr.public_view_key = epee::string_tools::pod_to_hex(keys.account_address.view_public_key); -+ owr.private_spend_key = epee::string_tools::pod_to_hex(keys.spend_secret_key); -+ owr.public_spend_key = epee::string_tools::pod_to_hex(keys.account_address.spend_public_key); - } - catch (const tools::error::file_exists&) - { --- -2.48.1 - diff --git a/patches/zano/0010-relax-mutex-in-invoke-call.patch b/patches/zano/0010-relax-mutex-in-invoke-call.patch deleted file mode 100644 index e3e29a7..0000000 --- a/patches/zano/0010-relax-mutex-in-invoke-call.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 2421d1fb4b4c50c1372361b1688f7d9fff9ef716 Mon Sep 17 00:00:00 2001 -From: Czarek Nakamoto -Date: Tue, 18 Feb 2025 14:27:36 +0100 -Subject: [PATCH] relax mutex in invoke call - ---- - src/common/error_codes.h | 1 + - src/wallet/wallets_manager.cpp | 37 ++++++++++++++++++++++++++++++---- - 2 files changed, 34 insertions(+), 4 deletions(-) - -diff --git a/src/common/error_codes.h b/src/common/error_codes.h -index 1e3dc2efc..4723afe40 100644 ---- a/src/common/error_codes.h -+++ b/src/common/error_codes.h -@@ -45,3 +45,4 @@ - #define API_RETURN_CODE_HTLC_ORIGIN_HASH_MISSMATCHED "HTLC_ORIGIN_HASH_MISSMATCHED" - #define API_RETURN_CODE_WRAP "WRAP" - #define API_RETURN_CODE_MISSING_ZC_INPUTS "MISSING_ZC_INPUTS" -+#define API_RETURN_CODE_BAD_JSON "BAD_JSON" -\ No newline at end of file -diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp -index 7155771d2..3da57dc7a 100644 ---- a/src/wallet/wallets_manager.cpp -+++ b/src/wallet/wallets_manager.cpp -@@ -1675,10 +1675,27 @@ std::string wallets_manager::get_wallet_status(uint64_t wallet_id) - return epee::serialization::store_t_to_json(wsi); - } - -+struct json_just_method -+{ -+ std::string method; -+ BEGIN_KV_SERIALIZE_MAP() -+ KV_SERIALIZE(method) -+ END_KV_SERIALIZE_MAP() -+}; -+ - std::string wallets_manager::invoke(uint64_t wallet_id, std::string params) - { - GET_WALLET_OPT_BY_ID(wallet_id, wo); - -+ json_just_method req = {}; -+ if (!epee::serialization::load_t_from_json(req, params)) -+ { -+ epee::json_rpc::response error_response = AUTO_VAL_INIT(error_response); -+ error_response.error.code = -1; -+ error_response.error.message = API_RETURN_CODE_BAD_JSON; -+ return epee::serialization::store_t_to_json(error_response); -+ } -+ - CRITICAL_REGION_LOCAL1(wo.long_refresh_in_progress_lock); - if (wo.long_refresh_in_progress) - { -@@ -1688,16 +1705,28 @@ std::string wallets_manager::invoke(uint64_t wallet_id, std::string params) - return epee::serialization::store_t_to_json(error_response); - } - -- -- auto locker_object = wo.w.lock(); -- - epee::net_utils::http::http_request_info query_info = AUTO_VAL_INIT(query_info); - epee::net_utils::http::http_response_info response_info = AUTO_VAL_INIT(response_info); - epee::net_utils::connection_context_base stub_conn_context = AUTO_VAL_INIT(stub_conn_context); - bool call_found = false; - query_info.m_URI = "/json_rpc"; - query_info.m_body = params; -- wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found); -+ -+ if (req.method != "assets_whitelist_get" && -+ req.method != "decrypt_data" && -+ req.method != "encrypt_data" && -+ req.method != "get_restore_info" && -+ req.method != "get_seed_phrase_info" && -+ req.method != "get_wallet_info" && -+ req.method != "getaddress" && -+ req.method != "getbalance" && -+ req.method != "sign_message") { -+ auto locker_object = wo.w.lock(); -+ wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found); -+ } else { -+ wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found); -+ } -+ - return response_info.m_body; - } - --- -2.48.1 - -- cgit v1.2.3