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

feat: add (un)/installation expected behavior for both validation and execution #168

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

fangting-alchemy
Copy link
Collaborator

FYI; nothing is changed for #### Responsibilties of StandardExecutorandModuleExecutor``

Comment on lines 474 to 485
#### Responsibilties of `StandardExecutor` and `ModuleExecutor`

`StandardExecutor` functions are used for open-ended calls to external addresses.

`ModuleExecutor` functions are specifically used by modules to request the account to execute with account's context. Explicit permissions are required for modules to use `ModuleExecutor`.

The following behavior MUST be followed:

- `StandardExecutor` can NOT call module execution functions and/or `ModuleExecutor`. This is guaranteed by checking whether the call's target implements the `IModule` interface via ERC-165 as required.
- `StandardExecutor` can NOT be called by module execution functions and/or `ModuleExecutor`.
- Module execution functions MUST NOT request access to `StandardExecutor`, they MAY request access to `ModuleExecutor`.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is not deleted or changed. Github just moved it to the end of the newly added sections.

@fangting-alchemy fangting-alchemy requested a review from a team August 28, 2024 21:50
Copy link
Contributor

@adamegyed adamegyed left a comment

Choose a reason for hiding this comment

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

Looks good! Some small comments.

Also, couldn't commit this on the sections, but what do you think of renaming the headers:

  • "Validations and their installation /uninstallation" -> "Installation and Uninstallation of Validation Functions"
  • "Execution and their installation /uninstallation" -> "Installation and Uninstallation of Execution Functions"

standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
- Revert if the module does not implement ERC-165 or does not support the `IModule` interface.
- Revert if `manifestHash` does not match the computed Keccak-256 hash of the module's returned manifest. This prevents installation of modules that attempt to install a different module configuration than the one that was approved by the client.
- Revert if any address in `dependencies` does not support the interface at its matching index in the manifest's `dependencyInterfaceIds`, or if the two array lengths do not match, or if any of the dependencies are not already installed on the modular account.
- the account MUST install all pre validation hooks required by the user and call `onInstall` with the user-provided data on the hook module to initialize the states.
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit of a meta-note for all locations in the spec where we describe the requirement to call onInstall: Technically, our account currently doesn't perform this call if the data is empty. With respect to the specificiation, I think we could change the requirement to either be:

  1. If data is provided to <parameter_name>, the account MUST call onInstall with the data.
  2. The account SHOULD call onInstall with the data in <parameter_name>.

This pattern appears in each install/uninstall for validation/execution.

Wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point. Updated wording to user intent rather than specific var/param names.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the 2nd is nicer, since it implies more clearly that hooks may not always be initialized with onInstall, as it's a user choice.

standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
@fangting-alchemy
Copy link
Collaborator Author

Looks good! Some small comments.

Also, couldn't commit this on the sections, but what do you think of renaming the headers:

  • "Validations and their installation /uninstallation" -> "Installation and Uninstallation of Validation Functions"
  • "Execution and their installation /uninstallation" -> "Installation and Uninstallation of Execution Functions"

I like what we have better because these section don't just talk about installation and uninstallations. They also cover other general higher level things about validations and executions.

standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
- the account MUST install all pre validation hooks required by the user and call `onInstall` with the user-provided data on the hook module to initialize the states.
- the account MUST install all permission hooks required by the user and call `onInstall` with the user-provided data on the hook module to initialize the states.
- the account MUST add all selectors required by the user that the validation can validate.
- the account MUST set `isGlobal` and `isSignatureValidation` flags as required.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're missing the new isUserOpValidation flag too

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to list all of them here? We say "MUST correctly set flags and other fields" above, so I think we should either:

  1. Avoid listing individual fields, and just use the generic "all flags and fields" wording
  2. Avoid stating the generic grouping, and only list individual fields.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe all flags is enough. Save headaches to update later if more flags are added. Probably dont need fields since all other fields (like hooks and selectors etc.) are mentioned below for clarity and some guidance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, I think it might be nice to list them too to just be clear what flag means. maybe in a way to not indicate the list is exhaustive, but as examples.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated wording, wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's good, one nit is that when it says "flags, like isGlobal ...", using "like" immplies there may be more flags beyond those, so maybe we just do "flags: isGloval, ...". But that's just a tiny nit.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good point, do we want to specify exactly which flags, or do we want to give some examples? Are there implications if accounts add other flags later?

standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
standard/ERCs/erc-6900.md Outdated Show resolved Hide resolved
@fangting-alchemy fangting-alchemy merged commit 2b482ca into develop Aug 29, 2024
3 checks passed
@fangting-alchemy fangting-alchemy deleted the installation branch August 29, 2024 22:36
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