-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: disable reward functionalities #134
Conversation
Warning Rate limit exceeded@adu-web3 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 38 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested Reviewers
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ The Solhint workflow has completed successfully. Check the workflow run for details. (0da4a12) |
✅ The Forge CI workflow has completed successfully. Check the workflow run for details. (0da4a12) |
✅ The Slither Analysis workflow has completed successfully. Check the workflow run for details. (0da4a12) |
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
🧹 Nitpick comments (2)
src/core/BaseRestakingController.sol (2)
86-88
: **Unused parameters in disabled function **Since this function reverts immediately, the parameters (
token
,avs
,amount
) are not used. Consider removing or marking them (e.g., prefixing with_
) if you want to silence lint warnings.-function submitReward(address token, address avs, uint256 amount) external payable { +function submitReward(address /*token*/, address /*avs*/, uint256 /*amount*/) external payable { revert Errors.NotYetSupported(); }🧰 Tools
🪛 GitHub Check: lint
[failure] 87-87:
Variable "token" is unused
[failure] 87-87:
Variable "avs" is unused
[failure] 87-87:
Variable "amount" is unused
92-94
: **Recommendation: keep minimal tests for revert logic **You're disabling reward functionalities by reverting. While removing full test coverage might be intentional, consider retaining a minimal unit test ensuring the function reverts as expected. This helps protect against accidental re-enablement of partial logic without updating tests.
Do you want me to open an issue to track adding minimal revert tests?
🧰 Tools
🪛 GitHub Check: lint
[failure] 93-93:
Variable "token" is unused
[failure] 93-93:
Variable "amount" is unused
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/core/BaseRestakingController.sol
(2 hunks)test/foundry/WithdrawReward.t.sol
(0 hunks)
💤 Files with no reviewable changes (1)
- test/foundry/WithdrawReward.t.sol
🧰 Additional context used
📓 Learnings (1)
src/core/BaseRestakingController.sol (1)
Learnt from: adu-web3
PR: ExocoreNetwork/exocore-contracts#102
File: src/core/BaseRestakingController.sol:102-113
Timestamp: 2024-11-12T10:03:05.536Z
Learning: In the `claimRewardFromExocore` function in `src/core/BaseRestakingController.sol`, reward tokens are intended to be permission-free and should not be checked against a whitelist.
🪛 GitHub Check: lint
src/core/BaseRestakingController.sol
[failure] 87-87:
Variable "token" is unused
[failure] 87-87:
Variable "avs" is unused
[failure] 87-87:
Variable "amount" is unused
[failure] 93-93:
Variable "token" is unused
[failure] 93-93:
Variable "amount" is unused
[failure] 99-99:
Variable "token" is unused
[failure] 99-99:
Variable "recipient" is unused
[failure] 99-99:
Variable "amount" is unused
🔇 Additional comments (2)
src/core/BaseRestakingController.sol (2)
7-8
: **Import for Errors library **
Good addition of the Errors
library import. This aligns with the code style of reverting using custom errors in place of revert messages.
98-100
: **Reward withdrawal fully disabled **
Everything correctly aligns with the objective of disabling reward functionality. The function reverts and indicates that reward handling remains unsupported. The same note about unused parameters applies here.
🧰 Tools
🪛 GitHub Check: lint
[failure] 99-99:
Variable "token" is unused
[failure] 99-99:
Variable "recipient" is unused
[failure] 99-99:
Variable "amount" is unused
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
🧹 Nitpick comments (2)
src/core/BaseRestakingController.sol (2)
92-94
: Remove unnecessary payable modifierSimilar to submitReward, the
payable
modifier is unnecessary since the function always reverts.- function claimRewardFromExocore(address, uint256) external payable { + function claimRewardFromExocore(address, uint256) external { revert Errors.NotYetSupported(); }
86-100
: Consider using a more explicit approach for disabled featuresWhile the current implementation effectively disables the reward functionality, consider these architectural improvements:
- Add an explicit error message indicating when these features will be supported
- Consider using a feature flag pattern that would make re-enabling these features easier in the future
- Document the rationale for disabling these features in the contract's documentation
This would provide better clarity for users and make future maintenance easier.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/core/BaseRestakingController.sol
(2 hunks)
🧰 Additional context used
📓 Learnings (1)
src/core/BaseRestakingController.sol (2)
Learnt from: adu-web3
PR: ExocoreNetwork/exocore-contracts#102
File: src/core/BaseRestakingController.sol:102-113
Timestamp: 2024-11-12T10:03:05.536Z
Learning: In the `claimRewardFromExocore` function in `src/core/BaseRestakingController.sol`, reward tokens are intended to be permission-free and should not be checked against a whitelist.
Learnt from: adu-web3
PR: ExocoreNetwork/exocore-contracts#102
File: src/core/BaseRestakingController.sol:83-99
Timestamp: 2024-11-12T10:03:05.536Z
Learning: In the `submitReward` function in `src/core/BaseRestakingController.sol`, reward tokens are intended to be permission-free and should not be checked against a whitelist.
🔇 Additional comments (3)
src/core/BaseRestakingController.sol (3)
8-8
: LGTM: Import statement correctly added
The Errors library import is appropriately placed and necessary for the NotYetSupported error usage.
98-100
: LGTM: Function correctly disabled
The implementation and modifiers are appropriate. Since the test file WithdrawReward.t.sol
was removed, let's verify no other test files are referencing these reward functions.
✅ Verification successful
Reward functions correctly disabled and tested
The remaining test reference in Bootstrap.t.sol
is actually verifying the expected revert behavior with vm.expectRevert(abi.encodeWithSignature("NotYetSupported()"))
, which aligns perfectly with the current implementation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining test files that might be referencing the disabled reward functions
rg -g "*.t.sol" -e "submitReward|claimRewardFromExocore|withdrawReward"
Length of output: 166
Script:
#!/bin/bash
# Let's check the context of the remaining reference to understand if it's a test expecting the revert
rg -g "*.t.sol" -C 5 "claimRewardFromExocore"
Length of output: 812
86-88
: Consider removing unnecessary payable modifier
Since the function always reverts, the payable
modifier serves no purpose and could be removed. Additionally, let's verify this change doesn't break existing integrations.
✅ The Compare Storage Layouts workflow has completed successfully. Check the workflow run for details. (0da4a12) |
Description
Given we have disabled the methods of reward precompiles for exocore, we should also disable reward related functionalities to avoid being blocked for the failure
submitReward
and other functionsSummary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores