Skip to content

Errors Cleanup#741

Merged
jalextowle merged 12 commits intomainfrom
jalextowle/feature/improved-error-messages
Jan 26, 2024
Merged

Errors Cleanup#741
jalextowle merged 12 commits intomainfrom
jalextowle/feature/improved-error-messages

Conversation

@jalextowle
Copy link
Copy Markdown
Contributor

@jalextowle jalextowle commented Jan 24, 2024

This PR cleans up the IHyperdrive interface in a couple of ways:

  1. Moved the events into IHyperdriveEvents. This allowed us to remove the duplicated events from HyperdriveBase.
  2. Documented the errors in IHyperdrive.
  3. Consolidated the trading errors into a single InsufficientLiquidity error with reasons.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 24, 2024

Hyperdrive Gas Benchmark

Benchmark suite Current: 86ecc61 Previous: 78dee14 Deviation Status
addLiquidity: min 1633 gas 1633 gas 0% 🟰
addLiquidity: avg 67775 gas 65418 gas 3.6030% 🚨
addLiquidity: max 292669 gas 292045 gas 0.2137% 🚨
checkpoint: min 1150 gas 1150 gas 0% 🟰
checkpoint: avg 48585 gas 48538 gas 0.0968% 🚨
checkpoint: max 191094 gas 191003 gas 0.0476% 🚨
closeLong: min 1558 gas 1558 gas 0% 🟰
closeLong: avg 28098 gas 28103 gas -0.0178%
closeLong: max 148196 gas 151196 gas -1.9842%
closeShort: min 1549 gas 1549 gas 0% 🟰
closeShort: avg 29879 gas 29854 gas 0.0837% 🚨
closeShort: max 129340 gas 145678 gas -11.2151%
initialize: min 1582 gas 1582 gas 0% 🟰
initialize: avg 213357 gas 213322 gas 0.0164% 🚨
initialize: max 255137 gas 255137 gas 0% 🟰
openLong: min 1487 gas 1487 gas 0% 🟰
openLong: avg 50613 gas 50410 gas 0.4027% 🚨
openLong: max 184943 gas 184891 gas 0.0281% 🚨
openShort: min 1608 gas 1608 gas 0% 🟰
openShort: avg 49967 gas 50078 gas -0.2217%
openShort: max 180248 gas 180398 gas -0.0831%
redeemWithdrawalShares: min 1575 gas 1575 gas 0% 🟰
redeemWithdrawalShares: avg 20182 gas 19265 gas 4.7599% 🚨
redeemWithdrawalShares: max 108207 gas 57811 gas 87.1737% 🚨
removeLiquidity: min 1639 gas 1639 gas 0% 🟰
removeLiquidity: avg 149717 gas 149669 gas 0.0321% 🚨
removeLiquidity: max 324287 gas 324379 gas -0.0284%

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

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jan 24, 2024

Coverage Status

coverage: 95.224% (-0.3%) from 95.569%
when pulling ccc3f46 on jalextowle/feature/improved-error-messages
into d72077d on main.

@jalextowle jalextowle force-pushed the jalextowle/feature/improved-error-messages branch from f88152a to aee97eb Compare January 25, 2024 05:10
@jalextowle jalextowle changed the title WIP: Errors Cleanup Errors Cleanup Jan 25, 2024
@jalextowle jalextowle force-pushed the jalextowle/feature/improved-error-messages branch from 05f5f53 to 056ad7a Compare January 25, 2024 05:25
Comment thread contracts/src/internal/HyperdriveAdmin.sol
Comment thread contracts/src/internal/HyperdriveShort.sol Outdated
Comment thread contracts/src/token/ForwarderFactory.sol
Comment thread contracts/src/token/ForwarderFactory.sol
Comment thread test/units/libraries/HyperdriveMath.t.sol
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.

Im going to approve but it looks like the main reason coverage dropped bc of HyperdriveShort:

image

and YieldSpaceMath

image

@jalextowle jalextowle enabled auto-merge (squash) January 26, 2024 01:27
@jalextowle jalextowle merged commit f780809 into main Jan 26, 2024
@jalextowle jalextowle deleted the jalextowle/feature/improved-error-messages branch January 26, 2024 04:20
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.

3 participants