Skip to content

Commit 54e498a

Browse files
committed
Merge branch 'testnet' into accelerator
2 parents a5e814e + da5644e commit 54e498a

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

crypto/block/transaction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ namespace transaction {
11561156
* It is activated by setting global version to 5 in ConfigParam 8.
11571157
* This config change also activates new behavior for special accounts in masterchain.
11581158
*
1159-
* In Augost 2024 it was decided to unlock other old highload wallets that got into the same situation.
1159+
* In August 2024 it was decided to unlock other old highload wallets that got into the same situation.
11601160
* See https://t.me/tondev_news/129
11611161
* It is activated by setting global version to 9.
11621162
*

crypto/vm/vm.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ int VmState::jump(Ref<Continuation> cont) {
247247

248248
// general jump to continuation cont
249249
int VmState::jump(Ref<Continuation> cont, int pass_args) {
250+
cont = adjust_jump_cont(std::move(cont), pass_args);
251+
return jump_to(std::move(cont));
252+
}
253+
254+
Ref<Continuation> VmState::adjust_jump_cont(Ref<Continuation> cont, int pass_args) {
250255
const ControlData* cont_data = cont->get_cdata();
251256
if (cont_data) {
252257
// first do the checks
@@ -287,7 +292,7 @@ int VmState::jump(Ref<Continuation> cont, int pass_args) {
287292
consume_stack_gas(copy);
288293
}
289294
}
290-
return jump_to(std::move(cont));
295+
return cont;
291296
} else {
292297
// have no continuation data, situation is somewhat simpler
293298
if (pass_args >= 0) {
@@ -299,7 +304,7 @@ int VmState::jump(Ref<Continuation> cont, int pass_args) {
299304
consume_stack_gas(pass_args);
300305
}
301306
}
302-
return jump_to(std::move(cont));
307+
return cont;
303308
}
304309
}
305310

crypto/vm/vm.h

+8
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ class VmState final : public VmStateInterface {
347347
int call(Ref<Continuation> cont, int pass_args, int ret_args = -1);
348348
int jump(Ref<Continuation> cont);
349349
int jump(Ref<Continuation> cont, int pass_args);
350+
Ref<Continuation> adjust_jump_cont(Ref<Continuation> cont, int pass_args);
350351
int ret();
351352
int ret(int ret_args);
352353
int ret_alt();
@@ -374,6 +375,13 @@ class VmState final : public VmStateInterface {
374375
if (cnt > free_nested_cont_jump && global_version >= 9) {
375376
consume_gas(1);
376377
}
378+
if (cont.not_null() && global_version >= 9) {
379+
const ControlData* cont_data = cont->get_cdata();
380+
if (cont_data && (cont_data->stack.not_null() || cont_data->nargs >= 0)) {
381+
// if cont has non-empty stack or expects fixed number of arguments, jump is not simple
382+
cont = adjust_jump_cont(std::move(cont), -1);
383+
}
384+
}
377385
}
378386
return res;
379387
}

doc/GlobalVersions.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,5 @@ Example: if the last masterchain block seqno is `19071` then the list contains b
133133
- Fix exception code in some TVM instructions: now `stk_und` has priority over other error codes.
134134
- `PFXDICTADD`, `PFXDICTSET`, `PFXDICTREPLACE`, `PFXDICTDEL`, `GETGASFEE`, `GETSTORAGEFEE`, `GETFORWARDFEE`, `GETORIGINALFWDFEE`, `GETGASFEESIMPLE`, `GETFORWARDFEESIMPLE`, `HASHEXT`
135135
- Now setting the contract code to a library cell does not consume additional gas on execution of the code.
136-
- Temporary increase gas limit for some accounts (see [this post](https://t.me/tondev_news/129) for details, `override_gas_limit` in `transaction.cpp` for the list of accounts).
136+
- Temporary increase gas limit for some accounts (see [this post](https://t.me/tondev_news/129) for details, `override_gas_limit` in `transaction.cpp` for the list of accounts).
137+
- Fix recursive jump to continuations with non-null control data.

0 commit comments

Comments
 (0)