mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
create complaints for master vals only for masterchain blocks (#1231)
This commit is contained in:
parent
1bef6df455
commit
921aa29eb5
1 changed files with 5 additions and 4 deletions
|
@ -3657,7 +3657,7 @@ void TestNode::continue_check_validator_load3(std::unique_ptr<TestNode::Validato
|
||||||
std::unique_ptr<TestNode::ValidatorLoadInfo> info2, int mode,
|
std::unique_ptr<TestNode::ValidatorLoadInfo> info2, int mode,
|
||||||
std::string file_pfx) {
|
std::string file_pfx) {
|
||||||
LOG(INFO) << "continue_check_validator_load3 for blocks " << info1->blk_id.to_str() << " and "
|
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";
|
<< "`: comparing block creators data";
|
||||||
if (info1->created_total.first <= 0 || info2->created_total.first <= 0) {
|
if (info1->created_total.first <= 0 || info2->created_total.first <= 0) {
|
||||||
LOG(ERROR) << "no total created blocks statistics";
|
LOG(ERROR) << "no total created blocks statistics";
|
||||||
|
@ -3718,13 +3718,14 @@ void TestNode::continue_check_validator_load3(std::unique_ptr<TestNode::Validato
|
||||||
block::MtCarloComputeShare shard_share(shard_count, info2->vset->export_scaled_validator_weights());
|
block::MtCarloComputeShare shard_share(shard_count, info2->vset->export_scaled_validator_weights());
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int x1 = d[i].first, y1 = d[i].second;
|
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;
|
double ye = shard_share[i] * (double)ys / shard_count;
|
||||||
td::Bits256 pk = info2->vset->list[i].pubkey.as_bits256();
|
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);
|
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
|
td::TerminalIO::out() << "val #" << i << ": pubkey " << pk.to_hex() << ", blocks created (" << x1 << "," << y1
|
||||||
<< "), expected (" << xe << "," << ye << "), probabilities " << p1 << " and " << p2 << "\n";
|
<< "), 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()
|
LOG(ERROR) << "validator #" << i << " with pubkey " << pk.to_hex()
|
||||||
<< " : serious misbehavior detected: created less than 90% of the expected amount of blocks with "
|
<< " : serious misbehavior detected: created less than 90% of the expected amount of blocks with "
|
||||||
"probability 99.999% : created ("
|
"probability 99.999% : created ("
|
||||||
|
@ -3737,7 +3738,7 @@ void TestNode::continue_check_validator_load3(std::unique_ptr<TestNode::Validato
|
||||||
cnt_ok++;
|
cnt_ok++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (std::min(p1, p2) < .005) {
|
} else if ((is_masterchain_validator ? p1 : p2) < .005) {
|
||||||
LOG(ERROR) << "validator #" << i << " with pubkey " << pk.to_hex()
|
LOG(ERROR) << "validator #" << i << " with pubkey " << pk.to_hex()
|
||||||
<< " : moderate misbehavior detected: created less than 90% of the expected amount of blocks with "
|
<< " : moderate misbehavior detected: created less than 90% of the expected amount of blocks with "
|
||||||
"probability 99.5% : created ("
|
"probability 99.5% : created ("
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue