Skip to content

Commit

Permalink
feat: increase optimizer runs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefMist committed Jan 26, 2025
1 parent 8d22bfe commit 389b3cb
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 40 deletions.
10 changes: 9 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = 'src'
out = 'foundry-out'
solc_version = '0.8.26'
optimizer_runs = 9000
optimizer_runs = 1_000_000
via_ir = true
ffi = true
gas_limit = "3000000000"
Expand All @@ -15,6 +15,14 @@ fs_permissions = [
evm_version = 'cancun'
bytecode_hash = "none"

additional_compiler_profiles = [
{ name = "clPosm", optimizer_runs = 9000 }
]

compilation_restrictions = [
{ paths = "src/pool-cl/CLPositionManager.sol", optimizer_runs = 9000 }
]

[fuzz]
runs = 5 # change this for higher number of fuzz runs locally

Expand Down
2 changes: 1 addition & 1 deletion snapshots/BaseActionsRouterTest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mock10commands": "82833"
"mock10commands": "82785"
}
6 changes: 3 additions & 3 deletions snapshots/BinMigratorFromPancakeswapV2Test.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"testMigrateFromV2IncludingInit": "1180066",
"testMigrateFromV2WithoutInit": "1049481",
"testMigrateFromV2WithoutNativeToken": "1090203"
"testMigrateFromV2IncludingInit": "1176442",
"testMigrateFromV2WithoutInit": "1046490",
"testMigrateFromV2WithoutNativeToken": "1087310"
}
8 changes: 4 additions & 4 deletions snapshots/BinMigratorFromPancakeswapV3Test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"BinMigratorBytecode size": "12601",
"testMigrateFromV3IncludingInit": "1252393",
"testMigrateFromV3WithoutInit": "1121789",
"testMigrateFromV3WithoutNativeToken": "1156506"
"BinMigratorBytecode size": "15187",
"testMigrateFromV3IncludingInit": "1248658",
"testMigrateFromV3WithoutInit": "1118687",
"testMigrateFromV3WithoutNativeToken": "1153511"
}
6 changes: 3 additions & 3 deletions snapshots/BinMigratorFromUniswapV2Test.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"testMigrateFromV2IncludingInit": "1180066",
"testMigrateFromV2WithoutInit": "1049481",
"testMigrateFromV2WithoutNativeToken": "1090203"
"testMigrateFromV2IncludingInit": "1176442",
"testMigrateFromV2WithoutInit": "1046490",
"testMigrateFromV2WithoutNativeToken": "1087310"
}
8 changes: 4 additions & 4 deletions snapshots/BinMigratorFromUniswapV3Test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"BinMigratorBytecode size": "12601",
"testMigrateFromV3IncludingInit": "1250375",
"testMigrateFromV3WithoutInit": "1119771",
"testMigrateFromV3WithoutNativeToken": "1154488"
"BinMigratorBytecode size": "15187",
"testMigrateFromV3IncludingInit": "1246640",
"testMigrateFromV3WithoutInit": "1116669",
"testMigrateFromV3WithoutNativeToken": "1151493"
}
2 changes: 1 addition & 1 deletion snapshots/BinPositionManagerTest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"BinPositionManagerBytecode size": "15154"
"BinPositionManagerBytecode size": "17435"
}
10 changes: 5 additions & 5 deletions snapshots/BinPositionManager_ModifyLiquidityTest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"test_addLiquidity_OutsideActiveId": "294827",
"test_addLiquidity_SingleBin": "533778",
"test_addLiquidity_ThreeBins": "908043",
"test_decreaseLiquidity_threeBins": "186051",
"test_decreaseLiquidity_threeBins_half": "205238"
"test_addLiquidity_OutsideActiveId": "292694",
"test_addLiquidity_SingleBin": "532073",
"test_addLiquidity_ThreeBins": "905930",
"test_decreaseLiquidity_threeBins": "184859",
"test_decreaseLiquidity_threeBins_half": "203748"
}
6 changes: 3 additions & 3 deletions snapshots/BinPositionManager_NativeTokenTest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"test_addLiquidity": "849375",
"test_addLiquidity_excessEth": "851136",
"test_decreaseLiquidity": "192695"
"test_addLiquidity": "847340",
"test_addLiquidity_excessEth": "849077",
"test_decreaseLiquidity": "191515"
}
2 changes: 1 addition & 1 deletion snapshots/BinQuoterTest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"BinQuoterBytecode size": "6299"
"BinQuoterBytecode size": "6839"
}
14 changes: 7 additions & 7 deletions snapshots/BinSwapRouterTest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"testExactInputSingle_DifferentRecipient": "137214",
"testExactInputSingle_EthPool_SwapEthForToken": "125543",
"testExactInputSingle_EthPool_SwapTokenForEth": "111288",
"testExactInput_MultiHopDifferentRecipient": "168754",
"testExactOutputSingle_DifferentRecipient": "141480",
"testExactOutput_MultiHopDifferentRecipient": "172390",
"testExactOutput_SingleHop": "143161"
"testExactInputSingle_DifferentRecipient": "136133",
"testExactInputSingle_EthPool_SwapEthForToken": "124501",
"testExactInputSingle_EthPool_SwapTokenForEth": "110210",
"testExactInput_MultiHopDifferentRecipient": "166964",
"testExactOutputSingle_DifferentRecipient": "140509",
"testExactOutput_MultiHopDifferentRecipient": "170820",
"testExactOutput_SingleHop": "142184"
}
2 changes: 1 addition & 1 deletion snapshots/CLPositionDescriptorOffChainTest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"CLPositionDescriptorOffChain size": "2568"
"CLPositionDescriptorOffChain size": "2958"
}
2 changes: 1 addition & 1 deletion snapshots/CLQuoterTest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"CLQuoterBytecode size": "6458"
"CLQuoterBytecode size": "6998"
}
8 changes: 4 additions & 4 deletions snapshots/CLSwapRouterTest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"testExactInputSingle_gas": "169788",
"testExactInput_gas": "234192",
"testExactOutputSingle_gas": "169491",
"testExactOutput_gas": "233092"
"testExactInputSingle_gas": "168817",
"testExactInput_gas": "232455",
"testExactOutputSingle_gas": "168510",
"testExactOutput_gas": "231337"
}
2 changes: 1 addition & 1 deletion test/MixedQuoter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ contract MixedQuoterTest is
(uint256 amountOut, uint256 gasEstimate) = mixedQuoter.quoteMixedExactInput(paths, actions, params, 1 ether);

assertEq(amountOut, 901152761185198407);
assertGt(gasEstimate, 190000);
assertGt(gasEstimate, 180000);
assertLt(gasEstimate, 200000);
}

Expand Down

0 comments on commit 389b3cb

Please sign in to comment.