Repository navigation
Vault cooldown/pause, TTL on write, oracle thresholds - #2269
Merged
Olowodarey merged 1 commit intoNov 23, 2026
Merged
Olowodarey merged 1 commit into
Olowodarey merged 1 commit into
Conversation
Resolves Arena1X#2198. Resolves Arena1X#2200. Resolves Arena1X#2201. Resolves Arena1X#2202.
|
@nafiisatu 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! 🚀 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
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 #2198, closes #2200, closes #2201, closes #2202.
#2198 — Unstake cooldown for the staking vault
contracts/staking-vault/src/config.rsmodule for admin-controlled vault settings.set_unstake_cooldown(cooldown)(admin only) stores a cooldown in seconds. It is capped atMAX_UNSTAKE_COOLDOWN(90 days); anything higher is rejected withInvalidCooldown.get_unstake_cooldown()returns the stored value, or0if none is set.request_unstake(staker, amount)checks that the lock has elapsed. The amount then leaves the position right away: its shares are burned, so it stops earning rewards, and any rewards already earned are paid out. The principal is held in anUnstakeRequestuntilavailable_at = now + cooldown. Emits("unstake", "requested").complete_unstake(staker)is rejected withWithdrawalLockedbeforeavailable_at. The request is removed before the token transfer, so it cannot be paid twice. Emits("unstake", "completed").unstakepath returnsCooldownRequired, so stakers can't time an exit around a reward deposit. With the default cooldown of0,unstakeworks as before.InvalidCooldown,UnstakeRequestPending,CooldownRequired.tests/cooldown_pause_tests.rs):unstakeis blocked while a cooldown is set#2200 — Emergency pause for the staking vault
config.rs. New admin-onlypause()andunpause()entry points, plusis_paused(). The existingset_pausednow delegates to the same code. Each change emits("vault", "paused")or("vault", "unpaused").Paused. That covers stake, unstake, unlock requests, withdraw, request/complete unstake, reward claims and fee deposits. Funds stay in the vault and can be withdrawn again as soon as the admin unpauses.#2201 — Extend storage TTL on write (creator-event-manager)
storage.rsextended an entry's TTL only while its event was active. A write made after that (for example the finalset_eventduring finalization, or a write to a list of a finalized event) could leave the entry with the minimum TTL, so it could expire and the data would be lost.extend_on_writehelper, using the configuredTTL_THRESHOLD/TTL_BUMP. Everyset_*/add_*helper now calls it unconditionally.next_*_id) now also extend the contract instance TTL when they write.tests/storage_ttl_write_tests.rs):#2202 — Configurable oracle consensus threshold
set_event_consensus_threshold(caller, event_id, threshold)(admin only). The threshold must be withinMIN_ORACLE_CONSENSUS_THRESHOLD (1)..=the number of configured oracle sources; anything outside that range is rejected withinvalid_consensus_threshold. Emits("oracle", "threshold_set").DataKey::EventConsensusThreshold(event_id).get_event_consensus_threshold(event_id)returns the event's own threshold, or the globalmin_sourcesif none is set.propose_match_resultnow finalizes a match only when the number of agreeing sources reaches the event's threshold.tests/oracle_threshold_tests.rs):0, a value above the source count, a non-admin caller and an unknown event are all rejectedNotes
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Closes #2198
Closes #2200
Closes #2201
Closes #2202