From 555270c1a36e5b6dec4baa1225deed4543710c28 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Mon, 27 Nov 2023 15:53:56 +0100 Subject: [PATCH] profiling of block processing + lates UI --- src/currency_core/blockchain_storage.cpp | 17 ++++++++++++++++- src/currency_core/blockchain_storage.h | 5 +++++ src/gui/qt-daemon/layout | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 9ccee98b..cc66cf69 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -6135,6 +6135,8 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt size_t tx_processed_count = 0; + size_t tx_total_inputs_count = 0; + uint64_t tx_total_inputs_processing_time = 0; uint64_t fee_summary = 0; uint64_t burned_coins = 0; std::list block_summary_kimages; @@ -6211,6 +6213,8 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt return false; } TIME_MEASURE_FINISH_PD(tx_check_inputs_time); + tx_total_inputs_processing_time += tx_check_inputs_time; + tx_total_inputs_count++; burned_coins += get_burned_amount(tx); TIME_MEASURE_START_PD(tx_prapare_append); @@ -6261,6 +6265,7 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt if (!m_is_in_checkpoint_zone) { + TIME_MEASURE_START_PD(validate_miner_transaction_time); if (!validate_miner_transaction(bl, cumulative_block_size, fee_summary, base_reward, already_generated_coins)) // TODO @#@# base_reward will be calculated once again, consider refactoring { LOG_PRINT_L0("Block with id: " << id @@ -6269,7 +6274,9 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt bvc.m_verification_failed = true; return false; } + TIME_MEASURE_FINISH_PD(validate_miner_transaction_time); + TIME_MEASURE_START_PD(collect_rangeproofs_data_from_tx_time); if (!collect_rangeproofs_data_from_tx(bl.miner_tx, get_transaction_hash(bl.miner_tx), range_proofs_agregated)) { LOG_PRINT_L0("Block with id: " << id @@ -6278,8 +6285,10 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt bvc.m_verification_failed = true; return false; } + TIME_MEASURE_FINISH_PD(collect_rangeproofs_data_from_tx_time); //validate range proofs + TIME_MEASURE_START_PD(verify_multiple_zc_outs_range_proofs_time); if (!verify_multiple_zc_outs_range_proofs(range_proofs_agregated)) { LOG_PRINT_L0("Block with id: " << id @@ -6288,6 +6297,7 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt bvc.m_verification_failed = true; return false; } + TIME_MEASURE_FINISH_PD(verify_multiple_zc_outs_range_proofs_time); } @@ -6441,7 +6451,12 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt << "/" << longhash_calculating_time_3 << "/" << insert_time_4 << "/" << all_txs_insert_time_5 - << "/" << etc_stuff_6 + << "/" << etc_stuff_6 + << "/" << tx_total_inputs_processing_time << " of " << tx_total_inputs_count + << "/(" << m_performance_data.validate_miner_transaction_time.get_last_val() << "|" + << m_performance_data.collect_rangeproofs_data_from_tx_time.get_last_val() << "|" + << m_performance_data.verify_multiple_zc_outs_range_proofs_time.get_last_val() + << ")" << "))"); on_block_added(bei, id, block_summary_kimages); diff --git a/src/currency_core/blockchain_storage.h b/src/currency_core/blockchain_storage.h index 118d59b8..124c61a0 100644 --- a/src/currency_core/blockchain_storage.h +++ b/src/currency_core/blockchain_storage.h @@ -68,6 +68,11 @@ namespace currency epee::math_helper::average etc_stuff_6; epee::math_helper::average insert_time_4; epee::math_helper::average raise_block_core_event; + epee::math_helper::average validate_miner_transaction_time; + epee::math_helper::average collect_rangeproofs_data_from_tx_time; + epee::math_helper::average verify_multiple_zc_outs_range_proofs_time; + + //target_calculating_time_2 epee::math_helper::average target_calculating_enum_blocks; epee::math_helper::average target_calculating_calc; diff --git a/src/gui/qt-daemon/layout b/src/gui/qt-daemon/layout index 5a8320e5..c5687a8f 160000 --- a/src/gui/qt-daemon/layout +++ b/src/gui/qt-daemon/layout @@ -1 +1 @@ -Subproject commit 5a8320e580f5510e64e967a8a4f7fb2cbc76194a +Subproject commit c5687a8f1a7195f11e707c465419ee9b8d6ebd92