Skip to content

Commit 462673f

Browse files
fix: remove enforcing hook execution ordering wording (#173)
1 parent 643cdfa commit 462673f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

standard/ERCs/erc-6900.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,17 @@ During execution uninstallation, the account MUST correctly clear flags and othe
527527
- the account SHOULD call `onUnInstall` on the execution module to initialize the states and track call success if required by user.
528528
- the account MUST emit `ExecutionUninstalled` as defined in the interface for all uninstalled executions.
529529

530+
#### Hook execution order
531+
532+
It is RECOMMENDED that an account implementer runs hooks in first installed first executed order. However, an account MAY implement a different execution order.
533+
530534
### Validation Call Flow
531535

532536
Modular accounts support three different calls flows for validation: user op validation, runtime validation, and signature validation. User op validation happens within the account's implementation of the function `validateUserOp`, defined in the ERC-4337 interface `IAccount`. Runtime validation happens through the dispatcher function `executeWithAuthorization`, or when using direct call validation. Signature validation happens within the account's implementation of the function `isValidSignature`, defined in ERC-1271.
533537

534538
For each of these validation types, an account implementation MAY specify its own format for selecting which validation function to use, as well as any per-hook data for validation hooks.
535539

536-
Within the implementation of each type of validation function, the modular account MUST check that the provided validation function applies to the given function selector intended to be run. Then, the account MUST execute all validation hooks of the corresponding type associated with the validation function in use. These hooks MUST be executed in the order specified during installation. After the execution of validation hooks, the account MUST invoke the validation function of the corresponding type. If any validation hooks or the validation function revert, the account MUST revert. It SHOULD include the module's revert data within its revert data.
540+
Within the implementation of each type of validation function, the modular account MUST check that the provided validation function applies to the given function selector intended to be run. Then, the account MUST execute all validation hooks of the corresponding type associated with the validation function in use. After the execution of validation hooks, the account MUST invoke the validation function of the corresponding type. If any validation hooks or the validation function revert, the account MUST revert. It SHOULD include the module's revert data within its revert data.
537541

538542
The account MUST define a way to pass data separately for each validation hook and the validation function itself. This data MUST be sent as the `userOp.signature` field for user op validation, the `authorization` field for runtime validation, and the `signature` field for signature validation.
539543

@@ -563,7 +567,7 @@ For all non-view functions within `IModularAccount` except `executeWithAuthoriza
563567

564568
If the caller is not the EntryPoint or the account, the account MUST check access control for direct call validation.
565569

566-
Prior to running the target function, the modular account MUST run all pre execution hooks that apply for the current function call. Pre execution hooks apply if they have been installed to the currently running function selector, or if they are installed as a permission hook to the validation function that was used for the current execution. Pre execution hooks MUST run validation-associated hooks first, in the order they were installed, then selector-associated hooks second, in the order they were installed.
570+
Prior to running the target function, the modular account MUST run all pre execution hooks that apply for the current function call. Pre execution hooks apply if they have been installed to the currently running function selector, or if they are installed as a permission hook to the validation function that was used for the current execution. Pre execution hooks MUST run validation-associated hooks first, then selector-associated hooks second.
567571

568572
Next, the modular account MUST run the target function, either an account native function or a module-defined execution function.
569573

0 commit comments

Comments
 (0)