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

Remove extraneous install/uninstall field checking #15

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

adam-alchemy
Copy link
Contributor

Motivation

There is a large amount of extraneous checks in plugin installation and uninstallation that are not required by the ERC-6900 standard.

Solution

  • Remove checks during uninstallPlugin that assert the values to be the same as what was used during installation. Because the manifest hash is validated prior to the individual field removals, we know that all fields must have been successfully added.
    • The only way this invariant may be violated is if the account is upgraded to a custom implementation then upgraded back to this implementation. In such a case, the behavior is undefined.
  • Remove the strict requirement that permittedExecutionSelectors must be installed. Due to the possibility that other hooks may cause the call to executeFromPlugin to fail, plugins must already expect this possibility, and a lack of installation results in a similar call revert.
    • This also makes dependency management and plugin upgrading slightly easier.
  • Remove all of the now-unused custom errors.

This PR is stacked on top of #13, and should only be merged after the underlying is merged.

@@ -15,14 +15,12 @@ import {
} from "../libraries/AccountStorage.sol";
import {FunctionReference} from "../libraries/FunctionReferenceLib.sol";

abstract contract BaseModularAccountLoupe is IPluginLoupe {
abstract contract AccountLoupe is IAccountLoupe {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You probably need to cherry pick this commit out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, I think it changed commits when #13 was force-pushed

Copy link
Collaborator

@jaypaik jaypaik left a comment

Choose a reason for hiding this comment

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

lgtm

@adam-alchemy adam-alchemy changed the base branch from ft_update to spec-update-6 November 29, 2023 23:25
@adam-alchemy adam-alchemy merged commit 883e067 into spec-update-6 Nov 29, 2023
3 checks passed
@adam-alchemy adam-alchemy deleted the adam/install-validity branch November 29, 2023 23:26
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.

4 participants