feat: [v0.8-develop, experimental] Remove function id #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Function IDs act as a replacement for function selectors by allowing an internal switching mechanism while preserving fixed names for plugin functions. However, they are unfamiliar to newer solidity developers, who may not understand how to handle function dispatching, and present an overhead for accounts to maintain in their mappings.
This is an experimental implementation to gather feedback on the proposed change.
Solution
FunctionReferencetype, since interfaces are sufficient descriptors under this scheme.Caveats
To replicate the behavior of multiple implementations of a plugin function, plugins may choose to switch based on the selector in calldata (or
userOp.callData). However, this is only reliable for functions defined by the plugin, or otherwise known by the plugin at compile time. If the plugin is used as a dependency validator for another plugin, the selectors present there will not be known to the plugin, and switching will have to fall to a default case or fail. Not all validation plugins may have a semantically meaningful default case.More testing is needed to determine whether or not this caveat presents a problem for the expected use cases of validation functions.
To-do