-
Notifications
You must be signed in to change notification settings - Fork 38
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: [S7] don't return exec hooks in getExecutionData for native functions that don't execute msg.sig-based hooks #300
Conversation
Summary by OctaneNew ContractsNo new contracts were added in this PR. Updated Contracts
🔗 Commit Hash: 48bb15a |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
87e29e1
to
f62dbb5
Compare
Contract sizes: | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) |
|-------------------------------|------------------|-------------------|--------------------|---------------------|
| AccountFactory | 6,121 | 6,595 | 18,455 | 42,557 |
| AllowlistModule | 9,602 | 9,629 | 14,974 | 39,523 |
| ExecutionInstallDelegate | 5,947 | 5,993 | 18,629 | 43,159 |
-| ModularAccount | 22,274 | 23,309 | 2,302 | 25,843 |
-| NativeFunctionDelegate | 539 | 566 | 24,037 | 48,586 |
+| ModularAccount | 22,022 | 23,078 | 2,554 | 26,074 |
+| NativeFunctionDelegate | 560 | 587 | 24,016 | 48,565 |
| NativeTokenLimitModule | 4,583 | 4,610 | 19,993 | 44,542 |
| PaymasterGuardModule | 1,845 | 1,872 | 22,731 | 47,280 |
-| SemiModularAccount7702 | 23,465 | 24,493 | 1,111 | 24,659 |
-| SemiModularAccountBytecode | 23,947 | 24,982 | 629 | 24,170 |
-| SemiModularAccountStorageOnly | 24,419 | 25,454 | 157 | 23,698 |
+| SemiModularAccount7702 | 23,120 | 24,169 | 1,456 | 24,983 |
+| SemiModularAccountBytecode | 23,602 | 24,658 | 974 | 24,494 |
+| SemiModularAccountStorageOnly | 24,095 | 25,151 | 481 | 24,001 |
| SingleSignerValidationModule | 3,646 | 3,673 | 20,930 | 45,479 |
| TimeRangeModule | 2,223 | 2,250 | 22,353 | 46,902 |
| WebAuthnValidationModule | 7,854 | 7,881 | 16,722 | 41,271 | Code coverage:
|
f62dbb5
to
16bd90f
Compare
Overview
Detailed findings
|
16bd90f
to
1b418fa
Compare
362f2dc
to
1956199
Compare
04119d0
to
fc1683a
Compare
fc1683a
to
5fe65eb
Compare
…tions that don't execute msg.sig-based hooks
5fe65eb
to
48bb15a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm. I do want to note that we can still technically install execution hooks that won't end up being invoked, so execution hooks on native functions with _isWrappedNativeFunction() == false
. It might be worth adding as one additional check in installExecution()
, but it might also not be worth the hassle/gas costs.
Address potential inconsistencies in
ModularAccountView.getExecutionData
if a module with execution hooks on native functions that DO NOT use thewrapNativeFunction
modifier is installed. Native functions withoutwrapNativeFunction
do not runmsg.sig
-based execution hooks. Since we allow installations of modules that clash with native function selectors, it is probably best to give a consistent view of what will actually be executed via our ModularAccountView functions.This PR also includes some refactoring to simplify things, as well as addresses some other consistency issues.
initializeWithValidation
to the native function checks forModularAccount
.initialize
to the native function checks forSemiModularAccountStorageOnly
.entryPoint()
as a native function check.wrapNativeFunction
to include all native functions that have the modifier applied withinModularAccountBase
._globalValidationAllowed
withinSemiModularAccountBase
._isGlobalValidationAllowedNativeFunction
which is overridden there handles it._isGlobalValidationAllowedNativeFunction
to take uint32 instead of bytes4 for consistency and codesize.