-
Notifications
You must be signed in to change notification settings - Fork 196
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
fix(world): limit call context of CoreSystem
to delegatecall [C-02]
#2111
Conversation
🦋 Changeset detectedLatest commit: 34c019c The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 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 |
CoreSystem
to delegatecallCoreSystem
to delegatecall [C-02]
8faf955
to
123f241
Compare
Depending on whether it is a root or non-root system, the call is performed via `delegatecall` or `call`. | ||
Since Systems are expected to be stateless and only interact with the World state, it is not necessary to prevent direct calls to the systems. | ||
However, since the `CoreSystem` is known to always be registered as a root system in the World, it is always expected to be delegatecalled, | ||
so we made this expectation explicit by reverting if it is not delegatecalled. |
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.
your notes here are great! can we add these notes to LimitedCallContext
as well, so folks know the why behind using this contract/set of modifiers?
8b6961d
to
7695ebb
Compare
this one brought the core module over the size limit as well, blocked on #2046 |
52808d4
to
a66e583
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.
Not blocking but do we have/want tests for these methods to make sure they revert?
a66e583
to
6c0610b
Compare
6c0610b
to
34c019c
Compare
Agree with this and started implementing it but it actually requires a lot of boilerplate for testing that each method reverts as expected, and I didn't find a way to test that no methods can be called directly, so i would leave this for a followup |
No description provided.