Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: activate isolate mode in toml #305

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

alex0207s
Copy link
Contributor

Motivation

To ensure our gas diff CI reports the correct gas usage and accurately reflects the difference between two commits.

Solution

  • Add isolate = true setting in the foundry.toml file. This will ensure the correct gas usage when executing forge test or forge script.

FYI: the isolate mode is introduced in 7186

Copy link

Changes to gas cost

Generated at commit: 3d38874d59fe73d64fb49dc50ac2c7f2eb42db7e, compared to commit: fd26a144a49422d09645318deba71cf7521d8a7c

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
AllowanceTarget pause
unpause
+21,064 ❌
+23,064 ❌
+405.86%
+6424.51%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
AllowanceTarget 672,307 (+101,932) pause
spendFromUserTo
unpause
23,422 (+21,064)
25,090 (+24,308)
23,423 (+23,064)
+893.30%
+3108.44%
+6424.51%
26,254 (+21,064)
49,550 (+26,393)
23,423 (+23,064)
+405.86%
+113.97%
+6424.51%
27,671 (+21,064)
36,235 (+26,880)
23,423 (+23,064)
+318.81%
+287.33%
+6424.51%
27,671 (+21,064)
91,680 (+28,796)
23,423 (+23,064)
+318.81%
+45.79%
+6424.51%
3 (0)
7 (0)
1 (0)

Copy link

Changes to gas cost

Generated at commit: 3d38874d59fe73d64fb49dc50ac2c7f2eb42db7e, compared to commit: fd26a144a49422d09645318deba71cf7521d8a7c

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
CoordinatedTaker setCoordinator +21,344 ❌ +467.46%
RFQ cancelRFQOffer
setFeeCollector
+23,948 ❌
+21,352 ❌
+171.88%
+465.19%
LimitOrderSwap cancelOrder
setFeeCollector
+23,643 ❌
+21,352 ❌
+138.86%
+462.97%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
CoordinatedTaker 2,424,571 (+223,372) approveTokens
setCoordinator
submitLimitOrderFill
27,103 (+24,188)
23,743 (+21,221)
33,120 (+31,792)
+829.78%
+841.44%
+2393.98%
173,719 (+48,619)
25,910 (+21,344)
128,494 (+19,898)
+38.86%
+467.46%
+18.32%
197,778 (+52,820)
23,942 (+21,391)
70,044 (+31,792)
+36.44%
+838.53%
+83.11%
197,778 (+52,820)
30,046 (+21,420)
256,791 (-10,808)
+36.44%
+248.32%
-4.04%
13 (0)
3 (0)
7 (0)
RFQ 2,515,445 (+228,136) cancelRFQOffer
fillRFQ
fillRFQWithSig
setFeeCollector
23,966 (+23,448)
31,818 (+29,684)
33,881 (+31,140)
23,771 (+21,227)
+4526.64%
+1391.00%
+1136.08%
+834.39%
37,881 (+23,948)
130,780 (+23,655)
113,405 (+30,165)
25,942 (+21,352)
+171.88%
+22.08%
+36.24%
+465.19%
38,873 (+24,448)
147,959 (+22,743)
77,623 (+31,128)
23,976 (+21,397)
+169.48%
+18.16%
+66.95%
+829.66%
49,814 (+23,448)
238,764 (+26,430)
228,713 (+28,228)
30,080 (+21,432)
+88.93%
+12.45%
+14.08%
+247.83%
4 (0)
22 (-1)
3 (0)
3 (0)
LimitOrderSwap 2,760,542 (+246,764) cancelOrder
fillLimitOrder
fillLimitOrderFullOrKill
fillLimitOrderGroup
setFeeCollector
29,257 (+23,700)
36,114 (+30,124)
48,236 (+30,136)
198,369 (+3,620)
23,793 (+21,227)
+426.49%
+502.90%
+166.50%
+1.86%
+827.24%
40,670 (+23,643)
1,426,477 (-388,582,324,368,978,200)
104,034 (-3,429)
243,212 (+6,149)
25,964 (+21,352)
+138.86%
-100.00%
-3.19%
+2.59%
+462.97%
33,856 (+27,700)
168,746 (+29,131)
48,236 (-78,969)
246,026 (+8,480)
23,998 (+21,397)
+449.97%
+20.87%
-62.08%
+3.57%
+822.65%
52,761 (+20,900)
29,535,199 (-8,937,393,460,487,071,000)
215,630 (+24,424)
292,203 (+416)
30,102 (+21,432)
+65.60%
-100.00%
+12.77%
+0.14%
+247.20%
7 (0)
23 (0)
3 (-4)
6 (0)
3 (0)
GenericSwap 1,829,903 (+181,092) executeSwap
executeSwapWithSig
32,169 (+31,491)
39,373 (+35,352)
+4644.69%
+879.18%
117,471 (+38,878)
168,273 (+26,652)
+49.47%
+18.82%
114,955 (+45,534)
174,989 (+28,902)
+65.59%
+19.78%
251,886 (+22,628)
283,742 (+13,452)
+9.87%
+4.98%
12 (0)
4 (0)
SmartOrderStrategy 1,320,340 (+141,784) approveTokens
executeStrategy
58,536 (+24,348)
23,253 (+22,544)
+71.22%
+3179.69%
179,627 (+27,025)
126,430 (+25,031)
+17.71%
+24.69%
283,421 (+50,320)
84,221 (-26,860)
+21.59%
-24.18%
283,421 (+25,820)
610,445 (+35,404)
+10.02%
+6.16%
26 (0)
14 (-5)
UniAgent 1,573,157 (+160,164) approveAndSwap
approveTokensToRouters
swap
37,187 (+27,968)
101,139 (+24,212)
116,943 (+27,980)
+303.37%
+31.47%
+31.45%
145,786 (+27,689)
179,217 (+22,222)
189,434 (+19,442)
+23.45%
+14.15%
+11.44%
175,787 (+25,332)
184,795 (+22,080)
191,806 (+19,638)
+16.84%
+13.57%
+11.41%
224,385 (+29,768)
184,795 (+22,080)
250,800 (+19,232)
+15.30%
+13.57%
+8.31%
3 (0)
15 (0)
12 (0)

@charlesjhongc charlesjhongc merged commit 2b54a4f into master Mar 13, 2024
2 checks passed
@charlesjhongc charlesjhongc deleted the activate-isolate-mode-in-toml branch March 13, 2024 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants