refactor: split executor into focused sub-modules#301
Merged
Timi16 merged 4 commits intoTimi16:mainfrom Feb 25, 2026
Merged
Conversation
Owner
|
fix conflicts |
Contributor
Author
|
@Timi16 |
Contributor
Author
|
Also, there is an errorr in the test coverage implemented that shows the total coverage as 0. |
Contributor
Author
|
@Timi16 CoverageOverall project coverage: 56.32% (pre-existing, unchanged by this refactor). I will also move the coverage pass-mark to 50% pending when an issue is created to address increasing the test coverage project-wise. |
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.
Closes #282
Summary
src/runtime/executor.rshad grown to 640 lines handling four distinct responsibilities. This PR splits it into focused sub-modules while keeping the public API identical — no callers needed to change.New sub-modules
src/runtime/loader.rsEnvbootstrap, contract registration, error-DB initsrc/runtime/invoker.rssrc/runtime/parser.rsOption<T>/Tuple<…>type-aware normalisationsrc/runtime/result.rsExecutionRecord,StorageSnapshot,InstructionCounts) and invocation result formattingexecutor.rsis now a thin coordinator (~210 lines) that wires these modules together and owns theContractExecutorstruct.Changes
src/runtime/mod.rs— declares and re-exports the four new modules; public API unchangedsrc/runtime/executor.rs— reduced to coordination logic onlysrc/runtime/loader.rs— newsrc/runtime/invoker.rs— new; usesinspect_err(notmap_err) for side-effect-only error handling per Clippymanual_inspectsrc/runtime/parser.rs— new; includes unit tests fortuple_arity_from_type_namesrc/runtime/result.rs— new; correctConversionError/InvokeErrortypes matching soroban-sdk v22try_invoke_contractsignatureVerification
cargo fmt --check✅RUSTFLAGS="-D warnings" cargo check✅cargo clippy --workspace --all-targets -- -D warnings✅cargo test✅No functional changes
All execution paths, error messages, argument validation logic, mock dispatcher installation, timeout enforcement (
exit(124)), andcatch_unwindaddress guards are byte-for-byte equivalent to the original. The refactor is purely structural.