From cf0fb86d9096fbf5117729615f6cd93c27f3a8ab Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 12 May 2020 13:02:06 +0300 Subject: [PATCH 01/14] GUI: fix unconditional backend stop when predownloading fails --- src/wallet/wallets_manager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp index 5583e073..f9c27a43 100644 --- a/src/wallet/wallets_manager.cpp +++ b/src/wallet/wallets_manager.cpp @@ -345,7 +345,10 @@ bool wallets_manager::init_local_daemon() return static_cast(m_stop_singal_sent); }); - CHECK_AND_ASSERT_AND_SET_GUI(res, "pre-downloading failed"); + if (!res) + { + LOG_PRINT_RED("pre-downloading failed, continue with normal network synchronization", LOG_LEVEL_0); + } } From f6d99e39bb575144308c884fdacfb99351d08e39 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 12 May 2020 18:47:43 +0300 Subject: [PATCH 02/14] === version bump: 1.1.5.82 -> 1.1.6.83 === --- src/version.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h.in b/src/version.h.in index 80308ff7..a5a8a26b 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -5,9 +5,9 @@ #define PROJECT_MAJOR_VERSION "1" #define PROJECT_MINOR_VERSION "1" -#define PROJECT_REVISION "5" +#define PROJECT_REVISION "6" #define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION -#define PROJECT_VERSION_BUILD_NO 82 +#define PROJECT_VERSION_BUILD_NO 83 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]" From bc6b9510991d71741764a9c3ac86d27a1d329666 Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 13 May 2020 10:27:04 +0300 Subject: [PATCH 03/14] pre-downloading: increase timeout and attempt count --- src/common/pre_download.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/pre_download.h b/src/common/pre_download.h index d4598207..3b5657c2 100644 --- a/src/common/pre_download.h +++ b/src/common/pre_download.h @@ -88,7 +88,7 @@ namespace tools }; tools::create_directories_if_necessary(working_folder); - r = cl.download_and_unzip(cb, downloading_file_path, url, 1000 /* timout */, "GET", std::string(), 3 /* fails count */); + r = cl.download_and_unzip(cb, downloading_file_path, url, 5000 /* timout */, "GET", std::string(), 30 /* fails count */); if (!r) { LOG_PRINT_RED("Download failed", LOG_LEVEL_0); From a1c5343c4b8a8ef0eeb47fd2e4b026bd665112e0 Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 13 May 2020 10:29:14 +0300 Subject: [PATCH 04/14] http_client improved to stop on permanent HTTP error + logs --- contrib/epee/include/net/http_client.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/contrib/epee/include/net/http_client.h b/contrib/epee/include/net/http_client.h index 3ca863b6..be81ba41 100644 --- a/contrib/epee/include/net/http_client.h +++ b/contrib/epee/include/net/http_client.h @@ -925,6 +925,7 @@ using namespace std; class interruptible_http_client : public http_simple_client { std::shared_ptr m_pcb; + bool m_permanent_error = false; virtual bool handle_target_data(std::string& piece_of_transfer) { @@ -943,6 +944,7 @@ using namespace std; if (p_hri && !(p_hri->m_response_code >= 200 && p_hri->m_response_code < 300)) { LOG_PRINT_L0("HTTP request to " << url << " failed with code: " << p_hri->m_response_code); + m_permanent_error = true; return false; } return r; @@ -1002,24 +1004,33 @@ using namespace std; }; uint64_t current_err_count = 0; bool r = false; - + m_permanent_error = false; while (!r && current_err_count < fails_count) { - LOG_PRINT_L0("Attempt to invoke http: " << url << " (offset:" << state_received_bytes_base << ")"); + LOG_PRINT_L0("Attempt " << current_err_count + 1 << "/" << fails_count << " to get " << url << " (offset:" << state_received_bytes_base << ")"); fields_list additional_params_local = additional_params; additional_params_local.push_back(std::make_pair("Range", std::string("bytes=") + std::to_string(state_received_bytes_base) + "-")); r = this->invoke_cb(local_cb, url, timeout, method, body, additional_params_local); if (!r) { - if (stopped) + if (stopped || m_permanent_error) break; current_err_count++; state_received_bytes_base += state_received_bytes_current; state_received_bytes_current = 0; - boost::this_thread::sleep_for(boost::chrono::milliseconds(500)); + boost::this_thread::sleep_for(boost::chrono::milliseconds(2000)); } } + if (current_err_count >= fails_count) + { + LOG_PRINT_YELLOW("Downloading from " << url << " FAILED as it's reached maximum (" << fails_count << ") number of attempts. Downloaded " << state_received_bytes_base << " bytes.", LOG_LEVEL_0); + } + else if (m_permanent_error) + { + LOG_PRINT_YELLOW("Downloading from " << url << " FAILED due to permanent HTTP error. Downloaded " << state_received_bytes_base << " bytes.", LOG_LEVEL_0); + } + fs.close(); return r; } From 932f66bc00dd5e7f52885241f4b87b3a7c7c758c Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 14 May 2020 17:42:51 +0300 Subject: [PATCH 05/14] GUI: default mixin count set to 10 --- src/gui/qt-daemon/html/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/qt-daemon/html/main.js b/src/gui/qt-daemon/html/main.js index 33a5e4aa..dccb0a60 100644 --- a/src/gui/qt-daemon/html/main.js +++ b/src/gui/qt-daemon/html/main.js @@ -7214,7 +7214,7 @@ var SendComponent = /** @class */ (function () { return null; }]), comment: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](''), - mixin: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](0, _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required), + mixin: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](10, _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required), fee: new _angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormControl"](this.variablesService.default_fee, [_angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required, function (g) { if ((new bignumber_js__WEBPACK_IMPORTED_MODULE_6__["BigNumber"](g.value)).isLessThan(_this.variablesService.default_fee)) { return { 'less_min': true }; @@ -7246,7 +7246,7 @@ var SendComponent = /** @class */ (function () { address: _this.variablesService.currentWallet.send_data['address'], amount: _this.variablesService.currentWallet.send_data['amount'], comment: _this.variablesService.currentWallet.send_data['comment'], - mixin: _this.variablesService.currentWallet.send_data['mixin'] || 0, + mixin: _this.variablesService.currentWallet.send_data['mixin'] || 10, fee: _this.variablesService.currentWallet.send_data['fee'] || _this.variablesService.default_fee, hide: _this.variablesService.currentWallet.send_data['hide'] || false }); From ecea7545e9f80e7b3e367c15a38c167c49df0f1e Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 14 May 2020 17:50:14 +0300 Subject: [PATCH 06/14] === build number: 83 -> 84 === --- src/version.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h.in b/src/version.h.in index a5a8a26b..2731075f 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -8,6 +8,6 @@ #define PROJECT_REVISION "6" #define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION -#define PROJECT_VERSION_BUILD_NO 83 +#define PROJECT_VERSION_BUILD_NO 84 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]" From 5ca6c8077e04270f08182584f00b972d429aa5d9 Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 14 May 2020 19:00:13 +0300 Subject: [PATCH 07/14] added checkpoint for height 525000 (mainnet) and height 350000 (testnet) --- src/currency_core/checkpoints_create.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/currency_core/checkpoints_create.h b/src/currency_core/checkpoints_create.h index 95eb6a08..ede0cb37 100644 --- a/src/currency_core/checkpoints_create.h +++ b/src/currency_core/checkpoints_create.h @@ -19,9 +19,11 @@ namespace currency #ifdef TESTNET ADD_CHECKPOINT(50000, "cb05a7bdc7f78c5cdb6ef1048f85b27c569f44879233903ce5f5a4e5bd590a3d"); ADD_CHECKPOINT(100000, "6b8b54356a9d44f6c1ebdacb8593d8f5ab2e2e2ca4493e7ae7baf4b3755c5e16"); + ADD_CHECKPOINT(350000, "885841f079e5a38f1921f4a5319f0d52fdbab64bb2026ca3cabad1c032d22db7"); #else // MAINNET ADD_CHECKPOINT(425000, "46a6c36d5dec2d484d5e4845a8525ca322aafc06915ed9c8da2a241b51b7d1e8"); + ADD_CHECKPOINT(525000, "8c1ac57e67448130207a224b2d6e33ccdc64d6dd1c59dbcf9ad2361dc0d07d51"); #endif return true; From 19ec19e676d699feaa09c664aa7bae2f3fe1acfc Mon Sep 17 00:00:00 2001 From: sowle Date: Fri, 15 May 2020 11:56:42 +0300 Subject: [PATCH 08/14] pre-downloading links updated --- src/common/pre_download.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/pre_download.h b/src/common/pre_download.h index 3b5657c2..29c0a269 100644 --- a/src/common/pre_download.h +++ b/src/common/pre_download.h @@ -21,8 +21,8 @@ namespace tools }; #ifndef TESTNET - static constexpr pre_download_entry c_pre_download_lmdb = { "http://95.217.43.225/pre-download/zano_lmdb_94_425000.pak", "e6ac69dcf8e7a7017d032cb4326d661c541a3b6a328e6299e6d61c3acde5d49f", 684683820, 1021865984 }; - static constexpr pre_download_entry c_pre_download_mdbx = { "http://95.217.43.225/pre-download/zano_mdbx_94_425000.pak", "e1f50efba1149a349eb626037dda30052c0233091693a00a10dd5363d5de1206", 535268266, 1073725440 }; + static constexpr pre_download_entry c_pre_download_lmdb = { "http://95.217.43.225/pre-download/zano_lmdb_94_524999.pak", "ac46a4932813e28fe11ec160a2be4e48c961dce701ecace5133184cff2754d3d", 747173581, 1087696896 }; + static constexpr pre_download_entry c_pre_download_mdbx = { "http://95.217.43.225/pre-download/zano_mdbx_94_524999.pak", "b195fdc1bda7173469db0b313f2ead2dbda1788639ba0aedb7001a6cc640fc47", 561335640, 1342156800 }; #else static constexpr pre_download_entry c_pre_download_lmdb = { "http://95.217.43.225/pre-download/zano_testnet_lmdb_96_99000.pak", "9e8522b287ac7637ca770970542e94702f9fbaa267633cfcaeee4383dfe15bd0", 83851119, 131493888 }; static constexpr pre_download_entry c_pre_download_mdbx = { "http://95.217.43.225/pre-download/zano_testnet_mdbx_96_99000.pak", "de33646711f2276e5b22db5741d7b2bf6a8e4c4231d393b730f9a4fce1d7ec03", 63257747, 268431360 }; From 4f91adbd08da20ffb5df57583e7f2c49816cd6e1 Mon Sep 17 00:00:00 2001 From: sowle Date: Fri, 15 May 2020 13:33:02 +0300 Subject: [PATCH 09/14] ethash: log full dataset size on epoch change --- contrib/ethereum/libethash/ethash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ethereum/libethash/ethash.cpp b/contrib/ethereum/libethash/ethash.cpp index 10ee9c6d..b6315236 100644 --- a/contrib/ethereum/libethash/ethash.cpp +++ b/contrib/ethereum/libethash/ethash.cpp @@ -149,7 +149,7 @@ epoch_context_full* create_epoch_context( LOG_CUSTOM_WITH_CALLSTACK("CRITICAL: std::calloc(" << alloc_size << ") failed in create_epoch_context()", 0); return nullptr; // Signal out-of-memory by returning null pointer. } - LOG_CUSTOM("context for epoch " << epoch_number << " allocated, size: " << alloc_size << " bytes", 0); + LOG_CUSTOM("context for epoch " << epoch_number << " allocated, size: " << alloc_size << " bytes, full dataset size: " << full_dataset_size << " bytes", 0); hash512* const light_cache = reinterpret_cast(alloc_data + context_alloc_size); const hash256 epoch_seed = calculate_epoch_seed(epoch_number); From 15ea90c14ebc9183b384b7cd9d4f41f03277ed04 Mon Sep 17 00:00:00 2001 From: sowle Date: Fri, 15 May 2020 13:36:20 +0300 Subject: [PATCH 10/14] === build number: 84 -> 85 === --- src/version.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h.in b/src/version.h.in index 2731075f..91ce5031 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -8,6 +8,6 @@ #define PROJECT_REVISION "6" #define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION -#define PROJECT_VERSION_BUILD_NO 84 +#define PROJECT_VERSION_BUILD_NO 85 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]" From dbf70494ba0e9fdf8588592d38a6e2a9af65d2a3 Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 20 May 2020 18:34:37 +0300 Subject: [PATCH 11/14] gui: reset default mixin to 10 after sending a tx --- src/gui/qt-daemon/html/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/qt-daemon/html/main.js b/src/gui/qt-daemon/html/main.js index dccb0a60..b410e1dc 100644 --- a/src/gui/qt-daemon/html/main.js +++ b/src/gui/qt-daemon/html/main.js @@ -7276,7 +7276,7 @@ var SendComponent = /** @class */ (function () { if (send_status) { _this.modalService.prepareModal('success', 'SEND.SUCCESS_SENT'); _this.variablesService.currentWallet.send_data = { address: null, amount: null, comment: null, mixin: null, fee: null, hide: null }; - _this.sendForm.reset({ address: null, amount: null, comment: null, mixin: 0, fee: _this.variablesService.default_fee, hide: false }); + _this.sendForm.reset({ address: null, amount: null, comment: null, mixin: 10, fee: _this.variablesService.default_fee, hide: false }); } }); } From a74dc3140a3666b40c9849a05946d7e0af9f0610 Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 20 May 2020 18:35:40 +0300 Subject: [PATCH 12/14] === build number: 85 -> 86 === --- src/version.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h.in b/src/version.h.in index 91ce5031..c72c4910 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -8,6 +8,6 @@ #define PROJECT_REVISION "6" #define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION -#define PROJECT_VERSION_BUILD_NO 85 +#define PROJECT_VERSION_BUILD_NO 86 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]" From 05f15d55602be6c1260499c8078b9a716638942d Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 20 May 2020 21:04:03 +0300 Subject: [PATCH 13/14] gui: attempt to fix default mixin value for alias-targeted tx --- src/gui/qt-daemon/html/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/qt-daemon/html/main.js b/src/gui/qt-daemon/html/main.js index b410e1dc..d59b34d3 100644 --- a/src/gui/qt-daemon/html/main.js +++ b/src/gui/qt-daemon/html/main.js @@ -7296,7 +7296,7 @@ var SendComponent = /** @class */ (function () { if (send_status) { _this.modalService.prepareModal('success', 'SEND.SUCCESS_SENT'); _this.variablesService.currentWallet.send_data = { address: null, amount: null, comment: null, mixin: null, fee: null, hide: null }; - _this.sendForm.reset({ address: null, amount: null, comment: null, mixin: 0, fee: _this.variablesService.default_fee, hide: false }); + _this.sendForm.reset({ address: null, amount: null, comment: null, mixin: 10, fee: _this.variablesService.default_fee, hide: false }); } }); } From 9d1a58887280864e0c2b1e4116cb26ebc007208b Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 20 May 2020 21:04:41 +0300 Subject: [PATCH 14/14] === build number: 86 -> 87 === --- src/version.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h.in b/src/version.h.in index c72c4910..a6b10969 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -8,6 +8,6 @@ #define PROJECT_REVISION "6" #define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION -#define PROJECT_VERSION_BUILD_NO 86 +#define PROJECT_VERSION_BUILD_NO 87 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"