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

updated tonlib, fixed bugs

updated tonlib
fixed bugs in func
validator: partial support for hardforks
liteserver: support for waitMasterchainBlock prefix
transactions: support for gas flat rate
This commit is contained in:
ton 2019-10-03 17:04:52 +04:00
parent 841d5ebac2
commit 7ea00ebfcf
89 changed files with 1922 additions and 608 deletions

View file

@ -734,26 +734,10 @@ bool ValidateQuery::fetch_config_params() {
if (cell.is_null()) {
return fatal_error("cannot fetch current gas prices and limits from masterchain configuration");
}
auto f = [self = this](const auto& r, td::uint64 spec_limit) {
self->compute_phase_cfg_.gas_limit = r.gas_limit;
self->compute_phase_cfg_.special_gas_limit = spec_limit;
self->compute_phase_cfg_.gas_credit = r.gas_credit;
self->compute_phase_cfg_.gas_price = r.gas_price;
self->storage_phase_cfg_.freeze_due_limit = td::RefInt256{true, r.freeze_due_limit};
self->storage_phase_cfg_.delete_due_limit = td::RefInt256{true, r.delete_due_limit};
};
block::gen::GasLimitsPrices::Record_gas_prices_ext rec;
if (tlb::unpack_cell(cell, rec)) {
f(rec, rec.special_gas_limit);
} else {
block::gen::GasLimitsPrices::Record_gas_prices rec0;
if (tlb::unpack_cell(std::move(cell), rec0)) {
f(rec0, rec0.gas_limit);
} else {
return fatal_error("cannot unpack current gas prices and limits from masterchain configuration");
}
if (!compute_phase_cfg_.parse_GasLimitsPrices(std::move(cell), storage_phase_cfg_.freeze_due_limit,
storage_phase_cfg_.delete_due_limit)) {
return fatal_error("cannot unpack current gas prices and limits from masterchain configuration");
}
compute_phase_cfg_.compute_threshold();
compute_phase_cfg_.block_rand_seed = rand_seed_;
compute_phase_cfg_.libraries = std::make_unique<vm::Dictionary>(config_->get_libraries_root(), 256);
compute_phase_cfg_.global_config = config_->get_root_cell();
@ -5227,7 +5211,7 @@ bool ValidateQuery::check_block_create_stats() {
auto key = td::Bits256::zero();
auto old_val = ps_.block_create_stats_->lookup(key);
auto new_val = ns_.block_create_stats_->lookup(key);
if (new_val.is_null()) {
if (new_val.is_null() && (!created_by_.is_zero() || block_create_total_)) {
return reject_query(
"new masterchain state does not contain a BlockCreator entry with zero key with total statistics");
}