Skip to content

feat(soroban): call graph + serialization cost analyzers (#771, #772, #773, #774) - #786

Merged
mijinummi merged 2 commits into
MDTechLabs:mainfrom
monique-7arch:feat/soroban-call-serialization-analyzers-771-774
Aug 28, 2026
Merged

feat(soroban): call graph + serialization cost analyzers (#771, #772, #773, #774)#786
mijinummi merged 2 commits into
MDTechLabs:mainfrom
monique-7arch:feat/soroban-call-serialization-analyzers-771-774

Conversation

@monique-7arch

Copy link
Copy Markdown

Summary

Implements four assigned Soroban analyzer issues in a single PR.

Changes

Call Graph Analyzer (packages/rules/soroban/src/analyzer/callgraph-analyzer.ts)

  • Extracts all cross-contract call sites (env.invoke_contract, Client::new, etc.)
  • Builds per-function call maps

#771 — Detect Expensive Nested Soroban Calls

  • packages/rules/soroban/src/calls/nested-calls-rule.ts
  • Flags functions that make ≥3 cross-contract calls (deep call chains)

#772 — Implement Soroban Cross-Contract Call Analyzer

  • packages/rules/soroban/src/calls/cross-contract-calls-rule.ts
  • Reports every cross-contract call site with overhead warning and caching suggestion

#773 — Detect Redundant Soroban Contract Calls

  • packages/rules/soroban/src/calls/redundant-calls-rule.ts
  • Detects identical callee+args called more than once within the same function and suggests result caching

#774 — Implement Soroban Serialization Cost Analyzer

  • packages/rules/soroban/src/analyzer/serialization-analyzer.ts
  • packages/rules/soroban/src/serialization/serialization-cost-rule.ts
  • Detects repeated to_xdr/from_xdr/serialize calls on the same value
  • Detects unnecessary type conversion chains (e.g. String→Bytes→String)
  • Flags large structs (≥5 fields) passed through serialization boundaries

All new modules are re-exported from packages/rules/soroban/src/index.ts.

Closes #771
Closes #772
Closes #773
Closes #774

…abs#771, MDTechLabs#772, MDTechLabs#773, MDTechLabs#774)

- callgraph-analyzer.ts: builds call graph, detects nested chains (MDTechLabs#771),
  cross-contract calls (MDTechLabs#772), and redundant identical calls (MDTechLabs#773)
- serialization-analyzer.ts: detects repeated (de)serializations,
  unnecessary type conversions, and large serialized structs (MDTechLabs#774)
- Rule wrappers in packages/rules/soroban/src/calls/ and .../serialization/
- Re-export everything from soroban src/index.ts

Closes MDTechLabs#771, closes MDTechLabs#772, closes MDTechLabs#773, closes MDTechLabs#774
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@monique-7arch 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

Copy link
Copy Markdown
Collaborator

please kindly fix conflict @monique-7arch

@mijinummi
mijinummi merged commit e2d2826 into MDTechLabs:main Aug 28, 2026
6 of 7 checks passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Aug 28, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants