-
Notifications
You must be signed in to change notification settings - Fork 34
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: [QS-01] revert on presence of validation hooks in deferred validation, and run validation-associated execution hooks #287
base: adam/fix-execute-user-op-with-def-action
Are you sure you want to change the base?
Conversation
Summary by OctaneNew ContractsNo new contracts were added in this PR. Updated Contracts
🔗 Commit Hash: 85a7a12 |
Contract sizes: | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) |
|-------------------------------|------------------|-------------------|--------------------|---------------------|
| AccountFactory | 4,814 | 5,239 | 19,762 | 43,913 |
| AllowlistModule | 9,903 | 9,930 | 14,673 | 39,222 |
| ExecutionInstallDelegate | 5,714 | 5,760 | 18,862 | 43,392 |
-| ModularAccount | 21,973 | 28,676 | 2,603 | 20,476 |
+| ModularAccount | 22,270 | 28,973 | 2,306 | 20,179 |
| NativeFunctionDelegate | 434 | 461 | 24,142 | 48,691 |
| NativeTokenLimitModule | 4,449 | 4,476 | 20,127 | 44,676 |
| PaymasterGuardModule | 1,845 | 1,872 | 22,731 | 47,280 |
-| SemiModularAccountBytecode | 23,275 | 29,978 | 1,301 | 19,174 |
-| SemiModularAccountStorageOnly | 23,769 | 30,472 | 807 | 18,680 |
+| SemiModularAccountBytecode | 23,572 | 30,275 | 1,004 | 18,877 |
+| SemiModularAccountStorageOnly | 24,061 | 30,764 | 515 | 18,388 |
| SingleSignerValidationModule | 3,646 | 3,673 | 20,930 | 45,479 |
| TimeRangeModule | 2,000 | 2,027 | 22,576 | 47,125 |
| WebAuthnValidationModule | 7,854 | 7,881 | 16,722 | 41,271 | Code coverage:
|
Overview
Detailed findings
|
src/account/ModularAccountBase.sol
Outdated
@@ -413,12 +414,18 @@ abstract contract ModularAccountBase is | |||
/// [(33 + deferredActionSigLength + encodedDataLength):] : bytes, userOpSignature. This is the | |||
/// signature passed to the inner validation. | |||
if (hasDeferredAction) { | |||
// Because this bypasses UO validation hooks, we require that the validation used does not include any | |||
// validation hooks. | |||
if (!getAccountStorage().validationStorage[validationFunction].validationHooks.isEmpty()) { |
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.
We should document this during validation installation.
If you want to use a validation to approve deferred actions in the future, it should not have validation hooks.
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.
Where do you think this fits? As a comment in installValidation()
? Or perhaps in the documentation for integrators/SDK?
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.
In the documentation notion doc for now to later transfer to the doc site is enough probably.
4f42d88
to
85a7a12
Compare
85a7a12
to
a317085
Compare
67305ea
to
3973328
Compare
Motivation
Currently, it's possible to skip userOp validation hooks if the validation function being used is also a signature validation through deferred installation. Furthermore, we're not running userOp validation-associated execution hooks, when we could be.
Solution
Revert if the validation being used includes validation hooks, and run the validation-associated pre and post hooks tied to that validation.