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: modify spec to leave arbitrary data params open-ended #170

Merged
merged 4 commits into from
Aug 30, 2024

Conversation

Zer0dot
Copy link
Contributor

@Zer0dot Zer0dot commented Aug 29, 2024

Motivation

Currently, the spec dictates the encoding of certain arbitrary bytes and bytes[] parameters. However, it may be beneficial to leave the encoding schemes up to individual accounts.

This clarifies that accounts have the option to require that these parameters be encoded as they see fit, as long as the behaviour specified in the spec is upheld.

Solution

Mostly, this change just removes a few lines of comments from the spec. I also took the liberty to remove some TODOs which are already complete, and add comments explaining the HookConfig and ValidationConfig data types.

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.

Thanks for the misc cleanup too!

Comment on lines 103 to 110
/// Flags: 1 byte
type ValidationConfig is bytes25;

type HookConfig is bytes26;
/// A packed representation of a hook function and its associated flags.
/// Consists of the following, left-aligned:
/// Module address: 20 bytes
/// Entity ID: 4 bytes
/// Flags: 1 byte
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 worth putting the flags encoding here, too. We can probably just copy/paste from the corresponding library files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! I didn't want to bloat it but in hindsight, it doesn't really make sense to just say "flags" without specifying which flags?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in e328d58

/// @param moduleInstallData Optional data to be decoded and used by the module to setup initial module data
/// for the modular account.
/// @param manifest the manifest describing functions to install.
/// @param moduleInstallData Optional data to be arbitrarily used by the account to handle the initial execution setup.
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we phrase it as "Optional data to be used by the account to handle the initial execution setup. Data encoding is implementation-specific." ? I think "arbitrarily use" has really a connotation of being really lax, and we still want to encourage similar-ish use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense! Addressing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8f719fd

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!

@Zer0dot Zer0dot merged commit 7774500 into develop Aug 30, 2024
3 checks passed
@Zer0dot Zer0dot deleted the zer0dot/spec/install-data-rewording branch August 30, 2024 16:38
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.

2 participants