From 921aa29eb54db42de21e0f89610c347670988ed1 Mon Sep 17 00:00:00 2001 From: Maksim Kurbatov <94808996+yungwine@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:42:06 +0400 Subject: [PATCH] create complaints for master vals only for masterchain blocks (#1231) --- lite-client/lite-client.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lite-client/lite-client.cpp b/lite-client/lite-client.cpp index da2fd6ff9..64383730b 100644 --- a/lite-client/lite-client.cpp +++ b/lite-client/lite-client.cpp @@ -3657,7 +3657,7 @@ void TestNode::continue_check_validator_load3(std::unique_ptr info2, int mode, std::string file_pfx) { LOG(INFO) << "continue_check_validator_load3 for blocks " << info1->blk_id.to_str() << " and " - << info1->blk_id.to_str() << " with mode=" << mode << " and file prefix `" << file_pfx + << info2->blk_id.to_str() << " with mode=" << mode << " and file prefix `" << file_pfx << "`: comparing block creators data"; if (info1->created_total.first <= 0 || info2->created_total.first <= 0) { LOG(ERROR) << "no total created blocks statistics"; @@ -3718,13 +3718,14 @@ void TestNode::continue_check_validator_load3(std::unique_ptrvset->export_scaled_validator_weights()); for (int i = 0; i < count; i++) { int x1 = d[i].first, y1 = d[i].second; - double xe = (i < main_count ? (double)xs / main_count : 0); + bool is_masterchain_validator = i < main_count; + double xe = (is_masterchain_validator ? (double)xs / main_count : 0); double ye = shard_share[i] * (double)ys / shard_count; td::Bits256 pk = info2->vset->list[i].pubkey.as_bits256(); double p1 = create_prob(x1, .9 * xe), p2 = shard_create_prob(y1, .9 * ye, chunk_size); td::TerminalIO::out() << "val #" << i << ": pubkey " << pk.to_hex() << ", blocks created (" << x1 << "," << y1 << "), expected (" << xe << "," << ye << "), probabilities " << p1 << " and " << p2 << "\n"; - if (std::min(p1, p2) < .00001) { + if ((is_masterchain_validator ? p1 : p2) < .00001) { LOG(ERROR) << "validator #" << i << " with pubkey " << pk.to_hex() << " : serious misbehavior detected: created less than 90% of the expected amount of blocks with " "probability 99.999% : created (" @@ -3737,7 +3738,7 @@ void TestNode::continue_check_validator_load3(std::unique_ptr