Skip to content

fuzz roundtrip tests and reasonable initial fixed rate and timestretch#738

Merged
jrhea merged 6 commits intomainfrom
test-fix
Jan 26, 2024
Merged

fuzz roundtrip tests and reasonable initial fixed rate and timestretch#738
jrhea merged 6 commits intomainfrom
test-fix

Conversation

@jrhea
Copy link
Copy Markdown
Contributor

@jrhea jrhea commented Jan 23, 2024

  • Added fuzzing to roundtrip tests
  • Establish sane bounds for initial fixed rate and time stretch. tl;dr is:
initialFixedRate = [ 0.1%, 50% ]

lower = max(initialFixedRate/2, 0.5%)
upper = 2 x max(lower, initialFixedRate) 
initialTimeStretchFixedRate = [ lower, upper ]

@jrhea jrhea requested a review from jalextowle January 23, 2024 19:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 23, 2024

Hyperdrive Gas Benchmark

Benchmark suite Current: 37dea61 Previous: 78dee14 Deviation Status
addLiquidity: min 1633 gas 1633 gas 0% 🟰
addLiquidity: avg 67489 gas 65418 gas 3.1658% 🚨
addLiquidity: max 292045 gas 292045 gas 0% 🟰
checkpoint: min 1150 gas 1150 gas 0% 🟰
checkpoint: avg 48569 gas 48538 gas 0.0639% 🚨
checkpoint: max 191003 gas 191003 gas 0% 🟰
closeLong: min 1558 gas 1558 gas 0% 🟰
closeLong: avg 28063 gas 28103 gas -0.1423%
closeLong: max 149207 gas 151196 gas -1.3155%
closeShort: min 1549 gas 1549 gas 0% 🟰
closeShort: avg 29847 gas 29854 gas -0.0234%
closeShort: max 125618 gas 145678 gas -13.7701%
initialize: min 1582 gas 1582 gas 0% 🟰
initialize: avg 213296 gas 213322 gas -0.0122%
initialize: max 255137 gas 255137 gas 0% 🟰
openLong: min 1487 gas 1487 gas 0% 🟰
openLong: avg 50501 gas 50410 gas 0.1805% 🚨
openLong: max 184891 gas 184891 gas 0% 🟰
openShort: min 1608 gas 1608 gas 0% 🟰
openShort: avg 50084 gas 50078 gas 0.0120% 🚨
openShort: max 180398 gas 180398 gas 0% 🟰
redeemWithdrawalShares: min 1575 gas 1575 gas 0% 🟰
redeemWithdrawalShares: avg 20189 gas 19265 gas 4.7963% 🚨
redeemWithdrawalShares: max 57811 gas 57811 gas 0% 🟰
removeLiquidity: min 1639 gas 1639 gas 0% 🟰
removeLiquidity: avg 148272 gas 149669 gas -0.9334%
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 23, 2024

Coverage Status

coverage: 95.552%. remained the same
when pulling 233755e on test-fix
into 78dee14 on main.

Comment thread test/integrations/hyperdrive/RoundTripTest.t.sol Outdated
Comment thread test/integrations/hyperdrive/RoundTripTest.t.sol Outdated
Comment thread test/integrations/hyperdrive/RoundTripTest.t.sol Outdated
Comment thread test/integrations/hyperdrive/RoundTripTest.t.sol
Comment thread test/integrations/hyperdrive/RoundTripTest.t.sol Outdated
Comment thread test/integrations/hyperdrive/RoundTripTest.t.sol Outdated
Comment thread test/integrations/hyperdrive/RoundTripTest.t.sol Outdated
Copy link
Copy Markdown
Contributor

@jalextowle jalextowle left a comment

Choose a reason for hiding this comment

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

LGTM, just a few nits.

@jrhea jrhea changed the title fuzz roundtrip tests fuzz roundtrip tests and reasonable initial fixed rate and timestretch Jan 25, 2024
@jrhea jrhea requested a review from jalextowle January 25, 2024 19:59
@jrhea jrhea enabled auto-merge (squash) January 25, 2024 20:23
@jrhea jrhea merged commit 0c95d39 into main Jan 26, 2024
@jrhea jrhea deleted the test-fix branch January 26, 2024 02:44
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