Skip to content

Commit 37f10de

Browse files
committed
Change new bounce format: include full or partial original body
1 parent 2736637 commit 37f10de

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

crypto/block/block.tlb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ _ (Message Any) = MessageAny;
166166
_ value:CurrencyCollection created_lt:uint64 created_at:uint32 = NewBounceOriginalInfo;
167167
_ gas_used:uint32 vm_steps:uint32 = NewBounceComputePhaseInfo;
168168
new_bounce_body#fffffffe
169-
original_body:(Maybe ^Cell)
169+
original_body:^Cell
170170
original_info:^NewBounceOriginalInfo
171171
bounced_by_phase:uint8 exit_code:int32
172172
compute_phase:(Maybe NewBounceComputePhaseInfo)

crypto/block/transaction.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ bool Transaction::unpack_input_msg(bool ihr_delivered, const ActionPhaseConfig*
877877
ihr_fee = td::zero_refint();
878878
td::RefInt256 extra_flags = tlb::t_Grams.as_integer(in_msg_info.extra_flags);
879879
new_bounce_format = extra_flags->get_bit(0);
880-
new_bounce_format_with_body = extra_flags->get_bit(1);
880+
new_bounce_format_full_body = extra_flags->get_bit(1);
881881
} else {
882882
// Legacy: extra_flags was previously ihr_fee
883883
ihr_fee = tlb::t_Grams.as_integer(in_msg_info.extra_flags);
@@ -3276,11 +3276,10 @@ bool Transaction::prepare_bounce_phase(const ActionPhaseConfig& cfg) {
32763276
vm::CellBuilder body;
32773277
if (new_bounce_format) {
32783278
body.store_long(0xfffffffeU, 32); // new_bounce_body#fffffffe
3279-
if (new_bounce_format_with_body) { // original_body:(Maybe ^Cell)
3280-
body.store_long(1, 1);
3279+
if (new_bounce_format_full_body) { // original_body:^Cell
32813280
body.store_ref(vm::CellBuilder().append_cellslice(in_msg_body).finalize_novm());
32823281
} else {
3283-
body.store_long(0, 1);
3282+
body.store_ref(vm::CellBuilder().store_bits(in_msg_body->as_bitslice()).finalize_novm());
32843283
}
32853284
body.store_ref(vm::CellBuilder()
32863285
.append_cellslice(in_msg_info.value) // value:CurrencyCollection

crypto/block/transaction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ struct Transaction {
359359
bool in_msg_extern{false};
360360
gen::CommonMsgInfo::Record_int_msg_info in_msg_info;
361361
bool new_bounce_format{false};
362-
bool new_bounce_format_with_body{false};
362+
bool new_bounce_format_full_body{false};
363363
bool use_msg_state{false};
364364
bool is_first{false};
365365
bool orig_addr_rewrite_set{false};

doc/GlobalVersions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,20 +236,20 @@ Field `ihr_fee:Grams` in internal message is now called `extra_flags:(VarUIntege
236236
This field does not represent fees. `ihr_fee` is always zero since version 11, so this field was essentially unused.
237237

238238
`(extra_flags & 1) = 1` enables the new bounce format for the message. The bounced message contains information about the transaction.
239-
If `(extra_flags & 3) = 3`, the bounced message also contains the whole body of the original message.
239+
If `(extra_flags & 3) = 3`, the bounced message contains the whole body of the original message. Otherwise, only the bits from the root of the original body are returned.
240240
When the message with new bounce flag is bounced, the bounced message body has the following format (`new_bounce_body`):
241241
```
242242
_ value:CurrencyCollection created_lt:uint64 created_at:uint32 = NewBounceOriginalInfo;
243243
_ gas_used:uint32 vm_steps:uint32 = NewBounceComputePhaseInfo;
244244
245245
new_bounce_body#fffffffe
246-
original_body:(Maybe ^Cell)
246+
original_body:^Cell
247247
original_info:^NewBounceOriginalInfo
248248
bounced_by_phase:uint8 exit_code:int32
249249
compute_phase:(Maybe NewBounceComputePhaseInfo)
250250
= NewBounceBody;
251251
```
252-
- `original_body` - cell that contains the body of the original message (if `extra_flags & 2`) or nothing (if not `extra_flags & 2`).
252+
- `original_body` - cell that contains the body of the original message. If `extra_flags & 2` then the whole body is returned, otherwise it is only the root without refs.
253253
- `original_info` - value, lt and unixtime of the original message.
254254
- `bounced_by_phase`:
255255
- `0` - compute phase was skipped. `exit_code` denotes the skip reason:

0 commit comments

Comments
 (0)