fix(platform): bind token group authorization#4154
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughChangesToken authorization hardening
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant TokenConfigUpdateTransitionAction
participant TokenConfiguration
participant GroupStore
participant TokenConfigurationValidator
TokenConfigUpdateTransitionAction->>TokenConfiguration: resolve controlling action takers
TokenConfigUpdateTransitionAction->>GroupStore: resolve stored transition group
TokenConfigUpdateTransitionAction->>TokenConfigurationValidator: validate proposed configuration groups
TokenConfigurationValidator-->>TokenConfigUpdateTransitionAction: return validation result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Ready for review — 38 ahead in queue (commit 706f167) |
…roup-authorization # Conflicts: # packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v9.rs # packages/rs-platform-version/src/version/v13.rs
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v4.1-dev #4154 +/- ##
============================================
+ Coverage 87.46% 87.50% +0.03%
============================================
Files 2651 2666 +15
Lines 334868 336713 +1845
============================================
+ Hits 292905 294653 +1748
- Misses 41963 42060 +97
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/validate_token_configuration_groups_exist/mod.rs (1)
44-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocstring is now stale.
The doc comment above (
# Versioningsection) still states this method only "Currently supportsvalidate_token_config_groups_exist_v0for version0", but the dispatch now also routes tovalidate_token_config_groups_exist_v1. Please update the doc to mention v1.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/validate_token_configuration_groups_exist/mod.rs` around lines 44 - 47, Update the # Versioning section of validate_token_config_groups_exist to document support for both validate_token_config_groups_exist_v0 (version 0) and validate_token_config_groups_exist_v1 (version 1), matching the dispatch in the method.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_base_transition_action/state_v1/mod.rs`:
- Around line 88-109: In the validation block using
ModificationOfGroupActionMainParametersNotPermittedError::new, replace the
second event-name argument with the current base-transition action’s distinct
descriptor, while retaining original_group_action.event().event_name() as the
original label and preserving changed_fields.
---
Nitpick comments:
In
`@packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/validate_token_configuration_groups_exist/mod.rs`:
- Around line 44-47: Update the # Versioning section of
validate_token_config_groups_exist to document support for both
validate_token_config_groups_exist_v0 (version 0) and
validate_token_config_groups_exist_v1 (version 1), matching the dispatch in the
method.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b7c3eb63-05b6-4d0f-958f-842c2e28c3f7
📒 Files selected for processing (14)
packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/authorized_action_takers_for_configuration_item/mod.rspackages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/authorized_action_takers_for_configuration_item/v0/mod.rspackages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/validate_token_configuration_groups_exist/mod.rspackages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/validate_token_configuration_groups_exist/v1/mod.rspackages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_base_transition_action/mod.rspackages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_base_transition_action/state_v1/mod.rspackages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_config_update_transition_action/mod.rspackages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_config_update_transition_action/state_v1/mod.rspackages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/config_update/mod.rspackages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/mint/mod.rspackages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rspackages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v4.rspackages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v9.rspackages/rs-platform-version/src/version/v13.rs
…nd error The base-field mismatch error passed the original event name for both the original and modified slots, so the message never said where the confirming transition tried to rebind the action. Include the current contract id and token position in the modified slot. Also update the groups-exist dispatcher docstring to cover v1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Issue being fixed or feature implemented
Keeps grouped token actions and configuration updates bound to their approved scope and current authority. Covers internal review items 115 and 241-248.
What was done?
How Has This Been Tested?
The all-target Clippy run also reaches an unrelated pre-existing DPP factory test warning; the affected library targets are clean with warnings denied.
Breaking Changes
Consensus validation changes activate with protocol version 13. Protocol version 12 retains its existing behavior.
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Tests