Skip to content

Add design docs for auth/storage change detection and state mutation analysis - #856

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
soundsng:docs/issues-829-830-831-832
Aug 28, 2026
Merged

Add design docs for auth/storage change detection and state mutation analysis#856
mijinummi merged 1 commit into
MDTechLabs:mainfrom
soundsng:docs/issues-829-830-831-832

Conversation

@soundsng

Copy link
Copy Markdown
Contributor

This PR adds design/spec docs for four related Soroban gas-optimization safety features, grounded in the existing packages/rules/src/soroban/ and packages/rules/src/security/ module layout.

Closes #829
Optimization-induced authorization changes can silently drop or retarget require_auth/require_auth_for_args calls during autofix. The doc specifies an AuthorizationDiffRule that diffs pre/post authorization call sites per function and blocks unsafe autofix candidates.

Closes #830
Storage-focused optimizations can drop or introduce env.storage() writes without detection. The doc specifies a storage_diff.rs module that diffs storage operations per function/tier/key between pre- and post-fix contract versions.

Closes #831
No existing analyzer tracks how often or where a Soroban contract mutates its own state. The doc specifies a StateMutationAnalyzer and MutationPath model, feeding both the storage-diff (#830) and redundant-mutation (#832) rules.

Closes #832
Writing an unchanged value still costs a full storage write. The doc specifies a RedundantMutationRule, built on the #831 mutation model, that detects redundant writes (including per-branch analysis for conditional mutations) and emits optimization suggestions.

Scope

Docs only — no changes to rules/, src/, apps/, libs/, packages/, contracts/, or gasguard-cli/. Four new files under docs/:

  • docs/issue-829-optimization-induced-auth-changes.md
  • docs/issue-830-optimization-induced-storage-changes.md
  • docs/issue-831-state-mutation-analyzer.md
  • docs/issue-832-redundant-state-mutations.md

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@soundsng 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 2efd1c6 into MDTechLabs:main Aug 28, 2026
6 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

2 participants