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

Do not count gas on special accounts in block gas limits (enabled by config) (#856)

* Set higher gas limit for special accounts, don't add gas from special accounts to block total

* Make removing special accounts from block gas limits enabled by config

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2024-01-12 12:34:28 +03:00 committed by GitHub
parent 3a5f3fcadd
commit ff40c1f2a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 21 deletions

View file

@ -2667,7 +2667,8 @@ bool Collator::create_ticktock_transaction(const ton::StdSmcAddress& smc_addr, t
return fatal_error(td::Status::Error(
-666, std::string{"cannot serialize new transaction for smart contract "} + smc_addr.to_hex()));
}
if (!trans->update_limits(*block_limit_status_)) {
if (!trans->update_limits(*block_limit_status_,
/* with_gas = */ !(acc->is_special && compute_phase_cfg_.special_gas_full))) {
return fatal_error(-666, "cannot update block limit status to include the new transaction");
}
if (trans->commit(*acc).is_null()) {
@ -2744,7 +2745,8 @@ Ref<vm::Cell> Collator::create_ordinary_transaction(Ref<vm::Cell> msg_root) {
}
std::unique_ptr<block::transaction::Transaction> trans = res.move_as_ok();
if (!trans->update_limits(*block_limit_status_)) {
if (!trans->update_limits(*block_limit_status_,
/* with_gas = */ !(acc->is_special && compute_phase_cfg_.special_gas_full))) {
fatal_error("cannot update block limit status to include the new transaction");
return {};
}