1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 11:12:16 +00:00

Improve gas consumption in VmState::jump_to (#1276)

This commit is contained in:
SpyCheese 2024-10-15 17:43:46 +03:00 committed by GitHub
parent 3e806bf46e
commit 5920f800de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -373,11 +373,11 @@ class VmState final : public VmStateInterface {
int jump_to(Ref<Continuation> cont) {
int res = 0, cnt = 0;
while (cont.not_null()) {
cnt++;
cont = cont->is_unique() ? cont.unique_write().jump_w(this, res) : cont->jump(this, res);
}
if (global_version >= 9 && cnt > free_nested_cont_jump) {
consume_gas(cnt - free_nested_cont_jump);
cnt++;
if (cnt > free_nested_cont_jump && global_version >= 9) {
consume_gas(1);
}
}
return res;
}