Add design docs for auth/storage change detection and state mutation analysis - #856
Merged
Merged
Conversation
|
@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! 🚀 |
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.
This PR adds design/spec docs for four related Soroban gas-optimization safety features, grounded in the existing
packages/rules/src/soroban/andpackages/rules/src/security/module layout.Closes #829
Optimization-induced authorization changes can silently drop or retarget
require_auth/require_auth_for_argscalls during autofix. The doc specifies anAuthorizationDiffRulethat 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 astorage_diff.rsmodule 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
StateMutationAnalyzerandMutationPathmodel, 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/, orgasguard-cli/. Four new files underdocs/:docs/issue-829-optimization-induced-auth-changes.mddocs/issue-830-optimization-induced-storage-changes.mddocs/issue-831-state-mutation-analyzer.mddocs/issue-832-redundant-state-mutations.md