Skip to content

Fixed an unsafe case in update liquidity#551

Merged
jalextowle merged 3 commits intomainfrom
jalextowle/bug/unsafe-cast-update-liquidity
Aug 12, 2023
Merged

Fixed an unsafe case in update liquidity#551
jalextowle merged 3 commits intomainfrom
jalextowle/bug/unsafe-cast-update-liquidity

Conversation

@jalextowle
Copy link
Copy Markdown
Contributor

Fixes: #550.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 11, 2023

Hyperdrive Gas Benchmark

Benchmark suite Current: bfdec2e Previous: b63be36 Deviation Status
addLiquidity: min 807 gas 785 gas 2.8025% 🚨
addLiquidity: avg 43878 gas 43434 gas 1.0222% 🚨
addLiquidity: max 80546 gas 80573 gas -0.0335%
checkpoint: min 514 gas 514 gas 0% 🟰
checkpoint: avg 23181 gas 22776 gas 1.7782% 🚨
checkpoint: max 34040 gas 32767 gas 3.8850% 🚨
closeLong: min 852 gas 852 gas 0% 🟰
closeLong: avg 45870 gas 45661 gas 0.4577% 🚨
closeLong: max 85951 gas 85364 gas 0.6876% 🚨
closeShort: min 809 gas 809 gas 0% 🟰
closeShort: avg 42266 gas 40623 gas 4.0445% 🚨
closeShort: max 87386 gas 86896 gas 0.5639% 🚨
initialize: min 714 gas 714 gas 0% 🟰
initialize: avg 159447 gas 159390 gas 0.0358% 🚨
initialize: max 233486 gas 233486 gas 0% 🟰
openLong: min 740 gas 740 gas 0% 🟰
openLong: avg 112412 gas 112220 gas 0.1711% 🚨
openLong: max 179317 gas 179317 gas 0% 🟰
openShort: min 804 gas 782 gas 2.8133% 🚨
openShort: avg 152236 gas 151781 gas 0.2998% 🚨
openShort: max 219084 gas 218825 gas 0.1184% 🚨
removeLiquidity: min 784 gas 762 gas 2.8871% 🚨
removeLiquidity: avg 57194 gas 57136 gas 0.1015% 🚨
removeLiquidity: max 119628 gas 118973 gas 0.5505% 🚨

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

Copy link
Copy Markdown
Contributor

@jrhea jrhea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments to consider, but overall lgtm

Comment thread test/units/hyperdrive/UpdateLiquidityTest.t.sol
Comment thread test/units/hyperdrive/UpdateLiquidityTest.t.sol Outdated
@jalextowle jalextowle enabled auto-merge (squash) August 12, 2023 02:39
@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 98.524% (+2.7%) from 95.818% when pulling bfdec2e on jalextowle/bug/unsafe-cast-update-liquidity into 640acc1 on main.

@jalextowle jalextowle merged commit 91163bc into main Aug 12, 2023
@jalextowle jalextowle deleted the jalextowle/bug/unsafe-cast-update-liquidity branch August 12, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unsafe cast in updateLiquidity()

3 participants