Release/node/v0.6.1#135
Merged
Merged
Conversation
ADNL key management for fast sync overlay
TVM compatibility fixes
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bumps the node release to v0.6.1 and bundles several compatibility fixes and operational improvements across the TVM/executor, networking/validator fast-sync behavior, RPC surface area, and the secrets-vault CLI tooling.
Changes:
- Add a new
secrets-vault-cli copycommand plus documentation/runbook to migrate node secrets from file storage to HashiCorp Vault. - Fix multiple TVM/executor compatibility issues: short-opcode gas handling, SENDMSG storage gas accounting, action-phase
result_argbehavior, and storage fee rounding. - Improve fast-sync overlay behavior and diagnostics (peer resolution via DHT, additional logs), and add an RPC endpoint to export libraries as a BoC dictionary for emulator use.
Reviewed changes
Copilot reviewed 46 out of 61 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vm/tests/test_cont.rs | Adds test coverage for invalid-opcode gas charging for short codes. |
| src/vm/tests/test_app_specific.rs | Adds regression test for SENDMSG gas accounting when body layout transitions inline↔ref. |
| src/vm/tests/common/test_framework.rs | Adds helper to generate short-code gas fix data from C++ TVM. |
| src/vm/src/tests/test_smart_contract_info.rs | Adds test ensuring latest storage price selection by utime_since. |
| src/vm/src/smart_contract_info.rs | Fixes unpacked config tuple to pick the latest applicable storage price. |
| src/vm/src/executor/engine/mod.rs | Wires in the new short-opcode gas fix module. |
| src/vm/src/executor/engine/fix_gas.rs | Introduces FIX_GAS table and short-code detection logic. |
| src/vm/src/executor/engine/core.rs | Applies short-opcode gas correction and adjusts step/gas behavior on handler errors. |
| src/vm/src/executor/config.rs | Changes storage fee calculation to round after applying calc_storage_fee_part. |
| src/vm/src/executor/blockchain.rs | Fixes SENDMSG storage gas charging based on parsed inline/ref flags. |
| src/secrets-vault/cli/README.md | Documents new copy command usage and options. |
| src/secrets-vault/cli/main.rs | Adds copy subcommand and argument parsing. |
| src/secrets-vault/cli/copy.rs | Implements vault-to-vault copy logic with conflict modes, dry-run, and redaction. |
| src/secrets-vault/cli/COPY_FILE_TO_HASHICORP.md | Adds operational runbook for migrating a running node to HashiCorp Vault. |
| src/node/src/validator/fabric.rs | Refactors test-bundle building hooks and captures additional bundle context on validation errors. |
| src/node/src/validator/collator.rs | Propagates accepted external messages into error bundles and refactors rejection handling. |
| src/node/src/rpc_server/tests/test_handlers.rs | Adds test for new getLibrariesExt RPC and validates returned dictionary BoC. |
| src/node/src/rpc_server/static/openapi.json | Adds OpenAPI entry for /getLibrariesExt. |
| src/node/src/rpc_server/handlers.rs | Adds getLibrariesExt, serializes libraries dictionary for emulator, and adds created_by to block header response. |
| src/node/src/network/overlay_client.rs | Increases logging level/verbosity around ADNL/RLDP request lifecycle. |
| src/node/src/network/node_network.rs | Adds reusable overlay peer resolver task (DHT resolve + ADNL registration). |
| src/node/src/network/full_node_overlays.rs | Adds special fast-sync overlay setup for prev-set validators and integrates peer resolver lifecycle. |
| src/node/src/network/full_node_overlay_client.rs | Adds debug logs around RLDP downloads and error/success outcomes. |
| src/node/src/network/custom_overlay_client.rs | Reuses shared peer resolver instead of bespoke implementation. |
| src/node/src/network/control.rs | Updates collator bundle creation call signature to include external messages. |
| src/node/src/full_node/shard_client.rs | Raises shard client progress logging from trace to debug. |
| src/node/src/engine.rs | Invokes special_update_fastsync_overlays() during startup. |
| src/node/src/collator_test_bundle.rs | Extends test bundles to include accounts from accepted external messages and adjusts state simplification logic. |
| src/node/simplex/src/tests/test_session_processor.rs | Adds regression test for shard collation timing parity with C++ early dispatch. |
| src/node/simplex/src/session_processor.rs | Introduces CollationTiming (dispatch vs min-gen time) and updates scheduling logic. |
| src/node/Cargo.toml | Bumps node crate version to 0.6.1. |
| src/executor/src/transaction_executor.rs | Improves action list parsing errors (with position), sets result_arg consistently, and resets on success. |
| src/executor/src/tests/test_transaction_executor_with_real_data.rs | Updates fixtures, adds new replay tests for storage price/fee rounding and SENDMSG root-gas behavior. |
| src/executor/src/tests/test_tr_phases.rs | Adds tests for invalid action list root and too-many-actions cases. |
| src/executor/src/tests/test_ordinary_transaction.rs | Adds tests for result_arg behavior (first vs second failing action) and asserts arg reset in some paths. |
| src/executor/src/tests/common/mod.rs | Allows libs input as base64 (fallback) in replay helpers. |
| src/executor/src/blockchain_config.rs | Changes storage fee accumulation to round after summing intervals; adds regression test. |
| src/Cargo.lock | Updates node package version to 0.6.1. |
| src/block/src/transactions.rs | Adjusts TrActionPhase serialization to encode result_arg=0 as None (CPP parity). |
| src/block/src/tests/test_out_actions.rs | Updates tests for new action list unpacking API and adds special-cell root test. |
| src/block/src/tests/test_config_params.rs | Updates storage fee max test to match new calc_storage_fee_part semantics. |
| src/block/src/out_actions.rs | Reworks action list unpacking to accept Cell, reject special roots, and return error position. |
| src/block/src/messages.rs | Exposes parsed body_to_ref / init_to_ref flags for correct gas accounting. |
| src/block/src/config_params.rs | Renames storage fee computation to calc_storage_fee_part (no rounding). |
| src/block/src/accounts.rs | Adds append_cell_no_root_gas to support SENDMSG gas parity behavior. |
| src/adnl/src/rldp/mod.rs | Replaces outbound throttling with a semaphore, adds hard outbound timeout, improves diagnostics, and uses JoinSet for cancellable task groups. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+2481
to
+2487
| for (bits, fix_gas) in FIX_GAS.into_iter().enumerate() { | ||
| let bits = bits + 1; | ||
| for (prefix, gas) in fix_gas { | ||
| let prefix = match prefix { | ||
| FixGasPrefix::Number(prefix) => prefix, | ||
| FixGasPrefix::Range(start, ..) => start, | ||
| }; |
Comment on lines
+270
to
+295
| fn redact_url(url: &str) -> String { | ||
| let (scheme, rest) = match url.split_once("://") { | ||
| Some(p) => p, | ||
| None => return url.to_string(), | ||
| }; | ||
| let (path, query) = match rest.split_once('?') { | ||
| Some((p, q)) => (p, Some(q)), | ||
| None => (rest, None), | ||
| }; | ||
| let Some(query) = query else { return url.to_string() }; | ||
|
|
||
| let redacted: Vec<String> = query | ||
| .split('&') | ||
| .map(|seg| { | ||
| if let Some((k, _)) = seg.split_once('=') { | ||
| let key = k.trim().to_ascii_lowercase(); | ||
| if matches!(key.as_str(), "api_key" | "master_key" | "token") { | ||
| return format!("{k}=***"); | ||
| } | ||
| } | ||
| seg.to_string() | ||
| }) | ||
| .collect(); | ||
|
|
||
| format!("{scheme}://{path}?{}", redacted.join("&")) | ||
| } |
Comment on lines
+498
to
+506
| /// Special-cell action list root must produce RESULT_CODE_ACTIONLIST_INVALID | ||
| /// with `result_arg = None` (position 0 encodes as Maybe-absent). | ||
| #[test] | ||
| fn test_action_phase_special_root_action_list() { | ||
| let actions_cell = ton_block::Cell::default().as_library_cell(); | ||
| let phase = run_action_phase_with_cell(actions_cell); | ||
| assert_eq!(phase.result_code, RESULT_CODE_ACTIONLIST_INVALID); | ||
| assert_eq!(phase.result_arg, Some(0)); | ||
| assert_eq!(phase.tot_actions, 0); |
Comment on lines
+452
to
+477
| let lib = libloading::Library::new(lib_name).expect("no shared dll found"); | ||
| let mut result = Vec::new(); | ||
| let time = UnixTime::now() as i32; | ||
| let mut count = 0; | ||
| let log_mask = 0; | ||
| unsafe { | ||
| let run_boc: libloading::Symbol< | ||
| unsafe extern "C" fn(*const u8, i32, i32, i32, i32, i32) -> *mut c_char, | ||
| > = lib.get(b"run_vm_boc").unwrap(); | ||
| let free_mem: libloading::Symbol<unsafe extern "C" fn(*const c_char) -> *mut c_char> = | ||
| lib.get(b"free_mem").unwrap(); | ||
| for bits in 1..=23 { | ||
| for bytes in 0..1u32 << bits { | ||
| let data = bytes << (32 - bits) | (1 << (32 - bits - 1)); | ||
| let data = data.to_be_bytes(); | ||
| assert_eq!(data[3], 0); | ||
| let code_cell = SliceData::new(data.to_vec()).into_cell().unwrap(); | ||
| let data = ton_block::write_boc(&code_cell).unwrap(); | ||
| let size = data.len() * 8; | ||
| let res = run_boc(data.as_ptr(), size as i32, time, 300, 13, log_mask); | ||
| assert!(!res.is_null(), "Fift execution failed, check fift logs"); | ||
| let fift_result = | ||
| std::ffi::CStr::from_ptr(res).to_string_lossy().trim().to_string(); | ||
| println!(" (0x{bytes:X}, {bits}, {fift_result}),"); | ||
| result.push((bytes, bits, fift_result)); | ||
| free_mem(res); |
Comment on lines
995
to
1004
| let config = read_config(cfg).unwrap(); | ||
| assert!(config.valid_config_data(false, None).unwrap()); | ||
| let libs = if libs.is_empty() { | ||
| None | ||
| } else if let Ok(data) = std::fs::read(libs) { | ||
| Some(read_single_root_boc(data).unwrap()) | ||
| } else { | ||
| None | ||
| let data = base64_decode(libs).unwrap(); | ||
| Some(read_single_root_boc(data).unwrap()) | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
Changed
Fixed