-
Notifications
You must be signed in to change notification settings - Fork 185
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(world): add FunctionSignatures
offchain table
#1575
Conversation
🦋 Changeset detectedLatest commit: cdc056e The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
bdd4b21
to
491835f
Compare
491835f
to
d15144d
Compare
@@ -23,9 +23,9 @@ interface IWorldRegistrationSystem { | |||
|
|||
function registerRootFunctionSelector( |
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.
Should this be just “register root function”? And the non root one “register function”?
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 personally find it more intuitive to keep the selector, since what happens is that a new function selector is added to the world contract (it's debatable, but there isn't really a new function added to the world, the function is part of the system and it was already possible to call it before a function selector was registered for 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.
but we are effectively adding a function to the world, regardless of how it’s implemented
I kinda like that “register function” communicates “world is mutable/extendable”
but happy to keep as is if you feel strongly
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.
In my mind we're just adding a "link" to an existing function by adding a new "function selector" to the World here. The World was extended when the system was registered (and it's even cheaper to call a function via the World's call
function than going the indirection over the "function selector link" in the World)
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.
ohh I see, we're aliasing a function's name? I thought this is what system registration used to enable you to call the system methods via the world
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.
Beaut!
4aab3cf
to
d094f5b
Compare
d15144d
to
4c9608c
Compare
FunctionSignatures
offchain table
packages/world/src/modules/core/implementations/WorldRegistrationSystem.sol
Outdated
Show resolved
Hide resolved
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.
✅ (only gas report changed since last approval)
The FunctionSelectors offchain table now stores a mapping from function selector to signature for all methods registered in the World. This will enable the automatic generation of interfaces for a given world address in the future.