Skip to content

TVM compatibility fixes. Cells operations optimization#117

Merged
bvscd merged 3 commits into
release/node/v0.6.0from
fix_vm
Apr 24, 2026
Merged

TVM compatibility fixes. Cells operations optimization#117
bvscd merged 3 commits into
release/node/v0.6.0from
fix_vm

Conversation

@bvscd
Copy link
Copy Markdown
Collaborator

@bvscd bvscd commented Apr 22, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 22, 2026 21:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR focuses on TVM compatibility and cell-operation optimizations by migrating a large part of the codebase to updated cell APIs (borrowed repr_hash(), fallible shrink_references, etc.), improving BOC (de)serialization paths, and adjusting node/storage runtime behavior (RocksDB + allocator).

Changes:

  • Updated cell/hash handling across VM, node, executor, and block crates to match new borrowing/error semantics (repr_hash() by ref; shrink_references(..)?; clone_references()?, etc.).
  • Optimized message/storage calculations and BOC parsing/writing (e.g., append_cell usage, read_single_root_boc_file, read_boc, BocReader cursor-based reads).
  • Introduced operational/runtime changes in node/storage (RocksDB direct I/O tuning, larger default caches) and node default allocator (jemalloc), plus added/updated tests and tooling scripts.

Reviewed changes

Copilot reviewed 132 out of 144 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/vm/tests/test_library.rs Adjust tests to new repr_hash() borrowing semantics.
src/vm/tests/test_cont.rs Add exception assertion; tweak gas limit for OOG test.
src/vm/tests/test_cell_deserialization.rs Update hash usage to cloned repr_hash() results.
src/vm/tests/test_app_specific.rs Switch storage calc to append_cell; add SENDMSG same-cell test; fix typos in comments.
src/vm/tests/common/test_framework.rs Use read_single_root_boc_file; adjust hash cloning; tweak Windows lib path.
src/vm/tests/common/mod.rs Update MerkleProof hash cloning.
src/vm/src/tests/test_smart_contract_info.rs Use read_single_root_boc_file for state loading.
src/vm/src/tests/test_microfunctions.rs Update expectations around control-register NULL handling.
src/vm/src/stack/savelist.rs Tighten c0..c3 to continuation-only.
src/vm/src/executor/engine/core.rs Trace opcode naming tweak; visited_cells insert cloning; make shrink_references fallible.
src/vm/src/executor/dictionary.rs Propagate shrink_references(..)?.
src/vm/src/executor/deserialization.rs Propagate shrink_references(..)?; clone hashes for visited sets.
src/vm/src/executor/blockchain.rs Change SENDMSG message construction path and storage sizing to cell-based traversal.
src/node/tests/test_run_net_py/run_singlehost_nodectl.sh New bootstrap script for singlehost + nodectl workflows.
src/node/tests/test_load_net/scripts/transactionChain.ts Translate large comment block to English.
src/node/storage/src/types/tests/test_storage_cell.rs Improve serde roundtrip assertions and update helpers/imports.
src/node/storage/src/types/mod.rs Add PersistentStatePartId::is_whole_state().
src/node/storage/src/tests/test_shardstate_db_async.rs Update repr_hash cloning and constructor signature usage.
src/node/storage/src/tests/test_dynamic_boc_rc_db.rs Update APIs; add stored-cell and async adapter tests.
src/node/storage/src/tests/test_dynamic_boc_archive_db.rs Update load signatures and clone_references fallibility.
src/node/storage/src/tests/mod.rs Update unique-cell counting to clone hashes.
src/node/storage/src/shardstate_db_async.rs Increase default RocksDB cache sizes; adjust load signatures/log levels; add stop check in queue loop.
src/node/storage/src/lib.rs Remove stored-cells telemetry/allocation counters from structs/defaults.
src/node/storage/src/dynamic_boc_rc_db.rs Switch to smallvec serialization; remove panic flags; loader init optimization; async adapter updates.
src/node/storage/src/dynamic_boc_archive_db.rs Switch to smallvec serialization; simplify load API; stored-cell detection via CellDb.
src/node/storage/src/db/rocksdb.rs Enable direct I/O for flush/compaction + compaction readahead tuning.
src/node/storage/src/archives/archive_slice.rs Return &Path from db_root_path.
src/node/storage/src/archive_shardstate_db.rs Update DB constructors/load signatures; clone root hashes.
src/node/storage/benches/shardstate_db3.rs Update ShardStateDb constructor signature usage.
src/node/storage/benches/shardstate_db2.rs Update ShardStateDb constructor signature usage.
src/node/storage/benches/shardstate_db1.rs Update ShardStateDb constructor signature usage.
src/node/storage/benches/helper.rs Handle clone_references()?.
src/node/src/validator/validate_query.rs Update MerkleUpdate API usage; normalize hash borrowing/cloning in validations.
src/node/src/validator/tests/test_out_msg_queue.rs Update repr_hash cloning in test.
src/node/src/validator/tests/test_collator.rs Use read_boc; fix compare_blocks arg order; hash comparisons without refs.
src/node/src/validator/out_msg_queue.rs Clone visited hashes.
src/node/src/validator/fabric.rs Pass candidate/usage_tree into test-bundle builder depending on outcome path.
src/node/src/validator/collator.rs Clone block root hash; make visited-integrity helper return Result and handle fallible refs.
src/node/src/types/top_block_descr.rs Fix hash deref in Merkle-proof verification.
src/node/src/types/tests/test_awaiters_pool.rs Increase delay (timing) in test.
src/node/src/types/limits.rs Clone hashes for seen sets; avoid taking refs to temporaries.
src/node/src/types/accounts.rs Clone last transaction hash; correct library hash comparisons.
src/node/src/tests/test_sync.rs Switch to deserialize_state with borrowed bytes.
src/node/src/tests/test_shard_states_keeper.rs Add ignored tests for persistent state storer/fast saving.
src/node/src/tests/test_shard_state.rs Clone repr_hash() into block id root hash.
src/node/src/tests/test_liteserver.rs Update InternalDb constructor signature usage; fix root-hash comparisons/cloning.
src/node/src/tests/test_internal_db.rs Update InternalDb ctor signature usage; switch to persistent state “part” API.
src/node/src/tests/test_helper.rs Update InternalDb ctor signature usage; clone root hashes.
src/node/src/tests/test_control.rs Update InternalDb ctor signature usage.
src/node/src/tests/test_block.rs Fix merkle proof hash deref.
src/node/src/tests/test_archive_import.rs Update InternalDb ctor signature usage; normalize hash comparisons.
src/node/src/shard_state.rs Remove in-mem deserialization path; adjust zero-state hash comparison.
src/node/src/rpc_server/tests/test_handlers.rs Clone library keys (repr_hash).
src/node/src/rpc_server/serializers.rs Clone message/body hashes; avoid relying on borrowed repr_hash temporaries.
src/node/src/rpc_server/handlers.rs Fix transaction-hash comparisons against borrowed repr_hash.
src/node/src/network/mod.rs Fix root-hash comparison for broadcast validation.
src/node/src/network/liteserver.rs Clone subtree hashes; fix comparisons vs borrowed hashes.
src/node/src/network/control.rs Clone account code/data/libs hashes.
src/node/src/main.rs Replace tcmalloc check with optional jemalloc global allocator + config symbol.
src/node/src/internal_db/mod.rs Add truncate-at-seqno option; remove dynamic-db clearing helpers; refactor persistent-state API.
src/node/src/full_node/apply_block.rs Use new MerkleUpdate APIs (apply_with_loader, apply_with_factory).
src/node/src/ext_messages.rs Clone root hash for returned id.
src/node/src/engine.rs Thread new truncate/config params through; adjust telemetry items and dict cache keying.
src/node/src/config.rs Add PSS cache sizing config knobs with defaults.
src/node/src/collator_test_bundle.rs Use borrowed-bytes state deserialization; refactor external message collection.
src/node/src/boot.rs Clone part root hashes.
src/node/src/block_proof.rs Use Cursor-based BocReader reads; fix hash deref comparisons.
src/node/src/block.rs Cursor-based BocReader read; use read_single_root_boc for file loading; fix hash deref comparisons.
src/node/src/archive_import/mod.rs Update ArchiveShardStateDb constructor signature usage.
src/node/src/archive_import/ingester.rs Cursor/Instant refactor; use read_single_root_boc; clone root hashes; error type import.
src/node/consensus-common/src/adnl_overlay.rs Use imported Mutex type alias for peer storage.
src/node/catchain/README.md Fix “sends а list” → “sends a list” (typo).
src/node/bin/zerostate.rs Clone zerostate root hash.
src/node/bin/print.rs Update InternalDb ctor signature usage.
src/node/bin/hardfork.rs Update InternalDb ctor signature usage.
src/node/bin/console.rs Sign repr_hash() directly; update ctor signature usage; clone root hashes.
src/node/bin/benchmark.rs Clone hashes; update ShardStateDb ctor signature usage; update BocReader in-mem-to-storage call signature.
src/node/Cargo.toml Bump node version; add jemalloc feature/default; add tikv-jemallocator dep (non-windows).
src/node-control/contracts/src/wallet/wallet_contract.rs Avoid intermediate hash value; reuse state_cell.hash(0) directly.
src/executor/src/transaction_executor.rs Use TraceCallback import; clone action list hash; avoid redundant key building; update library get/set usage.
src/executor/src/tests/test_transaction_executor_with_real_data.rs Add new regression tests; config loading helper; write BOCs via BocWriter; add pruned-cell regression.
src/executor/src/tests/test_random_gen.rs Avoid moving hash by cloning where needed.
src/executor/src/tests/test_ordinary_transaction.rs Update MerkleProof predicates and proof hash cloning.
src/executor/src/tests/test_ordinary_libs_and_code.rs Clone frozen hash.
src/executor/src/tests/test_ordinary_freeze.rs Clone frozen hash.
src/executor/src/tests/common/mod.rs Use file-based boc reader; adjust MerkleProof hash clone; switch storage calc to append_cell.
src/executor/src/tests/common/cross_check.rs Reorder asserts to avoid early exit/side effects.
src/executor/src/ordinary_transaction.rs Add debug logs; refactor compute-phase setup; adjust uninit/nonexist handling behavior.
src/executor/real_boc/state_init_nogas_abc17907_transaction.boc Added fixture for new regression test.
src/executor/real_boc/state_init_nogas_abc17907_account_new.boc Added fixture for new regression test.
src/executor/real_boc/pruned_cell_load_transaction.boc Added fixture for pruned-cell regression test.
src/executor/real_boc/pruned_cell_load_account_old.boc Added fixture for pruned-cell regression test.
src/executor/real_boc/pruned_cell_load_account_new.boc Added fixture for pruned-cell regression test.
src/executor/real_boc/non_bounce_with_state_init_nogas_transaction.boc Added fixture for new regression test.
src/executor/real_boc/non_bounce_with_state_init_nogas_account_new.boc Added fixture for new regression test.
src/emulator/src/tests/test_emulator.rs Use read_single_root_boc_file to load account root cell.
src/emulator/src/lib.rs Clone last transaction hash.
src/block/src/types.rs Make UInt256 repr(transparent); change serialization patterns to explicit refs.
src/block/src/transactions.rs Write nested structures as references with checked_append_reference; fix repr_hash comparisons/cloning.
src/block/src/tests/test_types.rs Remove DataCell-specific construction from tests; rebuild via Cell::build_data + Cell::with_data_and_refs.
src/block/src/tests/test_storage_stat.rs Fix comparisons vs borrowed repr_hash().
src/block/src/tests/test_shard.rs Load boc via read_single_root_boc(std::fs::read(..)?).
src/block/src/tests/test_out_msgs.rs Clone message hash for dict key.
src/block/src/tests/test_out_actions.rs Clone code hash when building action.
src/block/src/tests/test_messages.rs Clone message hash for base64 encoding.
src/block/src/tests/test_merkle_update.rs Clone hashes; handle clone_references().unwrap() in test helper.
src/block/src/tests/test_merkle_proof.rs Clone hashes; simplify closures to compare by value; clone tx hashes.
src/block/src/tests/test_boc.rs Replace HashMap CellsTempStorage impl with explicit struct implementing loader(); switch to Cursor-based BocReader reads; comment out strict compatibility asserts; add ignored bench.
src/block/src/tests/test_accounts.rs Clone library hash for dict key.
src/block/src/storage_stat.rs Clone hashes for cache keys and dict lookups.
src/block/src/outbound_messages.rs Clone returned hashes in helpers.
src/block/src/messages.rs Remove gas-consumer based Message constructor; refactor Deserializable to construct_from; fix “serilalize” typo; serialize nested SimpleLib/LibDescr as references; clone library code hash before insert.
src/block/src/merkle_proof.rs Fix hash deref comparisons; clone root hash in proof; clone keys for done_cells.
src/block/src/master.rs Read/write LibDescr.lib as a drained/appended reference.
src/block/src/lib.rs GetRepresentationHash now clones from borrowed repr_hash().
src/block/src/inbound_messages.rs Avoid temporary-cell hashing in Display; write proof refs via checked_append_reference; use cloned repr_hash() as keys.
src/block/src/dictionary/mod.rs Remove count_cells API from HashmapType.
src/block/src/dictionary/hashmapaug.rs Make shrink_references fallible and propagate errors.
src/block/src/dictionary/hashmap.rs Make shrink_references fallible and propagate errors; remove count_cells wrapper.
src/block/src/cell/tests/test_slice.rs Update shrink_references(..).unwrap() calls after signature change.
src/block/src/cell/slice.rs Make shrink_references return Result; add reference_repr_hash; change repr/hash getters to borrowed refs and return smallvecs for hashes/depths; update Hash/Eq implementations to use repr_hashes.
src/block/src/cell/builder.rs Switch builder finalize path to Cell::build_data + Cell::with_data_and_refs; make clone_references fallible.
src/block/src/boc_compression.rs Insert cloned hash keys into visited map.
src/block/src/bintree.rs Make shrink_references fallible and propagate errors.
src/block/src/accounts.rs StorageUsageCalc uses owned hash clones; switch from builder-based traversal to cell-based traversal; clone dict hash comparisons; clone code/data hashes.
src/block-json/src/tests/test_serialize.rs Clone repr_hash for code/libs and tx ids.
src/block-json/src/serialize.rs Clone block/message ids from borrowed repr_hash.
src/block-json/src/deserialize.rs Clone repr_hash() into BlockIdExt.
src/assembler/src/disasm/loader.rs Make shrink_references fallible; clone history keys.
src/assembler/src/debug.rs Clone hashes before taking .inner().
src/assembler/src/complex.rs Avoid borrowing temporaries when adjusting debug map; key insert/remove via owned hash.
src/assembler/src/bin/disasm.rs Remove count_cells usage; add manual traversal for count; clone repr_hash in unique counter.
src/Cargo.lock Bump node version; add tikv-jemallocator crates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/node/storage/src/dynamic_boc_rc_db.rs
Comment thread src/vm/src/executor/blockchain.rs
Comment thread src/node/storage/src/db/rocksdb.rs
Comment thread src/node/storage/src/shardstate_db_async.rs
Comment thread src/node/Cargo.toml
@bvscd bvscd merged commit a508e4b into release/node/v0.6.0 Apr 24, 2026
6 checks passed
@bvscd bvscd deleted the fix_vm branch April 24, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants