1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Account for unprocessed messages in estimate_block_size; check consensus_config limits in collator (#692)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2023-05-04 14:45:42 +03:00 committed by GitHub
parent a78adf3062
commit 1696ebfa20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View file

@ -715,7 +715,7 @@ td::uint64 BlockLimitStatus::estimate_block_size(const vm::NewCellStorageStat::S
sum += *extra;
}
return 2000 + (sum.bits >> 3) + sum.cells * 12 + sum.internal_refs * 3 + sum.external_refs * 40 + accounts * 200 +
transactions * 200 + (extra ? 200 : 0);
transactions * 200 + (extra ? 200 : 0) + extra_out_msgs * 300;
}
int BlockLimitStatus::classify() const {

View file

@ -261,7 +261,7 @@ struct BlockLimitStatus {
ton::LogicalTime cur_lt;
td::uint64 gas_used{};
vm::NewCellStorageStat st_stat;
unsigned accounts{}, transactions{};
unsigned accounts{}, transactions{}, extra_out_msgs{};
BlockLimitStatus(const BlockLimits& limits_, ton::LogicalTime lt = 0)
: limits(limits_), cur_lt(std::max(limits_.start_lt, lt)) {
}
@ -270,6 +270,7 @@ struct BlockLimitStatus {
st_stat.set_zero();
transactions = accounts = 0;
gas_used = 0;
extra_out_msgs = 0;
}
td::uint64 estimate_block_size(const vm::NewCellStorageStat::Stat* extra = nullptr) const;
int classify() const;