diff --git a/.gas-snapshot b/.gas-snapshot index 7ce7848..712c3c7 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,77 +1,78 @@ -QueryProcessorTest:testFindNearestSample_CanFindExactValue(uint32,uint256,uint256,uint256) (runs: 256, μ: 72021263, ~: 80647386) -QueryProcessorTest:testFindNearestSample_CanFindIntermediateValue(uint32,uint256,uint256,uint256) (runs: 256, μ: 70481909, ~: 79354051) +QueryProcessorTest:testFindNearestSample_CanFindExactValue(uint32,uint256,uint256,uint256) (runs: 256, μ: 69293044, ~: 77954902) +QueryProcessorTest:testFindNearestSample_CanFindIntermediateValue(uint32,uint256,uint256,uint256) (runs: 256, μ: 68012389, ~: 77774179) QueryProcessorTest:testFindNearestSample_NotInitialized() (gas: 1056944146) -QueryProcessorTest:testFindNearestSample_OneSample(uint256) (runs: 256, μ: 81215, ~: 81248) -QueryProcessorTest:testGetInstantValue() (gas: 126314) +QueryProcessorTest:testFindNearestSample_OneSample(uint256) (runs: 256, μ: 80623, ~: 80652) +QueryProcessorTest:testGetInstantValue() (gas: 124418) QueryProcessorTest:testGetInstantValue_NotInitialized(uint256) (runs: 256, μ: 19400, ~: 19400) -QueryProcessorTest:testGetInstantValue_NotInitialized_BeyondBufferSize(uint8,uint16) (runs: 256, μ: 70425209, ~: 70425126) -QueryProcessorTest:testGetPastAccumulator_BufferEmpty(uint8) (runs: 256, μ: 26922, ~: 26984) -QueryProcessorTest:testGetPastAccumulator_ExactMatch(uint32,uint256,uint256,uint16) (runs: 256, μ: 74540972, ~: 82895341) -QueryProcessorTest:testGetPastAccumulator_ExactMatch_LatestAccumulator(uint32,uint256,uint256) (runs: 256, μ: 70097476, ~: 77901320) -QueryProcessorTest:testGetPastAccumulator_ExactMatch_OldestAccumulator(uint32,uint256,uint256) (runs: 256, μ: 70127426, ~: 77933087) -QueryProcessorTest:testGetPastAccumulator_ExtrapolatesBeyondLatest(uint32,uint256,uint256,uint256) (runs: 256, μ: 70455556, ~: 79325066) -QueryProcessorTest:testGetPastAccumulator_InterpolatesBetweenPastAccumulators(uint32,uint256,uint256,uint256) (runs: 256, μ: 70489752, ~: 79360343) -QueryProcessorTest:testGetPastAccumulator_InvalidAgo(uint32,uint256,uint256,uint256) (runs: 256, μ: 70447172, ~: 79317439) -QueryProcessorTest:testGetPastAccumulator_QueryTooOld(uint32,uint256,uint256,uint256) (runs: 256, μ: 70458583, ~: 79327014) -QueryProcessorTest:testGetTimeWeightedAverage(uint32,uint256,uint256,uint256,uint256) (runs: 256, μ: 110178296, ~: 122265976) +QueryProcessorTest:testGetInstantValue_NotInitialized_BeyondBufferSize(uint8,uint16) (runs: 256, μ: 69204583, ~: 69204518) +QueryProcessorTest:testGetPastAccumulator_BufferEmpty(uint8) (runs: 256, μ: 26911, ~: 26984) +QueryProcessorTest:testGetPastAccumulator_ExactMatch(uint32,uint256,uint256,uint16) (runs: 256, μ: 72113529, ~: 81319251) +QueryProcessorTest:testGetPastAccumulator_ExactMatch_LatestAccumulator(uint32,uint256,uint256) (runs: 256, μ: 69463960, ~: 78425849) +QueryProcessorTest:testGetPastAccumulator_ExactMatch_OldestAccumulator(uint32,uint256,uint256) (runs: 256, μ: 69493894, ~: 78457616) +QueryProcessorTest:testGetPastAccumulator_ExtrapolatesBeyondLatest(uint32,uint256,uint256,uint256) (runs: 256, μ: 67986036, ~: 77745180) +QueryProcessorTest:testGetPastAccumulator_InterpolatesBetweenPastAccumulators(uint32,uint256,uint256,uint256) (runs: 256, μ: 68020346, ~: 77780471) +QueryProcessorTest:testGetPastAccumulator_InvalidAgo(uint32,uint256,uint256,uint256) (runs: 256, μ: 67977605, ~: 77737553) +QueryProcessorTest:testGetPastAccumulator_QueryTooOld(uint32,uint256,uint256,uint256) (runs: 256, μ: 67989141, ~: 77747128) +QueryProcessorTest:testGetTimeWeightedAverage(uint32,uint256,uint256,uint256,uint256) (runs: 256, μ: 103407330, ~: 109858182) QueryProcessorTest:testGetTimeWeightedAverage_BadSecs() (gas: 10981) -ReservoirPriceOracleTest:testClearRoute() (gas: 52484) -ReservoirPriceOracleTest:testClearRoute_AllWordsCleared() (gas: 160641) -ReservoirPriceOracleTest:testDesignatePair() (gas: 29056) -ReservoirPriceOracleTest:testDesignatePair_IncorrectPair() (gas: 21126) -ReservoirPriceOracleTest:testDesignatePair_NotOwner() (gas: 17519) -ReservoirPriceOracleTest:testDesignatePair_TokenOrderReversed() (gas: 30628) -ReservoirPriceOracleTest:testGetQuote(uint256,uint256) (runs: 256, μ: 34025, ~: 34149) -ReservoirPriceOracleTest:testGetQuote_AmountInTooLarge() (gas: 12940) -ReservoirPriceOracleTest:testGetQuote_BaseIsVault(uint256) (runs: 256, μ: 401367, ~: 401124) -ReservoirPriceOracleTest:testGetQuote_ComplicatedDecimals() (gas: 10388171) -ReservoirPriceOracleTest:testGetQuote_ERC4626AssetFails() (gas: 21476) -ReservoirPriceOracleTest:testGetQuote_Inverse(uint256,uint256) (runs: 256, μ: 36148, ~: 36211) -ReservoirPriceOracleTest:testGetQuote_MultipleHops() (gas: 112270) -ReservoirPriceOracleTest:testGetQuote_MultipleHops_Inverse() (gas: 112544) -ReservoirPriceOracleTest:testGetQuote_MultipleHops_PriceZero() (gas: 122874) -ReservoirPriceOracleTest:testGetQuote_NoFallbackOracle() (gas: 20799) -ReservoirPriceOracleTest:testGetQuote_PriceZero() (gas: 15930) -ReservoirPriceOracleTest:testGetQuote_RandomizeAllParam_1HopRoute(uint256,uint256,address,address,uint8,uint8) (runs: 256, μ: 5331593, ~: 5331557) -ReservoirPriceOracleTest:testGetQuote_RandomizeAllParam_2HopRoute(uint256,uint256,uint256,address,address,address,uint8,uint8,uint8) (runs: 256, μ: 10530244, ~: 10530277) -ReservoirPriceOracleTest:testGetQuote_SameBaseQuote(uint256,address) (runs: 256, μ: 8994, ~: 8994) -ReservoirPriceOracleTest:testGetQuote_UseFallback() (gas: 38334) -ReservoirPriceOracleTest:testGetQuote_ZeroIn() (gas: 36979) -ReservoirPriceOracleTest:testGetQuotes(uint256,uint256) (runs: 256, μ: 26203, ~: 26327) +ReservoirPriceOracleTest:testClearRoute() (gas: 52209) +ReservoirPriceOracleTest:testClearRoute_AllWordsCleared() (gas: 159642) +ReservoirPriceOracleTest:testDesignatePair() (gas: 29089) +ReservoirPriceOracleTest:testDesignatePair_IncorrectPair() (gas: 21129) +ReservoirPriceOracleTest:testDesignatePair_NotOwner() (gas: 17515) +ReservoirPriceOracleTest:testDesignatePair_TokenOrderReversed() (gas: 30670) +ReservoirPriceOracleTest:testGetQuote(uint256,uint256) (runs: 256, μ: 33680, ~: 33783) +ReservoirPriceOracleTest:testGetQuote_AmountInTooLarge() (gas: 13019) +ReservoirPriceOracleTest:testGetQuote_BaseIsVault(uint256) (runs: 256, μ: 401362, ~: 401124) +ReservoirPriceOracleTest:testGetQuote_ComplicatedDecimals() (gas: 10361941) +ReservoirPriceOracleTest:testGetQuote_ERC4626AssetFails() (gas: 21434) +ReservoirPriceOracleTest:testGetQuote_Inverse(uint256,uint256) (runs: 256, μ: 35858, ~: 36022) +ReservoirPriceOracleTest:testGetQuote_MultipleHops() (gas: 111597) +ReservoirPriceOracleTest:testGetQuote_MultipleHops_Inverse() (gas: 111891) +ReservoirPriceOracleTest:testGetQuote_MultipleHops_PriceZero() (gas: 122213) +ReservoirPriceOracleTest:testGetQuote_NoFallbackOracle() (gas: 20830) +ReservoirPriceOracleTest:testGetQuote_PriceZero() (gas: 15942) +ReservoirPriceOracleTest:testGetQuote_RandomizeAllParam_1HopRoute(uint256,uint256,address,address,uint8,uint8) (runs: 256, μ: 5316105, ~: 5316096) +ReservoirPriceOracleTest:testGetQuote_RandomizeAllParam_2HopRoute(uint256,uint256,uint256,address,address,address,uint8,uint8,uint8) (runs: 256, μ: 10503666, ~: 10503746) +ReservoirPriceOracleTest:testGetQuote_SameBaseQuote(uint256,address) (runs: 256, μ: 8972, ~: 8972) +ReservoirPriceOracleTest:testGetQuote_UseFallback() (gas: 38232) +ReservoirPriceOracleTest:testGetQuote_ZeroIn() (gas: 36638) +ReservoirPriceOracleTest:testGetQuotes(uint256,uint256) (runs: 256, μ: 26236, ~: 26339) ReservoirPriceOracleTest:testName() (gas: 9355) -ReservoirPriceOracleTest:testPriceCache_Inverted() (gas: 22016) -ReservoirPriceOracleTest:testSetFallbackOracle_NotOwner() (gas: 10928) -ReservoirPriceOracleTest:testSetRoute() (gas: 61702) -ReservoirPriceOracleTest:testSetRoute_InvalidDecimals() (gas: 761507) -ReservoirPriceOracleTest:testSetRoute_InvalidRewardThreshold() (gas: 37944) -ReservoirPriceOracleTest:testSetRoute_InvalidRewardThresholdLength() (gas: 18072) -ReservoirPriceOracleTest:testSetRoute_InvalidRoute() (gas: 20107) -ReservoirPriceOracleTest:testSetRoute_InvalidRouteLength() (gas: 19231) -ReservoirPriceOracleTest:testSetRoute_MultipleHops() (gas: 202204) +ReservoirPriceOracleTest:testPriceCache_Inverted() (gas: 22028) +ReservoirPriceOracleTest:testSetFallbackOracle_NotOwner() (gas: 10993) +ReservoirPriceOracleTest:testSetRoute() (gas: 60992) +ReservoirPriceOracleTest:testSetRoute_InvalidDecimals() (gas: 761313) +ReservoirPriceOracleTest:testSetRoute_InvalidRewardThreshold() (gas: 37234) +ReservoirPriceOracleTest:testSetRoute_InvalidRewardThresholdLength() (gas: 18050) +ReservoirPriceOracleTest:testSetRoute_InvalidRoute() (gas: 20151) +ReservoirPriceOracleTest:testSetRoute_InvalidRouteLength() (gas: 19209) +ReservoirPriceOracleTest:testSetRoute_MultipleHops() (gas: 201150) ReservoirPriceOracleTest:testSetRoute_NotSorted() (gas: 13029) -ReservoirPriceOracleTest:testSetRoute_OverwriteExisting() (gas: 170924) -ReservoirPriceOracleTest:testSetRoute_SameToken() (gas: 12997) -ReservoirPriceOracleTest:testUndesignatePair() (gas: 30215) -ReservoirPriceOracleTest:testUndesignatePair_NotOwner() (gas: 15322) -ReservoirPriceOracleTest:testUpdatePrice_AboveThresholdBelowMaxReward(uint256) (runs: 256, μ: 165909, ~: 165929) -ReservoirPriceOracleTest:testUpdatePrice_BelowThreshold(uint256) (runs: 256, μ: 150821, ~: 150497) -ReservoirPriceOracleTest:testUpdatePrice_BeyondMaxReward(uint256) (runs: 256, μ: 163385, ~: 163410) -ReservoirPriceOracleTest:testUpdatePrice_FirstUpdate() (gas: 154534) -ReservoirPriceOracleTest:testUpdatePrice_IntermediateRoutes() (gas: 16300656) -ReservoirPriceOracleTest:testUpdatePrice_NoPath() (gas: 15998) -ReservoirPriceOracleTest:testUpdatePrice_PriceOutOfRange() (gas: 5411994) -ReservoirPriceOracleTest:testUpdatePrice_RewardEligible_ContractNoReceive() (gas: 153671) -ReservoirPriceOracleTest:testUpdatePrice_RewardEligible_InsufficientReward(uint256) (runs: 256, μ: 213287, ~: 213505) -ReservoirPriceOracleTest:testUpdatePrice_RewardEligible_ZeroRecipient() (gas: 147341) +ReservoirPriceOracleTest:testSetRoute_OverwriteExisting() (gas: 169526) +ReservoirPriceOracleTest:testSetRoute_SameToken() (gas: 12975) +ReservoirPriceOracleTest:testUndesignatePair() (gas: 30263) +ReservoirPriceOracleTest:testUndesignatePair_NotOwner() (gas: 15315) +ReservoirPriceOracleTest:testUpdatePrice_AboveThresholdBelowMaxReward(uint256) (runs: 256, μ: 164770, ~: 164790) +ReservoirPriceOracleTest:testUpdatePrice_BelowThreshold(uint256) (runs: 256, μ: 149645, ~: 149316) +ReservoirPriceOracleTest:testUpdatePrice_BeyondMaxReward(uint256) (runs: 256, μ: 162201, ~: 162226) +ReservoirPriceOracleTest:testUpdatePrice_FirstUpdate() (gas: 153384) +ReservoirPriceOracleTest:testUpdatePrice_IntermediateRoutes() (gas: 11080585) +ReservoirPriceOracleTest:testUpdatePrice_NoPath() (gas: 15986) +ReservoirPriceOracleTest:testUpdatePrice_PriceOutOfRange() (gas: 5374104) +ReservoirPriceOracleTest:testUpdatePrice_RewardEligible_ContractNoReceive() (gas: 152500) +ReservoirPriceOracleTest:testUpdatePrice_RewardEligible_InsufficientReward(uint256) (runs: 256, μ: 210828, ~: 211040) +ReservoirPriceOracleTest:testUpdatePrice_RewardEligible_ZeroRecipient() (gas: 146179) +ReservoirPriceOracleTest:testUpdatePrice_WriteToNonSimpleRoute() (gas: 498183) ReservoirPriceOracleTest:testUpdateRewardGasAmount() (gas: 19038) ReservoirPriceOracleTest:testUpdateRewardGasAmount_NotOwner() (gas: 10953) -ReservoirPriceOracleTest:testUpdateTwapPeriod(uint256) (runs: 256, μ: 21616, ~: 21709) -ReservoirPriceOracleTest:testUpdateTwapPeriod_InvalidTwapPeriod(uint256) (runs: 256, μ: 17706, ~: 17994) -ReservoirPriceOracleTest:testValidatePair_NoDesignatedPair() (gas: 120366) -ReservoirPriceOracleTest:testWritePriceCache(uint256) (runs: 256, μ: 30384, ~: 30141) -RoutesLibTest:testGetDecimalDifference() (gas: 4852) -RoutesLibTest:testIsCompositeRoute() (gas: 5268) -RoutesLibTest:testPackSimplePrice(int8,uint256) (runs: 256, μ: 10185, ~: 9724) +ReservoirPriceOracleTest:testUpdateTwapPeriod(uint256) (runs: 256, μ: 21613, ~: 21687) +ReservoirPriceOracleTest:testUpdateTwapPeriod_InvalidTwapPeriod(uint256) (runs: 256, μ: 17688, ~: 17994) +ReservoirPriceOracleTest:testValidatePair_NoDesignatedPair() (gas: 119204) +ReservoirPriceOracleTest:testWritePriceCache(uint256) (runs: 256, μ: 30001, ~: 29763) +RoutesLibTest:testGetDecimalDifference() (gas: 3966) +RoutesLibTest:testIsCompositeRoute() (gas: 4332) +RoutesLibTest:testPackSimplePrice(int8,uint256) (runs: 256, μ: 8083, ~: 7862) SamplesTest:testAccumulator() (gas: 3930) SamplesTest:testAccumulator_BadVariableRequest() (gas: 3355) SamplesTest:testInstant() (gas: 3880) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 493408e..1d36f9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,7 @@ jobs: coverage: needs: [test-unit] + if: false # skip this job for now as it always makes the github CI timeout runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/foundry.toml b/foundry.toml index 8092bc9..6e4272e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -19,10 +19,6 @@ skip = ["test/large/*.sol"] [profile.default.fuzz] seed = "0xe9cdc8fb2a2c0d1c046034d74d6498826ae3f1d9877353cf40d8a6a7aedfe875" -[profile.coverage] -optimizer = true -optimizer_runs = 1_000_000 - [profile.large-test] via_ir = true match_path = "test/large/*.sol"