The lending pool's deposit and withdraw process currently performs two sequential reserve state updates, leading inefficient execution.
The updateInterest function was called twice before the deposit and withdraw flow was executed in LendingPool.sol.
First call through deposit and withdraw function in LendingPool.sol:
which internally calls updateReserveInterests
Second call through (Inside ReserveLibrary.deposit and ReserveLibrary.withdraw)
which also calls updateReserveInterests at the beginning of both functions
This is redundant since updateReserveInterests has a check at the beginning:
The second call will always return early because the timeDelta will be less than 1 second from the first call. However, this is still inefficient as it creates an unnecessary function call.
The redundant state update pattern results in several consequences:
Gas Inefficiency: Every deposit transaction incurs unnecessary gas cost.
Code Maintainability: The presence of two state updates creates ambiguity about where the actual state modification should occur, making the codebase harder to maintain.
Manual
Remove the initial updateReserveState call from LendingPool.deposit() and LendingPool.withdraw() .
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.