Feat/market recovery functions - #176
Merged
greatest0fallt1me merged 7 commits intoOct 2, 2025
Merged
Conversation
greatest0fallt1me
self-requested a review
September 29, 2025 04:08
Contributor
|
@armandocodecr Great work! Mind resolving the conflicts so we can merge? |
Contributor
Author
Done! |
Contributor
|
@armandocodecr Just a few conflicts to resolve before we can merge. Thanks! |
Contributor
Author
Done! Again haha |
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.
ISSUE #94
📋 Basic Information
Type of Change
Related Issues
Closes #
Related to recovery mechanisms and market integrity validation.
Priority Level
📖 Detailed Description
What does this PR do?
Introduces a market recovery system that enables:
validate_market_state_integrity).recover_market_state).partial_refund_mechanism).get_recovery_status).emit_recovery_event).MarketRecovery) with actions and metrics. Includes automated initial tests (recovery_tests.rs).Why is this change needed?
Markets can end up in inconsistent states (e.g., imbalances between
total_stakedand individual stakes). Previously, there was no mechanism to:This adds resiliency and facilitates auditing and secure protocol operation.
How was this tested?
Added
recovery_tests::test_recovery_mechanismswhich:cargo test).Alternative Solutions Considered
Symbol.Errorenum. Rejected due to#[contracterror]macro limit.⚖️ Smart Contract Specific
Contract Changes
lib.rs)Oracle Integration
Market Resolution Logic
Security Considerations
i128operations)🧪 Testing
Test Coverage
Test Results
cargo test
Expected result: all existing tests + new recovery test pass.
Manual Testing Steps
recover_market_state.get_recovery_status.📚 Documentation
Documentation Updates
Breaking Changes
Migration Guide
🔍 Code Quality
Code Review Checklist
Error)Performance Impact
recovery_records,recovery_status_map).Security Review
🚀 Deployment & Integration
Deployment Notes
cargo testbefore deploying.Integration Points
📊 Impact Assessment
User Impact
Business Impact
✅ Final Checklist
Pre-Submission
Review Readiness
📸 Screenshots (if applicable)
📂 Additional Resources
recovery.rs)emit_recovery_event💬 Notes for Reviewers
Please pay special attention to:
recover_market_statewhen the market is already consistent.partial_refund_mechanism(no real fund transfers yet).Questions for reviewers: