-
Notifications
You must be signed in to change notification settings - Fork 19
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
Review of superseded feature #2315
Review of superseded feature #2315
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces several modifications to the Changes
Possibly related PRs
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
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.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
contracts/v0.2/src/SubmissionProxy.sol (2)
436-470
: Refactor to reduce code duplication betweensubmitStrictSingle
andupdatePrice
The
submitStrictSingle
function shares significant logic withupdatePrice
. Consider refactoring common code into a private helper function to improve maintainability and reduce duplication.
Line range hint
509-539
: Redundant supersession check inupdatePrice
functionThe check at lines 538-540:
if (lastSubmissionTimes[_feedHash] >= _timestamp) { return; }is redundant since the same condition is already evaluated at lines 510-512. Removing this redundant code will streamline the function and improve efficiency.
Apply this diff to remove the redundant code:
revert InvalidProof(); } - if (lastSubmissionTimes[_feedHash] >= _timestamp) { - return; - } feeds[_feedHash].submit(_answer); lastSubmissionTimes[_feedHash] = _timestamp;
🛑 Comments failed to post (1)
contracts/v0.2/src/SubmissionProxy.sol (1)
436-470: 🛠️ Refactor suggestion
Ensure reentrancy safety when calling external contracts
The call to
feeds[_feedHash].submit(_answer);
involves interacting with external contracts. Consider implementing reentrancy guards to protect against potential reentrancy attacks, especially if thesubmit
function in theFeed
contracts is not controlled.
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.
LGTM!
* feat: update contract * fix: update based on feedback * fix: separated error cases * fix: add function based on feedback * fix: update based on feedback * Review of superseded feature (#2315) * chore: superseeded review * fix: fix test --------- Co-authored-by: nick <[email protected]> * fix: remove unnecessary * fix: rename, update test * fix: update visibility * fix: fix typo * fix: typo --------- Co-authored-by: Martin Kersner <[email protected]>
Description
Review for #2314