-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for the Sequencer downtime oracle to correctly detect invalid rounds #195
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes enhance the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- src/modules/price-router/permutations/SequencerPriceRouter.sol (5 hunks)
- test/testPriceRouter/SequencerPriceRouter.t.sol (3 hunks)
Additional comments not posted (6)
src/modules/price-router/permutations/SequencerPriceRouter.sol (3)
16-16
: Addition ofSequencerPriceRouter__InvalidRound
error is appropriate.The new error type enhances the contract's robustness by allowing precise error handling for invalid oracle rounds.
31-37
: Constructor formatting changes improve readability.Listing parameters on separate lines enhances clarity and maintainability.
58-60
: Enhancement in_runPreFlightCheck
improves error handling.The check for
startedAt
being zero and reverting withSequencerPriceRouter__InvalidRound
ensures invalid oracle data is handled effectively.test/testPriceRouter/SequencerPriceRouter.t.sol (3)
24-24
: Initialization ofmockStartedAt
to1
is appropriate.This ensures that tests do not inadvertently trigger the invalid round condition unless explicitly set.
48-56
: Test logic for invalid oracle rounds is effective.The test correctly verifies the new error handling logic by expecting a revert with
SequencerPriceRouter__InvalidRound
whenmockAnswer
is0
andmockStartedAt
is0
.
91-91
: Simplification ofstartedAt
assignment improves clarity.Directly using
mockStartedAt
simplifies the logic by removing unnecessary conditional checks.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests