-
Notifications
You must be signed in to change notification settings - Fork 176
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
chore(sozo): update slot
due to breaking changes
#2530
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2530 +/- ##
==========================================
+ Coverage 69.32% 69.35% +0.03%
==========================================
Files 388 388
Lines 49988 49999 +11
==========================================
+ Hits 34654 34677 +23
+ Misses 15334 15322 -12 ☔ View full report in Codecov by Sentry. |
WalkthroughOhayo, sensei! This pull request introduces several modifications primarily to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 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 using PR comments)
Other keywords and placeholders
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 and nitpick comments (3)
bin/sozo/src/commands/options/account/controller.rs (3)
64-72
: Ohayo, sensei! Excellent logging and error handling improvements!The added trace logging for loading Slot credentials enhances the function's traceability. The updated contract address handling using pattern matching is more idiomatic Rust and provides a clearer error message when no controller is associated with the account.
Consider adding a log message just before the
bail!
call to provide more context in the logs:trace!(target: "account::controller", "No Controller found for account."); bail!("No Controller is associated with this account.");
220-221
: Ohayo, sensei! Fantastic policy logging enhancement!The addition of detailed trace logging for each policy in the
policies_from_abis
function is excellent. It provides comprehensive information about each policy, including the contract tag, target address (in hex format), and method name. This level of detail will be invaluable for debugging and auditing policy creation.Consider using the
%x
format specifier for the target address to ensure consistent hex formatting:trace!(target: "account::controller", tag = contract_tag, target = %format!("0x{:x}", policy.target), method = %policy.method, "Adding policy");
193-200
: Ohayo, sensei! Great special policy logging!The addition of trace logging for the declare transaction and UDC deployment policies is a valuable improvement. These logs provide clear visibility into the addition of these special policies, which is crucial for understanding the full scope of policies being applied.
To maintain consistency with the detailed logging in
policies_from_abis
, consider adding more details to these log messages:trace!(target: "account::controller", target = %format!("0x{:x}", user_address), method = "__declare_transaction__", "Adding declare transaction policy"); trace!(target: "account::controller", target = %format!("0x{:x}", UDC_ADDRESS), method = "deployContract", "Adding UDC deployment policy");
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (3)
- Cargo.toml (1 hunks)
- bin/sozo/src/commands/options/account/controller.rs (7 hunks)
- crates/katana/controller/src/lib.rs (7 hunks)
✅ Files skipped from review due to trivial changes (1)
- Cargo.toml
🧰 Additional context used
🔇 Additional comments (11)
crates/katana/controller/src/lib.rs (5)
30-35
: Ohayo, sensei! LGTM on the account structure update.The change from
Account
toAccountInfo
and the updated retrieval logic for credentials and contract address align well with the new user account structure. This modification streamlines the handling of user data and should improve code clarity.
39-39
: Ohayo again, sensei! Nice catch on updating the logging.The adjustment to log the correct contract address is a good attention to detail. It ensures consistency with the earlier changes and maintains accurate logging.
54-54
: Konnichiwa, sensei! Solid update on contract address handling.The change to use the existing
contract_address
instead of generating a new one is crucial. It ensures that we're working with the correct, pre-existing contract address associated with the account. This modification maintains consistency between theAccountInfo
and the genesis allocation.
88-89
: Ohayo once more, sensei! Consistency is key, and you've nailed it.The updates to credential and contract address retrieval in
add_controller_account_json
mirror the changes inadd_controller_account_inner
. This consistency ensures that both functions work harmoniously with the newAccountInfo
structure. Well done on maintaining uniformity across related functions!
225-239
: Sugoi, sensei! Excellent work on updating the test case.The modifications to the test case for
add_controller_account
are spot-on. By updating the test data structure to useAccountInfo
and including all necessary fields, you've ensured that the test accurately reflects the changes in the main code. This comprehensive update will help maintain the reliability of our testing suite. Great job on keeping the tests in sync with the code changes!Also applies to: 244-244
bin/sozo/src/commands/options/account/controller.rs (6)
3-3
: Ohayo, sensei! Nice import update!The addition of
bail
fromanyhow
suggests an improvement in error handling. This change is likely to enhance the code's ability to handle and report errors more effectively.
37-39
: Ohayo, sensei! Documentation clarity level up!The rephrasing of the documentation comment enhances clarity without changing the underlying meaning. It now better explains the behavior of the Controller account creation process.
Line range hint
79-93
: Ohayo, sensei! Superb session logging enhancements!The additional logging in the session handling part of
create_controller
significantly improves observability. The use of structured logging with details about session expiration, policy counts, and changes is excellent. This will greatly aid in debugging and understanding the session creation and update process.
103-103
: Ohayo, sensei! Excellent new session logging!The added log message for new session creation is well-crafted. It includes crucial details like the username and chain ID (in hex format), which will be invaluable for tracking session creation across different environments.
154-154
: Ohayo, sensei! Nice policy collection logging!The addition of a trace log message in the
collect_policies
function is a great touch. It provides a quick way to verify the number of policies extracted from the project, which can be crucial for debugging and ensuring the correct setup.
Line range hint
1-300
: Ohayo, sensei! Overall excellent improvements to logging and error handling!The changes in this file significantly enhance the observability and robustness of the code. The addition of detailed, structured logging throughout the file will greatly aid in debugging and understanding the flow of execution, especially in complex scenarios involving session creation and policy management.
Key improvements include:
- Enhanced error handling with the addition of
bail!
fromanyhow
.- More detailed and structured logging across various functions.
- Improved documentation clarity.
- Consistent use of the
target: "account::controller"
in log messages for better log filtering.These changes will make it easier to maintain and troubleshoot the code in the future. Great work on improving the code quality!
slot
due to breaking changesslot
due to breaking changes
ref cartridge-gg/slot#104, cartridge-gg/slot#113
for this fix to work, you need to update
slot
to0.19.0
and reauthenticate.Summary by CodeRabbit
New Features
slot
to enhance functionality.Bug Fixes
Documentation
Tests