-
Notifications
You must be signed in to change notification settings - Fork 381
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
Stable Pool: ongoing reentrancy protection #2331
base: master
Are you sure you want to change the base?
Conversation
This was the patch change: #2206 |
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.
First pass done.
Besides the inline comment,
- don't we also need to protect
updateTokenRateCache
inComposableStablePoolRates
? - what about
disableRecoveryMode
? It already has access to the vault, but I don't see the protection applied in this branch either. EDIT: it's added in Weighted Pool: ongoing reentrancy protection #2330
@@ -141,6 +142,8 @@ abstract contract ComposableStablePoolRates is IComposableStablePoolRates, Compo | |||
|
|||
/// @inheritdoc IComposableStablePoolRates | |||
function setTokenRateCacheDuration(IERC20 token, uint256 duration) external override authenticate { | |||
VaultReentrancyLib.ensureNotInVaultContext(_getVault()); |
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.
Why not define a modifier and use it here, like we did for the patch?
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.
This needs a test
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.
Yes; didn't want to potentially conflict. |
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.
Patch looks good; all the functions that should be protected and documented are covered with this.
I've just left one super minor comment regarding a comment.
About the tests: we could include them in the fork tests as we did with the patches instead of doing unit tests. I don't have a strong opinion regarding what's the best way forward. WDYT @nventuro ?
Description
ComposableStablePool (version 3) was patched for reentrancy; this applies the same (generalized) protections so that any future deployments are safe.
Type of change
Checklist:
master
, or there's a description of how to mergeIssue Resolution