diff --git a/common/global-version.h b/common/global-version.h index 01c1795df..9b23d46dc 100644 --- a/common/global-version.h +++ b/common/global-version.h @@ -19,6 +19,6 @@ namespace ton { // See doc/GlobalVersions.md -const int SUPPORTED_VERSION = 4; +const int SUPPORTED_VERSION = 5; } diff --git a/crypto/block/block.tlb b/crypto/block/block.tlb index eb1f8b941..4b36f13ba 100644 --- a/crypto/block/block.tlb +++ b/crypto/block/block.tlb @@ -696,11 +696,6 @@ gas_prices_ext#de gas_price:uint64 gas_limit:uint64 special_gas_limit:uint64 gas block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 = GasLimitsPrices; -// same fields as gas_prices_ext; behavior differs -gas_prices_v3#df gas_price:uint64 gas_limit:uint64 special_gas_limit:uint64 gas_credit:uint64 - block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 - = GasLimitsPrices; - gas_flat_pfx#d1 flat_gas_limit:uint64 flat_gas_price:uint64 other:GasLimitsPrices = GasLimitsPrices; diff --git a/crypto/block/mc-config.cpp b/crypto/block/mc-config.cpp index 514021423..0cef7322f 100644 --- a/crypto/block/mc-config.cpp +++ b/crypto/block/mc-config.cpp @@ -654,13 +654,9 @@ td::Result Config::do_get_gas_limits_prices(td::Ref c res.delete_due_limit = r.delete_due_limit; }; block::gen::GasLimitsPrices::Record_gas_prices_ext rec; - block::gen::GasLimitsPrices::Record_gas_prices_v3 rec_v3; vm::CellSlice cs0 = cs; if (tlb::unpack(cs, rec)) { f(rec, rec.special_gas_limit); - } else if (tlb::unpack(cs = cs0, rec_v3)) { - f(rec_v3, rec_v3.special_gas_limit); - res.special_full_limit = true; } else { block::gen::GasLimitsPrices::Record_gas_prices rec0; if (tlb::unpack(cs = cs0, rec0)) { diff --git a/crypto/block/mc-config.h b/crypto/block/mc-config.h index dcc48b4bc..caab93f36 100644 --- a/crypto/block/mc-config.h +++ b/crypto/block/mc-config.h @@ -349,7 +349,6 @@ struct GasLimitsPrices { td::uint64 block_gas_limit{0}; td::uint64 freeze_due_limit{0}; td::uint64 delete_due_limit{0}; - bool special_full_limit{false}; td::RefInt256 compute_gas_price(td::uint64 gas_used) const; }; diff --git a/crypto/block/transaction.cpp b/crypto/block/transaction.cpp index ae50a7100..ec93e11c4 100644 --- a/crypto/block/transaction.cpp +++ b/crypto/block/transaction.cpp @@ -1039,12 +1039,8 @@ bool ComputePhaseConfig::parse_GasLimitsPrices_internal(Ref cs, t delete_due_limit = td::make_refint(r.delete_due_limit); }; block::gen::GasLimitsPrices::Record_gas_prices_ext rec; - block::gen::GasLimitsPrices::Record_gas_prices_v3 rec_v3; if (tlb::csr_unpack(cs, rec)) { f(rec, rec.special_gas_limit); - } else if (tlb::csr_unpack(cs, rec_v3)) { - f(rec_v3, rec_v3.special_gas_limit); - special_gas_full = true; } else { block::gen::GasLimitsPrices::Record_gas_prices rec0; if (tlb::csr_unpack(std::move(cs), rec0)) { @@ -1153,8 +1149,8 @@ namespace transaction { * not enough to clean up old queires, thus locking funds inside. * See comment in crypto/smartcont/highload-wallet-v2-code.fc for details on why this happened. * Account address: EQD_v9j1rlsuHHw2FIhcsCFFSD367ldfDdCKcsNmNpIRzUlu - * It was proposed to validators to increase gas limit for this account for a limited amount of time (until 2024-02-16). - * It is activated by setting gas_prices_v3 in ConfigParam 20 (config_mc_gas_prices). + * It was proposed to validators to increase gas limit for this account for a limited amount of time (until 2024-02-29). + * It is activated by setting global version to 5 in ConfigParam 8. * This config change also activates new behavior for special accounts in masterchain. * * @param cfg The compute phase configuration. @@ -1164,10 +1160,10 @@ namespace transaction { * @returns True if gas_limit override is required, false otherwise */ static bool override_gas_limit(const ComputePhaseConfig& cfg, ton::UnixTime now, const Account& account) { - if (!cfg.mc_gas_prices.special_full_limit) { + if (!cfg.special_gas_full) { return false; } - ton::UnixTime until = 1708041600; // 2024-02-16 00:00:00 UTC + ton::UnixTime until = 1709164800; // 2024-02-29 00:00:00 UTC ton::WorkchainId wc = 0; const char* addr_hex = "FFBFD8F5AE5B2E1C7C3614885CB02145483DFAEE575F0DD08A72C366369211CD"; return now < until && account.workchain == wc && account.addr.to_hex() == addr_hex; @@ -3533,6 +3529,7 @@ td::Status FetchConfigParams::fetch_config_params( TRY_RESULT_PREFIX(mc_gas_prices, config.get_gas_limits_prices(true), "cannot unpack masterchain gas prices and limits: "); compute_phase_cfg->mc_gas_prices = std::move(mc_gas_prices); + compute_phase_cfg->special_gas_full = config.get_global_version() >= 5; storage_phase_cfg->enable_due_payment = config.get_global_version() >= 4; compute_phase_cfg->block_rand_seed = *rand_seed; compute_phase_cfg->max_vm_data_depth = size_limits.max_vm_data_depth; diff --git a/doc/GlobalVersions.md b/doc/GlobalVersions.md index ccfca9406..7d9729f88 100644 --- a/doc/GlobalVersions.md +++ b/doc/GlobalVersions.md @@ -36,4 +36,14 @@ intermediate value before division (e.g. `(xy+w)/z`). * Flag +16 in actions "Send message", "Reserve", "Change library" causes bounce if action fails. ### Storage phase -* Unpaid storage fee is now saved to `due_payment` \ No newline at end of file +* Unpaid storage fee is now saved to `due_payment` + +## Version 5 +Version 5 enables higher gas limits for special contracts. + +* Gas limit for all transactions on special contracts is set to `special_gas_limit` from `ConfigParam 20` (which is 35M at the moment of writing). +Previously only ticktock transactions had this limit, while ordinary transactions could use up to `gas_limit` gas (1M). +* Gas usage of special contracts is not taken into account when checking block limits. This allows keeping masterchain block limits low +while having high gas limits for elector. +* Gas limit on `EQD_v9j1rlsuHHw2FIhcsCFFSD367ldfDdCKcsNmNpIRzUlu` is increased to `special_gas_limit * 2` until 2024-02-29. +See [this post](https://t.me/tonstatus/88) for details. \ No newline at end of file diff --git a/validator/impl/validate-query.cpp b/validator/impl/validate-query.cpp index 94eded6cd..f5dc28e2f 100644 --- a/validator/impl/validate-query.cpp +++ b/validator/impl/validate-query.cpp @@ -945,6 +945,7 @@ bool ValidateQuery::fetch_config_params() { return fatal_error(mc_gas_prices.move_as_error_prefix("cannot unpack masterchain gas prices and limits: ")); } compute_phase_cfg_.mc_gas_prices = mc_gas_prices.move_as_ok(); + compute_phase_cfg_.special_gas_full = config_->get_global_version() >= 5; storage_phase_cfg_.enable_due_payment = config_->get_global_version() >= 4; compute_phase_cfg_.block_rand_seed = rand_seed_; compute_phase_cfg_.libraries = std::make_unique(config_->get_libraries_root(), 256);