feat: Soroban static rules for signature verification, auth in loops, recursive calls, and call depth (#899, #874, #878, #879) - #939
Merged
mijinummi merged 2 commits intoAug 31, 2026
Conversation
…ops, recursive calls, and call depth threshold rules for issues MDTechLabs#899, MDTechLabs#874, MDTechLabs#878, and MDTechLabs#879
|
@wowamaxe-glitch 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 @wowamaxe-glitch |
Contributor
Author
|
@mijinummi Kindly Merge |
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 of Changes
This Pull Request implements static analysis analyzers and rule definitions for four Soroban contract optimization issues on GasGuard:
1. Issue #899:
Detect Duplicate Soroban Signature VerificationDuplicateSignatureAnalyzer(packages/analyzers/soroban/dataflow/duplicate-signature-analyzer.ts) to track signature verification calls (ed25519_verify,secp256k1_verify,verify_signature,signature.verify,check_auth) within function scopes and detect duplicate verifications executed on identical inputs.detectDuplicateSignatureVerificationsrule (packages/rules/soroban/src/authorization/duplicate-signature-verification-rule.ts) with severity'high'|'medium'.2. Issue #874:
Detect Soroban Authorization Inside Expensive LoopsAuthorizationLoopAnalyzer(packages/analyzers/soroban/loops/authorization-loop-analyzer.ts) to inspect loop constructs (for,while,loop), detect authorization operations (require_auth,require_auth_for_args,verify_authorizations,invoker()) inside loops, estimate iteration cost impact, and suggest hoisting auth checks.detectAuthorizationInLoopsrule (packages/rules/soroban/src/authorization/authorization-in-loops-rule.ts).3. Issue #878:
Detect Recursive Soroban Contract CallsRecursiveCallAnalyzer(packages/analyzers/soroban/callgraph/recursive-call-analyzer.ts) to construct function call graphs, detect direct self-recursion and indirect cyclic invocation paths, and report affected call cycles.detectRecursiveContractCallsrule (packages/rules/soroban/src/calls/recursive-contract-calls-rule.ts).4. Issue #879:
Implement Soroban Call Depth Threshold RuleCallDepthAnalyzer(packages/analyzers/soroban/callgraph/call-depth-analyzer.ts) to calculate maximum invocation depth per entrypoint with configurable depth threshold limits (default3).detectCallDepthThresholdExceededrule (packages/rules/soroban/src/calls/call-depth-threshold-rule.ts).Verification
packages/rules/soroban/tests/issues-899-874-878-879.spec.tscovering all 4 rules (8/8 tests passing, 19/19 soroban tests passing).Closes #899
Closes #874
Closes #878
Closes #879