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

[Improvement] Surface encoding of arguments to onInstall and onUninstall #21

Open
jaypaik opened this issue Dec 18, 2023 · 1 comment
Open

Comments

@jaypaik
Copy link
Contributor

jaypaik commented Dec 18, 2023

IPlugin defines onInstall and onUninstall as such:

/// @notice Initialize plugin data for the modular account.
/// @dev Called by the modular account during `installPlugin`.
/// @param data Optional bytes array to be decoded and used by the plugin to setup initial plugin data for the modular account.
function onInstall(bytes calldata data) external;

/// @notice Clear plugin data for the modular account.
/// @dev Called by the modular account during `uninstallPlugin`.
/// @param data Optional bytes array to be decoded and used by the plugin to clear plugin data for the modular account.
function onUninstall(bytes calldata data) external;

bytes calldata is used because we expect different plugins to receive different shapes of data when initializing and cleaning up. However, there is no canonical way of determining how to encode this data from the client, without prior knowledge of how to encode it (e.g., access to the source code or documentation).

Perhaps this can be surfaced in pluginMetadata(), but more exploration needs to be done on the best format the encoding scheme should be returned. Ideally, the format should be easily parsable by client SDKs today.

@fangting-alchemy
Copy link

See huge value to ask plugins to provide data structures for installation/uninstallation for off-chain clients/services.

With an ongoing discussion in the TG channel about what data lives where (pluginMetadata or pluginManifest), it's worth some careful thoughts on where to surface those data.

Considering the separation of the two concepts:

  • pluginMetadata hosts view data that can be managed/updated by the plugin devs.
  • pluginManifest manages the immutable plugin installation instructions.

It might make more sense to include them in the pluginManifest.

@jaypaik jaypaik added the good first issue Good for newcomers label Dec 21, 2023
@jaypaik jaypaik added this to the Missing features milestone Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants