Repository navigation
Only update tradingDelayBypassed when the basket switches - #1314
Merged
Merged
Conversation
refreshBasket() set tradingDelayBypassed even when no valid basket was found. A failed switch leaves the basket disabled, so the stale flag had no effect, but it no longer described the current basket. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
akshatmittal
approved these changes
Nov 30, 2026
akshatmittal
approved these changes
Nov 30, 2026
akshatmittal
approved these changes
Dec 1, 2026
tbrent
added a commit
that referenced
this pull request
Dec 1, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
tbrent
added a commit
that referenced
this pull request
Dec 1, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Summary
BasketHandler.refreshBasket()now updatestradingDelayBypassedonly when the basket actually switches.Stacked on #1313.
Why
Trust audit finding "tradingDelayBypassed is updated when basket switch fails" (QA).
refreshBasket()set the flag before calling_switchBasket(), so it changed even when no valid basket was found. That had no effect on trading: a failed switch leaves the basket disabled, and the only way out of disabled is anotherrefreshBasket(), which writes the flag again. But the flag is documented as describing the current basket, and after a failed switch it described a basket that was never set.Changes
contracts/p1/BasketHandler.sol,contracts/p0/BasketHandler.sol: set the flag after_switchBasket(), and only if the basket is not disabled.test/Recollateralization.test.ts: new test covering a failed permissionless refresh (flag staystrue) and a failed governance refresh (flag staysfalse).No storage layout change.
Verification
expected false to equal true).tradingDelaytests intest/Recollateralization.test.tspass on P0 and P1.🤖 Generated with Claude Code