Release/node/v0.6.0#123
Conversation
Compatibility fixes for transaction executor
Merge v0.5.x hot fixes
There was a problem hiding this comment.
Pull request overview
Release node/v0.6.0 updates validator/test-bundle generation, tightens TL‑B deserialization/canonical encoding checks, and refreshes executor/emulator tests + fixtures to match updated fee/gas/action semantics.
Changes:
- Add
build_alloption and refactor collator test-bundle building into a shared spawn helper. - Introduce/expand
Deserializable::skippaths and enforce canonical VarUInteger encodings (e.g., reject leading-zero byte forms). - Rework transaction executor action preprocessing/parsing and update a large set of real-data
.bocfixtures + unit tests.
Reviewed changes
Copilot reviewed 20 out of 81 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/node/src/validator/fabric.rs | Adds optional “build all” test-bundle generation and refactors bundle build/spawn logic. |
| src/node/src/validator/collator.rs | Adjusts collator logging verbosity and finalization debug output. |
| src/node/src/config.rs | Extends CollatorTestBundlesConfig with build_all and updates enablement logic. |
| src/executor/src/transaction_executor.rs | Reworks out-action preprocessing using OutAction::skip, adjusts error handling/logging, and tweaks fee/fine/library handling. |
| src/executor/src/tests/test_transaction_executor_with_real_data.rs | Switches to unified config fixture and adds new real-data regression tests. |
| src/executor/src/tests/test_tr_phases.rs | Updates gas expectation values. |
| src/executor/src/tests/test_tick_tock_transaction.rs | Updates expected gas limit in tick-tock test. |
| src/executor/src/tests/test_random_gen.rs | Updates special-account ID used in random-gen tests. |
| src/executor/src/tests/test_ordinary_libs_and_code.rs | Adds checks for private/public library handling and updates imports/comments. |
| src/executor/src/tests/test_currency_collections.rs | Updates expected fees/balances to match revised executor behavior. |
| src/executor/src/tests/test_bounced_action_phase.rs | Updates expected bounce fees/values to match revised executor behavior. |
| src/executor/src/tests/common/mod.rs | Uses unified config fixture and reorders transaction comparison assertions. |
| src/executor/real_boc/wrong_skip_reason_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/wrong_compute_phase_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/wrong_compute_phase_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/wrong_coins_serial_in_actions_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/wrong_coins_serial_in_actions_account_old.boc | Adds new real-data fixture. |
| src/executor/real_boc/wrong_coins_serial_in_actions_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/uninit_account_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/two_messages_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/two_messages_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/tick_tock_tx.boc | Adds new real-data fixture. |
| src/executor/real_boc/state_init_cell_same_in_body_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/simple_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/simple_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/send_remainig_msg_balance_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/send_remainig_msg_balance_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/repack_msg_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/rawreserve_flag16_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/rawreserve_flag16_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/raw_reserve_with_flag4_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/out_of_gas_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/out_of_gas_on_commit_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/out_of_gas_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/not_abort_accept_account_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/not_abort_accept_account_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/nofunds_without_error_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/nofunds_without_error_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/no_balance_to_send_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/msg_cell_fine_calc_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/msg_cell_fine_calc_account_old.boc | Adds new real-data fixture. |
| src/executor/real_boc/msg_cell_fine_calc_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/msg_body_ref_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/msg_body_ref_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/int_message_to_elector_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/int_message_to_elector2_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/init_wo_state_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/init_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/fwd_fee_payment_in_smc_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/due_payment_in_smc_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/depool_balance_check_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/deploy_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/deploy_fixed_prefix_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/deploy_fixed_prefix_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/deploy_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/count_steps_tx.boc | Adds new real-data fixture. |
| src/executor/real_boc/count_steps_acc_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/bounce_to_low_balance_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/bounce_to_low_balance_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/bounce_to_empty_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/bounce_to_empty_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/bounce_msg_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/bounce_message_to_new_account_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/bounce_message_to_new_account_account_new.boc | Adds new real-data fixture. |
| src/executor/real_boc/body_with_pruned_cell_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/bad_action_with_ignore_flag_transaction.boc | Adds new real-data fixture. |
| src/executor/real_boc/bad_action_transaction.boc | Adds new real-data fixture. |
| src/emulator/src/tests/test_emulator.rs | Makes emulator test parameters data-driven from JSON (time/lt/rand_seed). |
| src/block/src/types.rs | Adds skip implementations and enforces canonical VarUInteger decoding (leading-zero rejection). |
| src/block/src/tests/test_out_actions.rs | Adds a unit test for non-canonical coins inside SendMsg OutAction. |
| src/block/src/out_actions.rs | Improves error wrapping for ChangeLibrary and adds OutAction::skip. |
| src/block/src/messages.rs | Adds skip implementations for message/address/header parsing. |
| src/block/src/lib.rs | Adds Option<T>::skip implementation. |
| src/block/src/cell/slice.rs | Improves underflow error messages for bit/reference reads/drains. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let mode = mode >> 1; | ||
| let code = change_library_action_handler(limits, &mut acc_copy, mode, code, hash).unwrap_or_else(|err| { | ||
| log::debug!(target: "executor", "change_library_action_handler failed: {}", err); | ||
| RESULT_CODE_LIB_BAD_ACCOUNT_STATE | ||
| }); | ||
| let code = | ||
| change_library_action_handler(limits, &mut acc_copy, mode, code, hash) | ||
| .unwrap_or_else(|err| { | ||
| log::debug!( | ||
| target: "executor", | ||
| "change_library_action_handler failed: {err}" | ||
| ); | ||
| RESULT_CODE_LIB_BAD_ACCOUNT_STATE | ||
| }); | ||
| if code == 0 { | ||
| phase.spec_actions += 1; | ||
| } else if mode.bit(CHANGE_SET_LIB_BOUNCE_IF_FAIL) { | ||
| bounce = true; | ||
| } |
There was a problem hiding this comment.
In ChangeLibrary handling, mode is shifted right (let mode = mode >> 1) before checking CHANGE_SET_LIB_BOUNCE_IF_FAIL. Since CHANGE_SET_LIB_BOUNCE_IF_FAIL is defined for the unshifted mode byte (bit 0x10), this check will never fire for bounced-on-fail actions. Consider either checking the bounce flag on the original mode before shifting, or shifting the constant/using a separate shifted_mode for library visibility flags only.
| Ok(OutAction::None) => RESULT_CODE_UNKNOWN_OR_INVALID_ACTION, | ||
| Err(err) => { | ||
| let msg = match err.downcast_ref() { | ||
| Some(BlockError::OutActionError(err, _)) => err.to_string(), | ||
| _ => err.to_string(), | ||
| }; | ||
| log::debug!( | ||
| target: "executor", | ||
| "cannot parse outbound message in action {i}: format is invalid, err: {msg}" | ||
| ); | ||
| RESULT_CODE_UNSUPPORTED | ||
| } |
There was a problem hiding this comment.
OutAction::skip is used for preprocessing, but some errors (e.g. message parsing errors discovered only during OutAction::construct_from, like non-canonical coin encodings) will bypass this stage. In the Err(err) arm of OutAction::construct_from, the code currently maps everything to RESULT_CODE_UNSUPPORTED and ignores possible BlockError::OutActionError(_, mode), so SENDMSG_IGNORE_ERROR / SENDMSG_BOUNCE_IF_FAIL flags may not be applied consistently. Consider downcasting here as well and honoring the mode bits (skip/bounce) similarly to the preprocessing loop.
| let bits = 8 - ($N as u8).leading_zeros(); | ||
| let bytes = slice.get_next_int(bits as usize)? as usize; | ||
| let max = std::mem::size_of::<$tt>(); | ||
| let mut buffer = [0; std::mem::size_of::<$tt>()]; | ||
| slice.get_next_bytes_to_slice(&mut buffer[max - bytes..])?; | ||
| if bytes > 0 { | ||
| let first = slice.get_next_byte()?; | ||
| if first == 0 { | ||
| fail!("non-canonical {} encoding: leading zero byte", stringify!($varname)) | ||
| } | ||
| buffer[max - bytes] = first; | ||
| if bytes > 1 { | ||
| slice.get_next_bytes_to_slice(&mut buffer[max - bytes + 1..])?; | ||
| } | ||
| } |
There was a problem hiding this comment.
bytes read from the slice is not validated against $N (the TL-B VarUInteger max) nor against size_of::<$tt>(). If a malformed cell encodes bytes > size_of::<$tt>(), indexing buffer[max - bytes] (and the subsequent slice range) will panic, causing a potential DoS. Add an explicit bounds check (e.g., fail if bytes > $N or bytes > max) before writing into buffer.
| // 6. Set block parameters | ||
| transaction_emulator_set_unixtime(p, 1770822950); | ||
| transaction_emulator_set_lt(p, 66815326000001); | ||
| let unixtime = json["now"].as_u64().unwrap(); |
There was a problem hiding this comment.
unixtime is read as u64 and then cast with as u32, which will silently truncate if the JSON contains a value > u32::MAX. Since this test is now data-driven, it’d be safer to validate the range (e.g. try_into() / assert) before calling transaction_emulator_set_unixtime.
| let unixtime = json["now"].as_u64().unwrap(); | |
| let unixtime = json["now"].as_u64().unwrap(); | |
| assert!( | |
| unixtime <= u32::MAX as u64, | |
| "JSON field `now` is out of range for u32: {}", | |
| unixtime | |
| ); |
TVM compatibility fixes. Cells operations optimization
Collator stability and performance updates
Simplex consensus performance update
Hashicorp support in secrets vault
Cell DB performance optimization
Added
Changed
Fixed