I noticed that in rebalancing borrowing vaults that only had assets (no debt) the flashloan is not needed. There was a case in where flashloaning zero debt resulted in a "successful" but useless tx that got the Rebalancer locked because it wrote to the entryPoint state but never completed the execution and therefore the Rebalancer is locked from being used again.
The fixes of this PR avoid using flashloan when rebalancing a borrowing vault that only has assets ( or zero debt), and a new function restricted to the timelock is added to unblock the entryPoint variable in case is necessary. The reason why this is restricted to the timelock is to avoid, reentrancies by malicious allowedExecutor users who could figure out ways to by-pass checks of the entryPoint.
I noticed that in rebalancing borrowing vaults that only had assets (no debt) the flashloan is not needed. There was a case in where flashloaning zero debt resulted in a "successful" but useless tx that got the Rebalancer locked because it wrote to the
entryPoint
state but never completed the execution and therefore the Rebalancer is locked from being used again.The fixes of this PR avoid using flashloan when rebalancing a borrowing vault that only has assets ( or zero debt), and a new function restricted to the timelock is added to unblock the
entryPoint
variable in case is necessary. The reason why this is restricted to the timelock is to avoid, reentrancies by maliciousallowedExecutor
users who could figure out ways to by-pass checks of theentryPoint
.Refer to this tx: https://etherscan.io/tx/0x2c593ffbe66ff630794907ce6a5d6f2906bd2e929b69535f9124f2b82e3fffb0