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

Gas surcharge flashloan test #72

Merged
merged 29 commits into from
Jan 19, 2024
Merged

Gas surcharge flashloan test #72

merged 29 commits into from
Jan 19, 2024

Conversation

Code0x2
Copy link
Contributor

@Code0x2 Code0x2 commented Dec 8, 2023

Tests atlETH flashloan system for solvers

@Code0x2 Code0x2 marked this pull request as ready for review December 12, 2023 03:31
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@BenSparksCode BenSparksCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid. I agree with JJ, would be nice to have a few balance checks (for Atlas contract, solver AtlETH, bundler) and maybe a test where bundler sends value and gets repaid by solver.

But otherwise looks good to me

Base automatically changed from gas-surcharge-2 to main December 13, 2023 08:12
Copy link

github-actions bot commented Jan 10, 2024

Changes to gas cost

Generated at commit: 372cdd2d1cff03bd6048e0a7453883646eb1c45c, compared to commit: 0a9e5f05d7b477443b0830925123dd354f48f378

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
AtlasVerification validCalls +3,829 ❌ +6.72%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
ExecutionEnvironment 2,090,342 (0) allocateValue
solverMetaTryCatch
userWrapper
7,212 (0)
1,252 (0)
2,160 (0)
0.00%
0.00%
0.00%
43,589 (-512)
96,189 (-5,361)
35,628 (-3,365)
-1.16%
-5.28%
-8.63%
38,466 (+2,908)
69,385 (+2,260)
20,908 (0)
+8.18%
+3.37%
0.00%
94,737 (0)
418,092 (0)
132,679 (0)
0.00%
0.00%
0.00%
11 (+1)
21 (+3)
29 (+3)
Atlas 4,294,906 (-2,000) balanceOf
bond
deposit
execute
metacall
reconcile
validateBalances
1,056 (0)
30,408 (0)
3,318 (0)
36,302 (0)
101,359 (-4)
2,188 (0)
370 (0)
0.00%
0.00%
0.00%
0.00%
-0.00%
0.00%
0.00%
1,356 (-33)
49,924 (+653)
31,615 (+29)
201,208 (-10,792)
342,585 (+7,473)
2,224 (+9)
551 (-41)
-2.38%
+1.33%
+0.09%
-5.09%
+2.23%
+0.41%
-6.93%
1,056 (0)
52,708 (+400)
25,218 (0)
145,839 (-53,429)
361,033 (+85,681)
2,188 (0)
370 (0)
0.00%
+0.76%
0.00%
-26.81%
+31.12%
0.00%
0.00%
3,056 (0)
57,108 (0)
47,118 (0)
520,091 (0)
818,709 (-54)
2,297 (0)
2,370 (0)
0.00%
0.00%
0.00%
0.00%
-0.01%
0.00%
0.00%
20 (+2)
12 (+1)
95 (+3)
22 (+3)
22 (+3)
9 (+1)
11 (+2)
AtlasVerification 2,646,979 (-807) getDAppOperationPayload
getNextNonce
getSolverPayload
initializeGovernance
validCalls
2,568 (0)
1,654 (0)
2,646 (-18)
53,992 (0)
27,981 (0)
0.00%
0.00%
-0.68%
0.00%
0.00%
2,571 (+3)
3,862 (-198)
2,691 (-23)
96,898 (+61)
60,807 (+3,829)
+0.12%
-4.88%
-0.85%
+0.06%
+6.72%
2,568 (0)
2,912 (0)
2,664 (-36)
98,949 (0)
57,245 (+17,282)
0.00%
0.00%
-1.33%
0.00%
+43.25%
2,586 (+18)
5,654 (0)
2,866 (0)
98,949 (0)
108,575 (-136)
+0.70%
0.00%
0.00%
0.00%
-0.13%
15 (+6)
22 (+4)
16 (+6)
66 (+2)
22 (+3)
Simulator 1,171,855 (+1,800) metacallSimulation
simSolverCalls
simUserOperation
107,648 (-6)
465,596 (-37)
114,667 (-8)
-0.01%
-0.01%
-0.01%
202,101 (-12)
566,969 (-37)
138,924 (-8)
-0.01%
-0.01%
-0.01%
115,703 (-6)
566,969 (-37)
118,331 (-8)
-0.01%
-0.01%
-0.01%
656,161 (-44)
668,342 (-37)
288,802 (-8)
-0.01%
-0.01%
-0.00%
12 (0)
2 (0)
10 (0)

test/FlashLoan.t.sol Outdated Show resolved Hide resolved
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
test/FlashLoan.t.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@BenSparksCode BenSparksCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM. Only concern is that thing you mentioned with the bid ETH being split weirdly disproportionately towards Atlas over the bundler (user).

If you get a chance soon, please start looking into why thats happening. I'll also take a look asap, just busy with the verification and nonce PRs rn.

Copy link
Contributor

@BenSparksCode BenSparksCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

@BenSparksCode BenSparksCode merged commit 79bfd7e into main Jan 19, 2024
4 checks passed
@BenSparksCode BenSparksCode deleted the gas-surcharge-test branch January 19, 2024 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants