feat: Oracle Safety Valve with DAO manual rate override (Issue #102)#256
Open
mgtmdccix-oss wants to merge 1 commit intoGrant-Stream:mainfrom
Open
feat: Oracle Safety Valve with DAO manual rate override (Issue #102)#256mgtmdccix-oss wants to merge 1 commit intoGrant-Stream:mainfrom
mgtmdccix-oss wants to merge 1 commit intoGrant-Stream:mainfrom
Conversation
…ant-Stream#102) - oracle_heartbeat(): oracle signals liveness, records timestamp - propose_safety_rate(): DAO member opens vote after 48h oracle silence - vote_on_safety_rate(): weighted DAO vote with double-vote protection - execute_safety_rate(): applies rate on 90% supermajority after voting ends - get_exchange_rate(): returns manual rate or (1,1) fallback - Added SafetyVoteProposal struct, SafetyVoteStatus enum, DataKey variants, error codes 304-309, and constants for timeouts/thresholds - Tests: heartbeat blocks proposal, full flow, rejection below 90%, oracle recovery blocks execution
|
@mgtmdccix-oss 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! 🚀 |
Contributor
|
resolve conflicts |
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.
Closes #215
Summary
If the Price Oracle stops responding, inflation protection could freeze funds. This PR implements a Manual Safety Valve so the protocol remains antifragile.
Changes
oracle_heartbeat()— oracle signals liveness by recording a timestamppropose_safety_rate()— any DAO member can propose a manual exchange rate after 48 hours of oracle silencevote_on_safety_rate()— weighted DAO vote with double-vote protectionexecute_safety_rate()— applies the rate if 90% supermajority is reached after the voting window closes; re-checks oracle is still silent at execution timeget_exchange_rate()— returns the manual rate, or(1, 1)if none is setNew types & storage
SafetyVoteProposalstruct +SafetyVoteStatusenumDataKeyvariants:OracleLastHeartbeat,SafetyVoteProposal,SafetyVoteVote,ManualExchangeRate, etc.Tests (
test_oracle_safety_valve.rs)Labels
securityreliabilitylogic