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

♻️ set the first signer in the initialize function #77

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

qd-qd
Copy link
Member

@qd-qd qd-qd commented Apr 2, 2024

No description provided.

qd-qd added 2 commits April 2, 2024 11:52
Starting from the `addFirstSigner` is removed from the `Account` contract.
The first signer will be set in the `initialize` function directly.
Not all the `authData`` is passed to the `initialize` function, only signer's
data.
@qd-qd qd-qd self-assigned this Apr 2, 2024
Copy link

github-actions bot commented Apr 2, 2024

Changes to gas cost

Generated at commit: 08234c1b456ee6b99f3699235d7e3d97c57eb411, compared to commit: e68d474edc6e0a704378c1a5a764ae18b1025087

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
SmartAccountHarness initialize +70,815 ❌ +153.90%
SmartAccount initialize +62,781 ❌ +143.18%
TransparentUpgradeableProxy exposed_getAddress +1,970 ❌ +39.87%
ERC1967Proxy factory
initialize
-2,166 ✅
-31,244 ✅
-74.79%
-51.12%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
SmartAccountHarness 2,357,128 (+2,904) exposed_validateSignature
initialize
webAuthnVerifier
2,773 (+23)
116,829 (+70,815)
257 (-22)
+0.84%
+153.90%
-7.89%
121,602 (+23)
116,829 (+70,815)
257 (-22)
+0.02%
+153.90%
-7.89%
14,802 (+23)
116,829 (+70,815)
257 (-22)
+0.16%
+153.90%
-7.89%
290,738 (+23)
116,829 (+70,815)
257 (-22)
+0.01%
+153.90%
-7.89%
5 (0)
5 (0)
1 (0)
SmartAccount 2,264,367 (-576) addWebAuthnP256R1Signer
entryPoint
execute
factory
getSigner
initialize
isValidSignature
removeWebAuthnP256R1Signer
595 (+46)
247 (-22)
6,864 (+49)
352 (0)
1,428 (0)
2,888 (+325)
704 (+22)
345 (+23)
+8.38%
-8.18%
+0.72%
0.00%
0.00%
+12.68%
+3.23%
+7.14%
1,173 (+49)
247 (-22)
51,229 (+23)
352 (-666)
3,428 (-250)
106,629 (+62,781)
52,023 (+22)
488 (+23)
+4.36%
-8.18%
+0.04%
-65.42%
-6.80%
+143.18%
+0.04%
+4.95%
595 (+46)
247 (-22)
56,458 (0)
352 (0)
1,428 (0)
116,829 (+70,772)
5,230 (+22)
345 (+23)
+8.38%
-8.18%
0.00%
0.00%
0.00%
+153.66%
+0.42%
+7.14%
73,141 (+361)
247 (-22)
83,714 (0)
352 (-2,000)
7,428 (0)
116,829 (+70,772)
286,628 (+22)
18,845 (+23)
+0.50%
-8.18%
0.00%
-85.03%
0.00%
+153.66%
+0.01%
+0.12%
259 (0)
513 (0)
30 (0)
2 (-1)
9 (+1)
37 (-3)
12 (0)
258 (0)
MockEntryPoint 94,467 (-40,264) getNonce 0 (-2,624) -100.00% 290 (-2,334) -88.95% 339 (-2,285) -87.08% 339 (-2,285) -87.08% 1,795 (+1,788)
TransparentUpgradeableProxy 835,009 (0) createAndInitAccount
exposed_getAddress
getAddress
owner
41,278 (+1,313)
6,911 (+1,970)
5,523 (-47)
0 (-784)
+3.29%
+39.87%
-0.84%
-100.00%
68,352 (+802)
6,911 (+1,970)
11,814 (+1,115)
5,778 (+2,557)
+1.19%
+39.87%
+10.42%
+79.39%
46,363 (+1,298)
6,911 (+1,970)
12,906 (+1,301)
7,240 (+6,456)
+2.88%
+39.87%
+11.21%
+823.47%
258,390 (-5,185)
6,911 (+1,970)
12,924 (+1,282)
7,284 (0)
-1.97%
+39.87%
+11.01%
0.00%
287 (0)
1 (0)
1,833 (0)
1,290 (+1,282)
ERC1967Proxy 0 (-168,642) addWebAuthnP256R1Signer
execute
exposed_validateCreationSignature
extractSignerFromAuthData
factory
getSigner
initialize
isValidSignature
removeWebAuthnP256R1Signer
29,536 (+46)
36,802 (+49)
6,312 (+23)
1,349 (-22)
730 (0)
1,815 (0)
29,879 (+1,373)
32,700 (+22)
26,803 (+23)
+0.16%
+0.13%
+0.37%
-1.60%
0.00%
0.00%
+4.82%
+0.07%
+0.09%
29,536 (+46)
64,483 (+168)
27,381 (+3,898)
3,057 (-22)
730 (-2,166)
4,815 (-375)
29,879 (-31,244)
180,404 (+383)
26,803 (+23)
+0.16%
+0.26%
+16.60%
-0.71%
-74.79%
-7.23%
-51.12%
+0.21%
+0.09%
29,536 (+46)
38,152 (+18)
30,798 (+6,099)
3,059 (-22)
730 (0)
1,815 (0)
29,879 (-42,117)
45,874 (+22)
26,803 (+23)
+0.16%
+0.05%
+24.69%
-0.71%
0.00%
0.00%
-58.50%
+0.05%
+0.09%
29,536 (+46)
104,656 (+379)
41,479 (+6,840)
3,059 (-22)
730 (-6,500)
12,315 (0)
29,879 (-42,117)
608,130 (+2,191)
26,803 (+23)
+0.16%
+0.36%
+19.75%
-0.71%
-89.90%
0.00%
-58.50%
+0.36%
+0.09%
256 (0)
5 (0)
1,795 (0)
1,283 (0)
2 (-1)
9 (+1)
1 (-3)
12 (0)
256 (0)
AccountFactory 1,409,804 (+22,340) createAndInitAccount
getAddress
initialize
10,809 (+1,301)
7,943 (+1,301)
2,629 (0)
+13.68%
+19.59%
0.00%
38,395 (+803)
7,943 (+1,301)
46,272 (-133)
+2.14%
+19.59%
-0.29%
16,309 (+1,298)
7,943 (+1,301)
48,107 (0)
+8.65%
+19.59%
0.00%
227,921 (-5,197)
7,943 (+1,301)
48,107 (0)
-2.23%
+19.59%
0.00%
287 (0)
288 (-1)
51 (-4)
AccountFactoryHarness 1,461,392 (+20,173) getAddress 7,943 (+1,301) +19.59% 7,943 (+1,301) +19.59% 7,943 (+1,301) +19.59% 7,943 (+1,301) +19.59% 1,026 (0)
AccountFactoryV2 1,496,949 (+22,299) getAddress 7,966 (+1,301) +19.52% 7,966 (+1,301) +19.52% 7,966 (+1,301) +19.52% 7,966 (+1,301) +19.52% 1 (0)
AccountFactory__GetAddress 5,172,453 (+250,560) _truncBytes 1,333 (+42) +3.25% 1,333 (+42) +3.25% 1,333 (+42) +3.25% 1,333 (+42) +3.25% 256 (0)
DumbERC721 1,348,138 (0) safeTransferFrom 59,355 (-23) -0.04% 59,355 (-23) -0.04% 59,355 (-23) -0.04% 59,355 (-23) -0.04% 1 (0)
SmartAccountERC1271__EIP191 8,136,262 (+19,632)
SmartAccountERC1271__EIP712 8,163,306 (+19,633)
SmartAccount__ValidateCreationSignature 8,039,100 (+895,877)
SmartAccount__validateWebAuthnP256R1Signature 6,720,954 (+31,250)

@qd-qd qd-qd merged commit 4bd2dc6 into main Apr 2, 2024
4 checks passed
@qd-qd qd-qd deleted the factory/change-salt-formula branch April 2, 2024 15:19
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.

1 participant