TVM compatibility fixes#133
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets TVM/C++ parity by adjusting gas/fee accounting and serialization edge-cases (short-code invalid opcodes, SENDMSG storage usage, storage fee rounding, action list parsing/result_arg), and adds supporting diagnostics/ops improvements across node networking (fastsync overlays, peer resolution, RLDP timeouts/logging) plus an RPC endpoint for exporting libraries in an emulator-friendly form.
Changes:
- Add a short-code gas fix table and engine hook to charge the C++-compatible gas amount on invalid “partial primitive” opcodes.
- Align fee/accounting behavior with C++: SENDMSG body root gas charging, storage price selection by latest
utime_since, storage fee rounding, and action list/result_arg handling. - Improve node operability: build richer collator test bundles, fastsync overlay bootstrap for prev validator set, reusable overlay peer resolver, RLDP outbound hard timeout + better diagnostics, and new
getLibrariesExtRPC/openapi/tests.
Reviewed changes
Copilot reviewed 40 out of 54 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vm/tests/test_cont.rs | Adds regression test for invalid short opcodes and expected gas/steps. |
| src/vm/tests/test_app_specific.rs | Adds SENDMSG inline-vs-ref body gas accounting regression test. |
| src/vm/tests/common/test_framework.rs | Adds helper to generate gas-fix data against C++ TVM. |
| src/vm/src/tests/test_smart_contract_info.rs | Adds test for selecting latest storage price by utime_since. |
| src/vm/src/smart_contract_info.rs | Fixes storage price selection logic to choose the latest applicable entry. |
| src/vm/src/executor/engine/mod.rs | Registers/exports new fix_gas engine module. |
| src/vm/src/executor/engine/fix_gas.rs | Introduces FIX_GAS table + short-code detection helper. |
| src/vm/src/executor/engine/core.rs | Hooks short-code detection into execution and adjusts invalid-opcode stepping/gas. |
| src/vm/src/executor/config.rs | Changes storage fee calculation to round after interval summation. |
| src/vm/src/executor/blockchain.rs | Adjusts SENDMSG storage usage gas charging for synthesized inline body/root. |
| src/node/src/validator/fabric.rs | Refactors test-bundle creation on validation failures; plumbs external messages. |
| src/node/src/validator/collator.rs | Tracks accepted external messages for bundling on collator errors. |
| src/node/src/rpc_server/tests/test_handlers.rs | Adds test coverage for getLibrariesExt. |
| src/node/src/rpc_server/static/openapi.json | Documents new /getLibrariesExt endpoint. |
| src/node/src/rpc_server/handlers.rs | Adds getLibrariesExt and includes created_by in block header response. |
| src/node/src/network/overlay_client.rs | Raises query logging to DEBUG and adds result logging. |
| src/node/src/network/node_network.rs | Adds reusable overlay peer resolver worker. |
| src/node/src/network/full_node_overlays.rs | Adds prev-set fastsync overlay bootstrap + DHT peer resolution scheduling/cancel. |
| src/node/src/network/full_node_overlay_client.rs | Adds DEBUG logging around RLDP block downloads. |
| src/node/src/network/custom_overlay_client.rs | Switches custom overlays to shared peer resolver helper. |
| src/node/src/network/control.rs | Updates bundle building call signature (external messages). |
| src/node/src/full_node/shard_client.rs | Raises shard-client tracing logs to DEBUG. |
| src/node/src/engine.rs | Calls special fastsync overlay update during startup. |
| src/node/src/collator_test_bundle.rs | Extends bundles with external messages; improves state simplification coverage. |
| src/node/simplex/src/tests/test_session_processor.rs | Adds test for early shard dispatch timing parity with C++. |
| src/node/simplex/src/session_processor.rs | Splits dispatch vs min-gen timing; adds detailed timing logging. |
| src/executor/src/transaction_executor.rs | Improves action list parsing errors; sets result_arg consistently; adjusts MAX_ACTIONS visibility. |
| src/executor/src/tests/test_transaction_executor_with_real_data.rs | Updates replay helpers and adds regression tests for new parity fixes. |
| src/executor/src/tests/test_tr_phases.rs | Adds tests for invalid/special action list roots and MAX_ACTIONS overflow. |
| src/executor/src/tests/test_ordinary_transaction.rs | Adds result_arg regression tests for action failures; updates expectations. |
| src/executor/src/tests/common/mod.rs | Allows libs input as base64 in replay helper. |
| src/executor/src/blockchain_config.rs | Changes storage fee accumulation/rounding; adds unit test for rounding-after-sum. |
| src/block/src/transactions.rs | Serializes result_arg == Some(0) as absent to match C++ encoding. |
| src/block/src/tests/test_out_actions.rs | Updates tests for new action list unpacking API + special cell rejection. |
| src/block/src/tests/test_config_params.rs | Updates storage fee max test for calc_storage_fee_part. |
| src/block/src/out_actions.rs | Refactors action list unpacking to operate on Cell and return error position. |
| src/block/src/messages.rs | Exposes parsed body_to_ref / init_to_ref accessors. |
| src/block/src/config_params.rs | Splits storage fee calc into “part” (no rounding) for correct rounding placement. |
| src/block/src/accounts.rs | Adds append_cell_no_root_gas variant used by SENDMSG gas parity fix. |
| src/adnl/src/rldp/mod.rs | Limits outbounds via semaphore; adds outbound hard-timeout + diagnostics and JoinSet task management. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lapo4kaKek
approved these changes
May 5, 2026
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.
No description provided.