Closed gtowle03 closed 10 months ago
I'd suggest that you take the parameters from the failing run and hardcode those into the test. It should fail with the same error, which will allow you to log data and poke around to see what causes the issue.
My guess is that the problem is caused because one of the trade sizes is really small, and we could fix the problem by increasing the minimum; however, it could be the opposite problem and we'd need to decrease the maximum trade sizes.
Failure at line 283 on NonstandardDecimals.sol with longBasePaid = 279154570667275 and shortAmount = 0
I just saw this again in CI: https://github.com/delvtech/hyperdrive/actions/runs/6344968653/job/17236114278?pr=593.
I just saw this again in CI: https://github.com/delvtech/hyperdrive/actions/runs/6344968653/job/17236114278?pr=593.
I saw one in my PR that is similar. This is what I tracked down:
Here is another failing test that is interesting:
function test_nonstandard_decimals_lp_edge_cases() external {
uint256 longBasePaid = 2141061247565828640207640148726033314; // 279_000_050.816564
uint256 shortAmount = 0; // 0.100000
_test_nonstandard_decimals_lp(longBasePaid, shortAmount);
}
it's odd that this check in openLong()
if (
_initialSharePrice.mulDown(
_effectiveShareReserves() + shareReservesDelta
) > _marketState.bondReserves - bondReservesDelta
) {
revert IHyperdrive.NegativeInterest();
}
passes, but this check in openShort()
if (shareReservesDelta.mulDown(_sharePrice) > _bondAmount)
revert IHyperdrive.NegativeInterest();
doesn't. The test passes if i:
resolved in #609
https://github.com/delvtech/hyperdrive/actions/runs/5347568272