Skip to content

chore: update irm and comptroller in ui - #456

Open
Serhii-Apriorit wants to merge 4 commits into
mainfrom
chore/update_model_in_ui
Open

chore: update irm and comptroller in ui#456
Serhii-Apriorit wants to merge 4 commits into
mainfrom
chore/update_model_in_ui

Conversation

@Serhii-Apriorit

Copy link
Copy Markdown

No description provided.

@Serhii-Apriorit
Serhii-Apriorit force-pushed the chore/update_model_in_ui branch from 90dbb76 to 7cadab1 Compare July 17, 2026 16:05
@KevinMehrabi
KevinMehrabi self-requested a review July 22, 2026 17:37

@KevinMehrabi KevinMehrabi 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.

The Guard Comptroller and dynamic IRM integration are moving in the right direction, but please address the following before approval:

  1. In Guard/recovery mode, RedeemOpGroup should not call the legacy Comptroller’s updateAccountLiquidityWithView. That unnecessarily makes withdrawals depend on the compromised oracle and every legacy market. Accrue only the selected ꜰToken and then perform the redeem.

  2. In Guard/recovery mode, RepayBorrowOpGroup should accrue only the market being repaid. A failure in an unrelated market should not block repayment.

  3. Guard market storage does not contain mintPaused or borrowPaused. When comptrollerDataSource is present, treat minting and borrowing as disabled based on Guard mode instead of falling back to the legacy Comptroller’s pause values.

  4. Please remove the unrelated deployment/configuration changes from this UI PR, especially TezFinBuild/deploy_result/deploy.mainnet.json. The addresses currently recorded there do not resolve as mainnet contracts and the files overlap with PR #455.

  5. Add CI coverage that builds the actual React UI and tests the Guard/legacy storage combination and the recovery operation groups.

Once these items are fixed and the recovery withdrawal and repayment flows are tested against the live contract interfaces, this PR should be ready for approval.

@Serhii-Apriorit

Copy link
Copy Markdown
Author
  • In Guard/recovery mode, RedeemOpGroup no longer calls the legacy Comptroller’s updateAccountLiquidityWithView.
  • Withdraw operations accrue interest only for the selected fToken before executing redeem or redeemUnderlying.
  • In Guard/recovery mode, RepayBorrowOpGroup accrues interest only for the market being repaid.
  • The existing legacy-mode operation group behavior remains unchanged.
  • Guard storage is combined with legacy Comptroller storage for market data.
  • When comptrollerDataSource is present, Supply and Borrow are treated as disabled regardless of the legacy mintPaused and borrowPaused values.
  • The mintPaused, borrowPaused, and redeemPaused flags are propagated through the complete data flow: Comptroller storage → Market model → Redux → UI.
  • Supply and Borrow buttons are disabled for all markets in recovery mode.
  • Modal-level guards prevent prohibited operations from being constructed through alternative UI paths.
  • Added Supply Paused and Borrow Paused messages.
  • Withdraw and Repay remain available according to the Guard Comptroller rules.
  • Removed the unrelated TezFinBuild/deploy_result/deploy.mainnet.json file.
  • Added unit tests for combined Guard/legacy storage and recovery operation groups.
  • Added a production React UI build to CI.
  • Verified utility tests (33 passing), the production build, and the disabled state of all Supply and Borrow buttons locally

We cannot perform a full e2e verification of the repay and withdraw flows because we do not have access to an account with an outstanding debt and supplied fToken balance. The operation groups are covered by unit tests, but validating actual on-chain execution requires a suitable borrower account

@KevinMehrabi

Copy link
Copy Markdown
Contributor

Thank you. I confirmed that the original recovery-path issues are now addressed:

  • Withdrawals no longer depend on the legacy Comptroller.
  • Recovery repayments accrue only the market being repaid.
  • Supply and Borrow are disabled authoritatively in recovery mode.
  • Recovery operation tests were added.
  • The React production build is now included in CI.
  • The XTZ market correctly displays the live 0% IRM.

Before approval, please address these remaining items:

  1. The collateral switch is currently disabled unconditionally in src/ui/src/components/Switch/index.js. This disables collateral controls on Previewnet and future non-recovery deployments as well. It should be disabled only when the UI is using comptrollerDataSource/Guard recovery mode.

  2. Please remove the remaining unrelated deployment changes from this UI PR:

    • deploy/compile_targets/Config.json
    • deploy/deploy_script/config.json

    Those belong in PR chore: updated deployment scripts #455, not the Guard/IRM UI PR.

  3. Recovery mode still displays USD values derived from the compromised oracle. In the current mainnet build, for example, approximately 624.92 USDtz is displayed as approximately $28.22 million, and some available amounts display negative USD values. Since these valuations cannot be trusted during recovery, please hide or mark the affected USD valuations and borrow-limit/availability figures as unavailable in recovery mode rather than showing incorrect values.

Once those items are fixed and CI remains green, please provide a staging URL pointed at the live recovery contracts so I can perform a small real repayment and zero-debt withdrawal as final release checks.

@KevinMehrabi

Copy link
Copy Markdown
Contributor

Thanks, I reviewed the latest update. The recovery-mode behavior is now substantially improved: collateral controls are restricted only in recovery mode, unsafe oracle-derived USD values are hidden, and the action buttons respect the market pause and listing states.

Two blockers remain:

  1. The following files are currently deleted by this PR:
    • deploy/compile_targets/Config.json
    • deploy/deploy_script/config.json

Please restore both files exactly from main so they disappear entirely from this PR’s diff. They should not be deleted by a UI PR.

  1. Please provide a staging deployment and complete the repay and withdrawal canary tests using the Guard Comptroller configuration.

Also, CI currently builds with DISABLE_ESLINT_PLUGIN=true. A normal production build reports lint failures, including failures in files changed by this PR. Please at least clean up the new lint violations introduced in the modified files.

Once these items are resolved, this PR should be ready for another review.

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.

3 participants