Closed sherlock-admin3 closed 1 week ago
Escalate
Can I get more context on why this was invalidated? It's not just relating to network liveness.
Escalate
Can I get more context on why this was invalidated? It's not just relating to network liveness.
You've created a valid escalation!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
0xbranded
Medium
Use of block.number to represent passage of time
Summary
The use of block.number will result in inaccurate or inconsistent fee calculations, since block times are not fixed.
Vulnerability Detail
block.number is used to calculate the passage of time since the last fee update in
fees.vy
.However, there have been numerous instances of inconsistent block times, in which case block number would not be representative of the passage of time.
Given that the protocol will be deployed on a new chain, the risk of inconsistent block times is exacerbated, as has been observed with Canto, Solana, and Starknet, in which cases block production was halted entirely. Additionally, the BOB chain's development roadmap introduces possible future changes (or volatility) in block time, especially in transition periods where the settlement layer is changed.
While the admin can change fee parameters in response to changing blocktimes on the BOB chain, this approach will not mitigate volatility in blocktimes, nor halts in block generation.
Impact
When blocktimes speed up, users will overpay fees, while if blocktimes slow down, underpayments of fees will occur. Fee payments will generally be inconsistent, and trust in the system will be eroded. In the event of a halt in block production, no funding (or borrowing) payments will be made during that time, allowing some positions to remain unliquidated for a longer period of time and depriving positions / lps of any fees.
Code Snippet
Tool used
Manual Review
Recommendation
Consider changing fee calculations to use timestamps instead of block numbers, given the predictability of block.timestamp, as it also does not compromise the security of the system.