Skip to content

feat(soroban): detect storage access inside expensive loops - #909

Merged
mijinummi merged 2 commits into
MDTechLabs:mainfrom
adeniran19-maker:feat/875-detect-storage-in-loops
Aug 29, 2026
Merged

feat(soroban): detect storage access inside expensive loops#909
mijinummi merged 2 commits into
MDTechLabs:mainfrom
adeniran19-maker:feat/875-detect-storage-in-loops

Conversation

@adeniran19-maker

Copy link
Copy Markdown
Contributor

Closes #875

Summary of Changes

  • Storage-in-Loop Analyzer: Implemented packages/analyzers/soroban/storage/storage-in-loop-analyzer.ts to detect repeated storage reads and writes executed inside loops.
  • Read/Write Distinction & Resource Impact:
    • Distinguishes storage reads (get, has) and writes (set, put, extend_ttl) across instance, persistent, and temporary storage spaces.
    • Classifies loop bounds (bounded_range, collection_iterator, unbounded) and calculates multiplied CPU and ledger I/O byte impact.
  • Rule Definition & Export:
    • Implemented packages/rules/soroban/src/storage/storage-in-loop-rule.ts (soroban-storage-in-loop).
    • Exported through packages/rules/soroban/src/storage/index.ts and packages/rules/soroban/src/index.ts.
  • Test Suite: Added unit test coverage in packages/rules/soroban/tests/storage-in-loop.spec.ts.

Verification

  • Ran ./node_modules/.bin/jest packages/rules/soroban/tests/storage-in-loop.spec.ts (4/4 passing).

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@adeniran19-maker 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! 🚀

Learn more about application limits

@mijinummi
mijinummi merged commit f3fbdbe into MDTechLabs:main Aug 29, 2026
4 of 7 checks passed
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.

Detect Storage Access Inside Expensive Soroban Loops

2 participants