You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently define ValidationDataView, which is returned by IModularAccountView.getValidationView as:
struct ValidationDataView {
// Whether or not this validation function can be used as a global validation function.bool isGlobal;
// Whether or not this validation function is a signature validator.bool isSignatureValidation;
// Whether or not this validation function is a user operation validation function.bool isUserOpValidation;
// The validation hooks for this validation function.
HookConfig[] validationHooks;
// Execution hooks to run with this validation function.
HookConfig[] executionHooks;
// The set of selectors that may be validated by this validation function.bytes4[] selectors;
}
However, our user-defined value type (UDVT) ValidationConfig is defined as:
/// @dev A packed representation of a validation function and its associated flags./// Consists of the following, left-aligned:/// Module address: 20 bytes/// Entity ID: 4 bytes/// Flags: 1 byte////// Validation flags layout:/// 0b00000___ // unused/// 0b_____A__ // isGlobal/// 0b______B_ // isSignatureValidation/// 0b_______C // isUserOpValidationtype ValidationConfigisbytes25;
Using named booleans in ValidationDataView makes things slightly more friendly for consumers, but since we already return the UDVT HookConfig in the same struct, it might make sense to return a packed bytes1 validationFlags instead, which is more forward compatible incase we want to add additional flags in the future (e.g., isRuntimeValidation).
Proposal:
struct ValidationDataView {
// Validation flags layout:// 0b00000___ // unused// 0b_____A__ // isGlobal// 0b______B_ // isSignatureValidation// 0b_______C // isUserOpValidationbytes1 validationFlags;
// The validation hooks for this validation function.
HookConfig[] validationHooks;
// Execution hooks to run with this validation function.
HookConfig[] executionHooks;
// The set of selectors that may be validated by this validation function.bytes4[] selectors;
}
Curious to hear others' thoughts.
The text was updated successfully, but these errors were encountered:
That makes sense to me. It will require some minor adjustments, but we can make it work. Do we need an unpack function to extract everything for client-side integration?
We currently define
ValidationDataView
, which is returned byIModularAccountView.getValidationView
as:However, our user-defined value type (UDVT)
ValidationConfig
is defined as:Using named booleans in
ValidationDataView
makes things slightly more friendly for consumers, but since we already return the UDVTHookConfig
in the same struct, it might make sense to return a packedbytes1 validationFlags
instead, which is more forward compatible incase we want to add additional flags in the future (e.g.,isRuntimeValidation
).Proposal:
Curious to hear others' thoughts.
The text was updated successfully, but these errors were encountered: