-
Notifications
You must be signed in to change notification settings - Fork 25
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: [v0.8-develop] remove execute from plugin #65
Conversation
e21f450
to
72be4f4
Compare
02d099e
to
b680f75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just one question!
/// @param data The calldata to send to the account. | ||
/// @param authorization The authorization data to use for the call. The first 21 bytes specifies which runtime | ||
/// validation to use, and the rest is sent as a parameter to runtime validation. | ||
function executeWithAuthorization(bytes calldata data, bytes calldata authorization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious to hear your thoughts on why you prefer the new function to be part of the standard executor rather than an extension executor :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I don't have a strict reasoning - I think we could split it out, or we could try to bring together all of the required account functions into one interface for simplicity. I think I'm leaning more towards the latter to make it easier to read the spec, but open to discussing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am more lean towards to split it out.
StandardExecutor indicates the functions here are following a certain standard (ERC-4337).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically the functions in IStandardExecutor
are only standardized in ERC-6900, but 6900 also requires the plugin installation functions, which are in a separate interface IPluginManager
.
As for executeWithAuthorization
, it's something that all 6900 compliant accounts will need to implement after this spec change. Do y'all have any suggestions for what to name an interface that only holds this one function? Or how to rename IStandardExecutor
or other existing account interfaces to hold it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually to rethink on this, especially since executeWithAuthorization is something that all 6900 compliant accounts will need to implement. We can just keep it in there.
72be4f4
to
aeb416b
Compare
b680f75
to
7cb19a4
Compare
.solhint-test.json
Outdated
@@ -9,7 +9,7 @@ | |||
"max-line-length": ["error", 120], | |||
"max-states-count": ["warn", 30], | |||
"modifier-name-mixedcase": ["error"], | |||
"private-vars-leading-underscore": ["error"], | |||
"private-vars-leading-underscore": "off", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm why do we need to change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh tests, yeah those have been annoying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we fix the tests instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rolled back the styling change, and fixed the tests
aeb416b
to
c872746
Compare
07b307a
to
bfdf5b5
Compare
c872746
to
83a2ddb
Compare
bfdf5b5
to
67b7088
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a question.
83a2ddb
to
4d2390b
Compare
29055a9
to
0aefb0f
Compare
0aefb0f
to
c9fcabf
Compare
Motivation
The function
executeFromPlugin
andexecuteFromPluginExternal
, along with the manifest fields associated with these functions, were created before we had multiple validation function support & better management of pre-validation hooks, as a way to allow cross-plugin and plugin-to-external-contract interactions.With multi-validation, it is no longer necessary to have these two parallel paths for performing calls from plugins. The "permitted call" authorization path still exists via the fallback and native functions, and any function wishing to invoke external contracts can simply ask for permission to validate
execute
/executeBatch
, and validate itself.Additionally,
executeFromPluginExternal
required accounts to have some opinionated access control functions built-in as part of the standard. This type of access control management is best left to actual plugin implementations, and with the possibility to install pre-validation hooks at the same time as validations via #64, the same type of controls can be placed on any plugin requesting access toexecute
/executeBatch
at install time.Solution
executeFromPlugin
andexecuteFromPluginExternal
from the account, and deleteIPluginExecutor
.executeWithAuthorization
(part of multi-validation) out toIStandardExecutor
.executeFromPlugin
+executeFromPluginExternal
to use the permitted call flow and/orexecuteWithAuthorization
, to show the functional equivalence.executeFromPluginExternal
.public
state variable for a plugin manifest, this results in the errorThe struct has all its members omitted, therefore the getter cannot return any values.
. To address this, the fields are made internal, and the linter is updated to not require renaming all instances of these.Future work