feat: implement Soroban analysis rules (#767 #768 #769 #770) - #785
Merged
mijinummi merged 3 commits intoAug 28, 2026
Merged
Conversation
…chLabs#768 MDTechLabs#769 MDTechLabs#770 - MDTechLabs#767: Add SorobanVectorOpsCheckRule (TS) – detects repeated traversal, front insertion, and unnecessary vector copies - MDTechLabs#768: Add SorobanMapOpsCheckRule (TS) – detects repeated key lookups, unnecessary updates, and avoidable full map traversals - MDTechLabs#769: Add LoopCostAnalyzerRule (Rust) – detects storage ops, nested loops, and cross-contract calls inside loop bodies - MDTechLabs#770: Add UnboundedIterationRule (Rust) – detects for/while/loop blocks whose iteration count is not statically bounded Register Rust rules in SorobanRuleEngine::add_default_rules() and export TS rules from packages/rules/soroban/src/index.ts.
|
@demilade18-git Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Collaborator
|
kindly fix conflict @demilade18-git |
4 tasks
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.
Summary
Implements all four Soroban analysis rules assigned to @demilade18-git.
#767 – Detect Inefficient Soroban Vector Operations
File:
packages/rules/soroban/src/collections/vector-ops-check.tsSorobanVectorOpsCheckRuledetects:.push_front,.insert(0,…),.remove(0)).clone()on aVec)#768 – Detect Inefficient Soroban Map Operations
File:
packages/rules/soroban/src/collections/map-ops-check.tsSorobanMapOpsCheckRuledetects:.set()/.insert()without an existence guard.iter(),.keys(),.values())#769 – Implement Soroban Loop Cost Analyzer
File:
packages/rules/src/soroban/loop_cost_analyzer.rsLoopCostAnalyzerRuledetects:env.storage()…) inside loop bodies#770 – Detect Unbounded Soroban Iteration
File:
packages/rules/src/soroban/unbounded_iteration.rsUnboundedIterationRuledetects:forloops iterating over dynamically-sized collections/rangeswhile true/while !done/while runningpatternsloop {}blocks without an obvious bounded break conditionIntegration
SorobanRuleEngine::add_default_rules()pub moddeclarations added topackages/rules/src/soroban/mod.rspackages/rules/soroban/src/index.tsCloses #767
Closes #768
Closes #769
Closes #770