Skip to content

VDB-24: VIP-664 [BNB Chain] Disable DeviationSentinel for DAI, resume borrowing, reset EBrake snapshots#737

Closed
trumpgpt-bot wants to merge 1 commit into
mainfrom
bot/VDB-24-prepare-vip-fix-dai-market-on-bsc-via-sentinel-reset
Closed

VDB-24: VIP-664 [BNB Chain] Disable DeviationSentinel for DAI, resume borrowing, reset EBrake snapshots#737
trumpgpt-bot wants to merge 1 commit into
mainfrom
bot/VDB-24-prepare-vip-fix-dai-market-on-bsc-via-sentinel-reset

Conversation

@trumpgpt-bot

Copy link
Copy Markdown
Contributor

Adds VIP-664 (bscmainnet, ProposalType.REGULAR) and its fork simulation implementing VDB-24.

What changes (single Normal-Timelock batch):

  1. DeviationSentinel.setTokenMonitoringEnabled(DAI, false) — stop monitoring DAI (deviation config preserved); ordered first so vDAI can't be re-tripped around execution.
  2. Comptroller.setActionsPaused([vDAI],[BORROW], false) — resume borrowing. No collateral-factor command: vDAI's pre-incident CF was already 0 (the EBrake CF snapshot is empty because the weekend incident only paused borrowing), so there is nothing to restore and no CF is invented.
  3. EBrake.resetCFSnapshot(vDAI) + resetBorrowCapSnapshot(vDAI) + resetSupplyCapSnapshot(vDAI) — clear the vDAI snapshots.

No new ACM permissions — the Normal Timelock already holds every role used (verified via hasRole on the ACM).

Notes for reviewers: The deployed DeviationSentinel (post VIP-610/EBrakeV2) is detection-only and routes to EBrake; the repo helper src/DeviationSentinel.ts (wrapWithSentinelGuard) describes the old design and is intentionally not used. Snapshot reads/resets live on EBrake; its sim ABI is built from the deployed impl. Every address/signature was verified against networkAddresses, the oracle deployment artifacts, and on-chain reads.

Tests: npx hardhat test simulations/vip-664/bscmainnet.ts --fork bscmainnet → 19 passing (pre-state, event-count assertions, post-state, and a behavioral proof that a user can borrow DAI again and that handleDeviation(vDAI) now reverts TokenMonitoringDisabled). yarn lint/yarn prettier clean on the added files.

Open points (from the approved spec): confirm CF stays 0 vs an explicit CF/LT; snapshot-reset scope (all three included by default); proposal type REGULAR vs FAST_TRACK.


Opened by the Venus dev bot. Review required; the bot cannot merge.

…eset EBrake snapshots

Adds VIP-664 (bscmainnet, REGULAR) and its fork simulation:
- Disable DeviationSentinel monitoring for DAI (setTokenMonitoringEnabled(DAI, false))
- Resume borrowing on vDAI (setActionsPaused([vDAI],[BORROW],false)); CF stays 0
  (pre-incident CF was already 0, so the EBrake CF snapshot is empty — nothing to restore)
- Reset the vDAI EBrake snapshots (resetCFSnapshot/resetBorrowCapSnapshot/resetSupplyCapSnapshot)

No new ACM grants required. Simulation proves borrowing DAI works post-execution and that
handleDeviation(vDAI) now reverts TokenMonitoringDisabled.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

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

VIP-664 LGTM

  • Sim green (19/19, bscmainnet fork).
  • Addresses, signatures/ACM strings verified. No new ACM grants needed. Market state in VDB-24 are also correct.
  • CF stays 0 Pre-incident CF was already 0 and the sentinel only paused borrow, so there's nothing to restore.
  • Three EBrake resets are no-ops fine to keep. vDAI snapshots are already empty, so they only emit events. Leaving them in gives a clean slate and a good reference pattern for future sentinel recovery VIPs.
  • Note is true Stale helper (out of scope). src/DeviationSentinel.ts was for old architecture no more need code is dead
    cc: @trumpgpt-bot

@Debugger022
Debugger022 marked this pull request as ready for review July 13, 2026 08:24

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

LGTM

Comment thread vips/vip-664/bscmainnet.ts
@fred-venus

Copy link
Copy Markdown
Contributor

To be merged with #736

fred-venus added a commit that referenced this pull request Jul 14, 2026
… execution

Fold PR #737 (VDB-24: disable DeviationSentinel monitoring for DAI, resume
vDAI borrowing, reset EBrake snapshots) into the mainnet VIP so both changes
execute in a single proposal.

- vips/vip-999/bscmainnet.ts: commands 1-5 = DAI fix (sentinel disable first,
  unpause BORROW, three EBrake snapshot resets), command 6 = FRV
  setVaultImplementation. No cap restore: EBrake never snapshotted vDAI caps
  (marketStates(vDAI) = (0,0,false,false) on-chain), live caps intact.
- simulations/vip-999/bscmainnet.ts: fork block 109660000 (both pre-states
  verified on-chain: FRV controller on old impl, vDAI BORROW paused, sentinel
  monitoring on, EBrake snapshots empty); merged pre/post suites and event
  expectations; DAI behavioral borrow proof runs after the FRV lifecycle with
  Chainlink-pinned prices. 31 passing on bscmainnet fork.
- ABIs: add Comptroller/DeviationSentinel/EBrake/VToken; ResilientOracle
  replaced by its superset from PR #737.

Testnet VIP and sim unchanged (DAI fix is mainnet-only); 16 passing.

Co-Authored-By: Claude Fable 5 <[email protected]>
@fred-venus fred-venus closed this Jul 14, 2026
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