-
Notifications
You must be signed in to change notification settings - Fork 166
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(dojo-core): adjust ACL to restore governance without relaxing permissions #2341
Conversation
WalkthroughOhayo, sensei! The changes primarily involve updates to test functions, enhancing contract initialization and ownership checks. New tests were added to enforce ownership constraints, and existing functions were renamed for clarity. Additionally, the logic in the contract implementation was refined to focus on resource ownership rather than account checks. Manifest files were modified to reflect updated class identifiers, ensuring consistency in contract references. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Contract
Caller->>Contract: Initiate contract operation
alt Caller is resource owner
Contract-->>Caller: Operation successful
else Caller is not resource owner
Contract-->>Caller: Panic: Caller is not the owner
end
Recent review detailsConfiguration used: .coderabbit.yaml Files ignored due to path filters (2)
Files selected for processing (19)
Files skipped from review as they are similar to previous changes (6)
Additional comments not posted (25)
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add Documentation and Community
|
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
crates/dojo-core/src/world/errors.cairo (1)
67-69
: Clarify the error message inno_world_owner
.The placeholder
{}
in the error message could be confusing. Consider specifying the action or resource involved.Apply this diff to enhance clarity:
format!("Caller `{:?}` can't perform action on `{}` (not world owner)", caller, target)
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
crates/dojo-core/src/tests/helpers.cairo (1)
47-52
: Ensure proper use of the UUID.The
dojo_init
function retrieves the UUID from theworld
instance but doesn't use it. Ensure this is intentional and consider adding comments for clarity.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2341 +/- ##
==========================================
- Coverage 67.26% 67.25% -0.02%
==========================================
Files 357 357
Lines 46634 46662 +28
==========================================
+ Hits 31367 31381 +14
- Misses 15267 15281 +14 ☔ View full report in Codecov by Sentry. |
Description
In the previous rework on ACLs, we added a constraint to have some functions only callable from an account.
This PR ensures that we are keeping important restriction on permissions granting functions, without relying on the caller being an account.
This restores governance for Dojo worlds.
Summary by CodeRabbit
New Features
Improvements
Configuration Changes
Tests