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

Caches the result of `_effectiveShareReserves()` in more places #1060

Closed jalextowle closed 2 weeks ago

jalextowle commented 2 weeks ago

Resolved Issues

Fixes: https://github.com/spearbit-audits/delv-week-review/issues/4.

Description

Caches the result of _effectiveShareReserves() in HyperdriveLong and HyperdriveShort.

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 2 weeks ago

Pull Request Test Coverage Report for Build 9555412891

Details


Totals Coverage Status
Change from base Build 9555235961: 0.07%
Covered Lines: 1971
Relevant Lines: 2138

💛 - Coveralls
github-actions[bot] commented 2 weeks ago

Hyperdrive Gas Benchmark

Benchmark suite Current: a2fa5c315e20f960dde3929f2f47e284e1897c6c Previous: e5525e96fea5bc61e0eec7fe694049aa6722aa1c Deviation Status
addLiquidity: min 33937 gas 33937 gas 0% 🟰
addLiquidity: avg 155778 gas 155877 gas -0.0635%
addLiquidity: max 429527 gas 429437 gas 0.0210% 🚨
checkpoint: min 40316 gas 40316 gas 0% 🟰
checkpoint: avg 144732 gas 144636 gas 0.0664% 🚨
checkpoint: max 255931 gas 255830 gas 0.0395% 🚨
closeLong: min 31361 gas 31361 gas 0% 🟰
closeLong: avg 136015 gas 136439 gas -0.3108%
closeLong: max 2539376 gas 2621435 gas -3.1303%
closeShort: min 31327 gas 31327 gas 0% 🟰
closeShort: avg 131311 gas 132305 gas -0.7513%
closeShort: max 271393 gas 272530 gas -0.4172%
initialize: min 31349 gas 31349 gas 0% 🟰
initialize: avg 333414 gas 333352 gas 0.0186% 🚨
initialize: max 400023 gas 399922 gas 0.0253% 🚨
openLong: min 33370 gas 33370 gas 0% 🟰
openLong: avg 173387 gas 174248 gas -0.4941%
openLong: max 334107 gas 335241 gas -0.3383%
openShort: min 33936 gas 33936 gas 0% 🟰
openShort: avg 168248 gas 168925 gas -0.4008%
openShort: max 415271 gas 415870 gas -0.1440%
redeemWithdrawalShares: min 31251 gas 31251 gas 0% 🟰
redeemWithdrawalShares: avg 75323 gas 75830 gas -0.6686%
redeemWithdrawalShares: max 305734 gas 305633 gas 0.0330% 🚨
removeLiquidity: min 31301 gas 31301 gas 0% 🟰
removeLiquidity: avg 215161 gas 214933 gas 0.1061% 🚨
removeLiquidity: max 404194 gas 404194 gas 0% 🟰

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