Skip to content

feat(app): name the NAV pause and follow the oracle's bounds - #339

Open
luchobonatti wants to merge 2 commits into
feedbackfrom
feat/302-nav-pause
Open

luchobonatti wants to merge 2 commits into
feedbackfrom
feat/302-nav-pause

Conversation

@luchobonatti

@luchobonatti luchobonatti commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #302
Closes #303

The oracle renamed its emergency stop and made max_down_bps required with bounded config; the console still used the old names and offered "No limit".

Changes

  • Emergency, Cycle, /sign, the transaction modal and the hooks call pause_nav and set_nav_paused and say "Pause the NAV", "Unpause the NAV", "NAV paused"
  • Set the oracle limits requires a Largest fall and checks what the contract checks: freshness 1 s to 35 days, cooldown 1 s to the freshness window, both caps 0.01% to 100%, floor above 0, ceiling from the floor to 1,000,000
  • Cycle and /sign always show Largest fall as a percent
  • Attest price refused with NavPaused reads "Unpause the NAV first."
  • Set the oracle limits still fails with UseTimelock after setup; Run the oracle's admin changes through its timelock #337 covers it

Acceptance criteria

  • No ripcord left in app/ or app-lib/
  • Emergency actions read "Pause the NAV" and "Unpause the NAV"; Cycle's feed state reads "NAV paused"
  • /sign describes pause_nav and set_nav_paused
  • "No limit" removed from the form; Cycle always shows a value for Largest fall
  • Form checks mirror the contract: cooldown from 1 s to the freshness window, freshness up to 35 days, both caps 1 to 10,000, ceiling up to 1,000,000
  • Attest price refused with NavPaused reads "Unpause the NAV first"

Test plan

Automated tests

  1. Run npm ci
  2. Run npx vitest run app/src
  3. Expect 64 files and 1534 tests passing

Manual verification

  1. Deploy the feedback contracts to a local network and generate the app clients from them
  2. Run the app and open /admin/emergency with the oracle admin
  3. Expect "Pause the NAV" and "Unpause the NAV" in Actions and "NAV not paused" under Oracle
  4. Open /admin/configuration, expand Set the oracle limits
  5. Expect no "No limit" and nine conditions, from "Freshness window ≥ 1s" to "Price ceiling ≤ 1,000,000"

Breaking changes

None.

Checklist

  • Self-reviewed my own diff
  • Tests added or updated
  • Docs updated (if applicable)
  • No unrelated changes bundled in

Screenshots

image image image

The oracle renamed raise_ripcord to pause_nav and set_ripcord to
set_nav_paused. Emergency, Cycle, /sign, the transaction modal and the
hooks follow it.

Closes #302
The oracle made max_down_bps required and bounded its config. The form
drops "No limit", mirrors validate_config, and Attest price explains a
paused NAV.

Closes #303
Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:33
@luchobonatti luchobonatti self-assigned this Oct 23, 2026
@luchobonatti
luchobonatti requested a review from hpmaxi October 23, 2026 19:33
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
strata-vault-kit-app Error Error Oct 23, 2026 7:33pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Although I found no issues and verified the renames and form bounds against the contract, the change spans the oracle emergency-stop and config-validation surfaces of a financial vault admin console, which warrants a final human sign-off.

No open issues 🎉

What changed in this PR

This PR updates the admin console to track two upstream contract changes in the NAV oracle (issues #302 and #303). First, the oracle's emergency stop was renamed from "ripcord" to the "NAV pause" (raise_ripcord→pause_nav, set_ripcord→set_nav_paused, RipcordNotRaised→NavNotPaused), so the console is retitled to match everywhere it appears. Second, the oracle made max_down_bps required and bounded its config, so the "Set the oracle limits" form drops the "No limit" option and tightens its validation to mirror the contract's validate_config.

I verified the changes are correct and internally consistent:

  • The rename is complete — no ripcord/raise_ripcord/set_ripcord remains in app/ or app-lib/ (nor in e2e/, scripts/, or docs/).
  • The new form bounds exactly mirror nav-oracle validate_config (freshness 1s–35d, cooldown 1s–freshness, both bps 1–10000, floor > 0, ceiling floor–1,000,000×WAD), and MAX_CEILING = 1_000_000 × 10^18 equals the contract's MAX_ANSWER.
  • The simplified withinAllowedMove (price >= floor && price <= ceiling) matches the contract's deviation check, and new error copy for codes 3008/3010 matches the renamed/added oracle errors.

Changes:

  • Rename the oracle emergency stop to the "NAV pause" across Emergency, Cycle, /sign, the transaction modal, and the emergency/cycle hooks.
  • Make "Largest fall" required and tighten the oracle-config form bounds to the contract's limits; drop "No limit".
  • Add attest refusal copy for the new NavPaused (3010) error and update all affected tests.
File Description
app/​src/​pages/​sign.ts Renames oracle decoders/actions to pause_nav/set_nav_paused; always shows "Largest fall" as a percent.
app/​src/​pages/​sign.test.ts Updates and adds tests for the renamed pause actions and set_config limits.
app/​src/​pages/​emergency.ts Renames specs/labels/conditions to the NAV pause; pauseGrant/pauseSpec/navPaused.
app/​src/​pages/​emergency.test.ts Updates emergency action/tile expectations to NAV-pause wording.
app/​src/​pages/​cycle.ts Renames ripcord→navPaused; removes the nullable maxDownBps branch in the move/limit rows.
app/​src/​pages/​cycle.test.ts Updates fixtures/tests for required maxDownBps and NAV-pause labels.
app/​src/​pages/​configuration.ts New bounds constants; replaces RISE/FALL with a shared MOVE kind; rewrites oracleBounds to mirror the contract.
app/​src/​pages/​configuration.test.ts Adds the required-fall case and the new bound-label assertions.
app/​src/​hooks/​useEmergencyTransactions.ts Renames hooks/calls to usePauseNav/useSetNavPaused and pause_nav/set_nav_paused.
app/​src/​hooks/​useCycleState.ts Makes OracleLimits.maxDownBps non-null and renames ripcord→navPaused.
app/​src/​hooks/​useCycleState.test.ts, useConfigurationState.test.ts, useAdminTransaction.test.ts, useOracleState.test.ts Update fixtures/mocks for the rename and required maxDownBps.
app/​src/​components/​vault/​TransactionModal.tsx Renames emergency action union/copy; adds 3010 reason "Unpause the NAV first."
app/​src/​components/​vault/​TransactionModal.test.tsx Adds 3010 case and updates emergency-action expectations.
app/​src/​components/​admin/​EmergencySection.tsx Renames submit/flow wiring to the NAV pause actions.
app/​src/​components/​admin/​EmergencySection.test.tsx, CycleSection.test.tsx, CycleActionRail.test.tsx, ConfigurationSection.test.tsx Update mocks/fixtures and assertions for the rename and required fall.

Review effort: Balanced

This branch had an error being deployed

1 failed deployment
Preview — bde8acea Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants