Skip to content

Commit

Permalink
feat: change optimizer runs to be below size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulla-cb committed Dec 12, 2024
1 parent f05bfaa commit 3b04bd0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
4 changes: 3 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ fuzz_runs = 10_000
bytecode_hash = "none"

additional_compiler_profiles = [
{ name = "posm", via_ir = false, optimizer_runs = 2000},
{ name = "descriptor", via_ir = true, optimizer_runs = 1 },
{ name = "test", via_ir = false }
]

compilation_restrictions = [
{ paths = "src/PositionDescriptor.sol", optimizer_runs = 1 },
{ paths = "src/PositionManager.sol", via_ir = false, optimizer_runs = 2000},
{ paths = "src/PositionDescriptor.sol", via_ir = true, optimizer_runs = 1 },
{ paths = "test/**", via_ir = false }
]

Expand Down
80 changes: 40 additions & 40 deletions snapshots/PosMGasTest.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{
"PositionManager_burn_empty": "50328",
"PositionManager_burn_empty_native": "50328",
"PositionManager_burn_nonEmpty_native_withClose": "126829",
"PositionManager_burn_nonEmpty_native_withTakePair": "126230",
"PositionManager_burn_nonEmpty_withClose": "133735",
"PositionManager_burn_nonEmpty_withTakePair": "133136",
"PositionManager_collect_native": "146902",
"PositionManager_collect_sameRange": "155534",
"PositionManager_collect_withClose": "155534",
"PositionManager_collect_withTakePair": "154797",
"PositionManager_decreaseLiquidity_native": "113017",
"PositionManager_decreaseLiquidity_withClose": "121103",
"PositionManager_decreaseLiquidity_withTakePair": "120366",
"PositionManager_decrease_burnEmpty": "136701",
"PositionManager_decrease_burnEmpty_native": "129796",
"PositionManager_decrease_sameRange_allLiquidity": "133819",
"PositionManager_decrease_take_take": "121750",
"PositionManager_increaseLiquidity_erc20_withClose": "159357",
"PositionManager_increaseLiquidity_erc20_withSettlePair": "158218",
"PositionManager_increaseLiquidity_native": "142406",
"PositionManager_increase_autocompoundExactUnclaimedFees": "137480",
"PositionManager_increase_autocompoundExcessFeesCredit": "178784",
"PositionManager_increase_autocompound_clearExcess": "148698",
"PositionManager_mint_native": "366514",
"PositionManager_mint_nativeWithSweep_withClose": "375221",
"PositionManager_mint_nativeWithSweep_withSettlePair": "374358",
"PositionManager_mint_onSameTickLower": "318141",
"PositionManager_mint_onSameTickUpper": "318783",
"PositionManager_mint_sameRange": "244365",
"PositionManager_mint_settleWithBalance_sweep": "419937",
"PositionManager_mint_warmedPool_differentRange": "324159",
"PositionManager_mint_withClose": "420705",
"PositionManager_mint_withSettlePair": "419680",
"PositionManager_multicall_initialize_mint": "455655",
"PositionManager_permit": "79458",
"PositionManager_permit_secondPosition": "62370",
"PositionManager_permit_twice": "45270",
"PositionManager_subscribe": "87808",
"PositionManager_unsubscribe": "61956",
"positionManager bytecode size": "28169"
"PositionManager_burn_empty": "50490",
"PositionManager_burn_empty_native": "50490",
"PositionManager_burn_nonEmpty_native_withClose": "127186",
"PositionManager_burn_nonEmpty_native_withTakePair": "126605",
"PositionManager_burn_nonEmpty_withClose": "134092",
"PositionManager_burn_nonEmpty_withTakePair": "133511",
"PositionManager_collect_native": "147259",
"PositionManager_collect_sameRange": "155891",
"PositionManager_collect_withClose": "155891",
"PositionManager_collect_withTakePair": "155177",
"PositionManager_decreaseLiquidity_native": "113303",
"PositionManager_decreaseLiquidity_withClose": "121460",
"PositionManager_decreaseLiquidity_withTakePair": "120746",
"PositionManager_decrease_burnEmpty": "137111",
"PositionManager_decrease_burnEmpty_native": "130205",
"PositionManager_decrease_sameRange_allLiquidity": "134176",
"PositionManager_decrease_take_take": "122135",
"PositionManager_increaseLiquidity_erc20_withClose": "159828",
"PositionManager_increaseLiquidity_erc20_withSettlePair": "158686",
"PositionManager_increaseLiquidity_native": "142853",
"PositionManager_increase_autocompoundExactUnclaimedFees": "137717",
"PositionManager_increase_autocompoundExcessFeesCredit": "179147",
"PositionManager_increase_autocompound_clearExcess": "149061",
"PositionManager_mint_native": "367155",
"PositionManager_mint_nativeWithSweep_withClose": "375927",
"PositionManager_mint_nativeWithSweep_withSettlePair": "375085",
"PositionManager_mint_onSameTickLower": "318686",
"PositionManager_mint_onSameTickUpper": "319328",
"PositionManager_mint_sameRange": "244910",
"PositionManager_mint_settleWithBalance_sweep": "420852",
"PositionManager_mint_warmedPool_differentRange": "324704",
"PositionManager_mint_withClose": "421370",
"PositionManager_mint_withSettlePair": "420354",
"PositionManager_multicall_initialize_mint": "456443",
"PositionManager_permit": "79572",
"PositionManager_permit_secondPosition": "62472",
"PositionManager_permit_twice": "45372",
"PositionManager_subscribe": "87949",
"PositionManager_unsubscribe": "62082",
"positionManager bytecode size": "23643"
}

0 comments on commit 3b04bd0

Please sign in to comment.