From e8e6c83fa8a56cd7bc76a79207d8850c53743f2a Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Fri, 10 May 2019 21:48:29 +0200 Subject: [PATCH 1/4] attempt to fix broken PoS relay --- src/currency_protocol/currency_protocol_handler.inl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/currency_protocol/currency_protocol_handler.inl b/src/currency_protocol/currency_protocol_handler.inl index b281e5c3..60c4bcf3 100644 --- a/src/currency_protocol/currency_protocol_handler.inl +++ b/src/currency_protocol/currency_protocol_handler.inl @@ -258,6 +258,11 @@ namespace currency } //pre-validate block here, and propagate it to network asap to avoid latency of handling big block (tx flood) + //######################################################## + /* + problem with prevalidation: in case of pre_validate_block() is passed but handle_incoming_tx() is failed + network got spammed with notifications about this broken block and then connections got closed. + temporary disabled to more investigation bool prevalidate_relayed = false; if (m_core.pre_validate_block(b, bvc, block_id) && bvc.m_added_to_main_chain) { @@ -266,6 +271,8 @@ namespace currency relay_block(arg, context); prevalidate_relayed = true; } + */ + //######################################################## //now actually process block for(auto tx_blob_it = arg.b.txs.begin(); tx_blob_it!=arg.b.txs.end();tx_blob_it++) @@ -297,7 +304,7 @@ namespace currency if (bvc.m_added_to_main_chain || (bvc.added_to_altchain && bvc.height_difference < 2)) { - if (!prevalidate_relayed) + if (true/*!prevalidate_relayed*/) { // pre-validation failed prevoiusly, but complete check was success, not an alternative block ++arg.hop; From 22ba650e4f044540bce0877433fd5d5ffbcff0a9 Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Fri, 10 May 2019 21:55:55 +0200 Subject: [PATCH 2/4] prevalidate_relayed removed from log --- src/currency_protocol/currency_protocol_handler.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/currency_protocol/currency_protocol_handler.inl b/src/currency_protocol/currency_protocol_handler.inl index 60c4bcf3..e4eebf74 100644 --- a/src/currency_protocol/currency_protocol_handler.inl +++ b/src/currency_protocol/currency_protocol_handler.inl @@ -298,7 +298,7 @@ namespace currency } LOG_PRINT_GREEN("[HANDLE]NOTIFY_NEW_BLOCK EXTRA: id: " << block_id << ",bvc.m_added_to_main_chain " << bvc.m_added_to_main_chain - << ",prevalidate_result " << prevalidate_relayed + //<< ",prevalidate_result " << prevalidate_relayed << ",bvc.added_to_altchain " << bvc.added_to_altchain << ",bvc.m_marked_as_orphaned " << bvc.m_marked_as_orphaned, LOG_LEVEL_2); From eebda00e2791cb286b36dcfce1b35630c4571946 Mon Sep 17 00:00:00 2001 From: sowle Date: Sat, 11 May 2019 00:28:58 +0300 Subject: [PATCH 3/4] === build number: 28 -> 29 === --- 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 8522d942..e523598c 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -2,6 +2,6 @@ #define BUILD_COMMIT_ID "@VERSION@" #define PROJECT_VERSION "1.0" -#define PROJECT_VERSION_BUILD_NO 28 +#define PROJECT_VERSION_BUILD_NO 29 #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 cbfa1612b7eb9ad7088e9778006283197880d7d8 Mon Sep 17 00:00:00 2001 From: "cr.zoidberg" Date: Tue, 14 May 2019 04:25:14 +0200 Subject: [PATCH 4/4] removed unused code --- src/currency_core/blockchain_storage.cpp | 25 ------------------------ 1 file changed, 25 deletions(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 3db594ca..f88d60c6 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -2213,31 +2213,6 @@ bool blockchain_storage::is_multisig_output_spent(const crypto::hash& multisig_i return source_tx_ptr->m_spent_flags[ms_out_index]; } //------------------------------------------------------------------ -// bool blockchain_storage::resync_spent_tx_flags() -// { -// LOG_PRINT_L0("Started re-building spent tx outputs data..."); -// CRITICAL_REGION_LOCAL(m_blockchain_lock); -// for(auto& tx: m_db_transactions) -// { -// if(is_coinbase(tx.second.tx)) -// continue; -// -// for(auto& in: tx.second.tx.vin) -// { -// CHECKED_GET_SPECIFIC_VARIANT(in, txin_to_key, in_to_key, false); -// if(in_to_key.key_offsets.size() != 1) -// continue; -// -// //direct spending -// if(!update_spent_tx_flags_for_input(in_to_key.amount, in_to_key.key_offsets[0], true)) -// return false; -// -// } -// } -// LOG_PRINT_L0("Finished re-building spent tx outputs data"); -// return true; -// } -//------------------------------------------------------------------ bool blockchain_storage::find_blockchain_supplement(const std::list& qblock_ids, uint64_t& starter_offset)const { CRITICAL_REGION_LOCAL(m_read_lock);