delvtech / hyperdrive

An automated market maker for fixed and variable yield with on-demand terms.
Apache License 2.0
25 stars 3 forks source link

Fixed an infinite loop in the checkpoint flow #1051

Closed jalextowle closed 1 month ago

jalextowle commented 1 month ago

Description

This PR fixes an infinite loop that could occur in the checkpoint flow when checkpointing a past checkpoint when the latest checkpoint hadn't been minted. This could have prevented matured positions from a previous checkpoint from being closed (but this could have been recovered by minting the latest checkpoint).

Review Checklists

Please check each item before approving the pull request. While going through the checklist, it is recommended to leave comments on items that are referenced in the checklist to make sure that they are reviewed. If there are multiple reviewers, copy the checklists into sections titled ## [Reviewer Name]. If the PR doesn't touch Solidity, the corresponding checklist can be removed.

[[Reviewer Name]]

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 9411609911

Details


Files with Coverage Reduction New Missed Lines %
contracts/src/libraries/LPMath.sol 3 83.14%
<!-- Total: 3 -->
Totals Coverage Status
Change from base Build 9408759390: -0.1%
Covered Lines: 1906
Relevant Lines: 2053

💛 - Coveralls
coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 9411628284

Details


Files with Coverage Reduction New Missed Lines %
contracts/src/libraries/LPMath.sol 3 83.14%
<!-- Total: 3 -->
Totals Coverage Status
Change from base Build 9408759390: -0.1%
Covered Lines: 1906
Relevant Lines: 2053

💛 - Coveralls
github-actions[bot] commented 1 month ago

Hyperdrive Gas Benchmark

Benchmark suite Current: dd5a0d49b6f8286e67a6e1de5df47de2fc8fcb38 Previous: aed776f039568e486a7066b9cfbf39f373bdbb42 Deviation Status
addLiquidity: min 33827 gas 33827 gas 0% 🟰
addLiquidity: avg 155666 gas 155854 gas -0.1206%
addLiquidity: max 429092 gas 429092 gas 0% 🟰
checkpoint: min 40292 gas 40292 gas 0% 🟰
checkpoint: avg 142306 gas 142352 gas -0.0323%
checkpoint: max 253424 gas 253424 gas 0% 🟰
closeLong: min 31361 gas 31361 gas 0% 🟰
closeLong: avg 136085 gas 136073 gas 0.0088% 🚨
closeLong: max 2621386 gas 2625796 gas -0.1679%
closeShort: min 31349 gas 31349 gas 0% 🟰
closeShort: avg 132027 gas 132134 gas -0.0810%
closeShort: max 263302 gas 263302 gas 0% 🟰
initialize: min 31371 gas 31371 gas 0% 🟰
initialize: avg 331026 gas 330923 gas 0.0311% 🚨
initialize: max 397010 gas 397010 gas 0% 🟰
openLong: min 33370 gas 33370 gas 0% 🟰
openLong: avg 173713 gas 174111 gas -0.2286%
openLong: max 306958 gas 306958 gas 0% 🟰
openShort: min 33936 gas 33936 gas 0% 🟰
openShort: avg 168618 gas 168488 gas 0.0772% 🚨
openShort: max 415830 gas 415910 gas -0.0192%
redeemWithdrawalShares: min 31251 gas 31251 gas 0% 🟰
redeemWithdrawalShares: avg 74925 gas 74759 gas 0.2220% 🚨
redeemWithdrawalShares: max 210204 gas 210204 gas 0% 🟰
removeLiquidity: min 31301 gas 31301 gas 0% 🟰
removeLiquidity: avg 214978 gas 214403 gas 0.2682% 🚨
removeLiquidity: max 403959 gas 403959 gas 0% 🟰

This comment was automatically generated by workflow using github-action-benchmark.