-
Notifications
You must be signed in to change notification settings - Fork 49
fix(drive-abci): version fix for decryption bounded key validation in contract bounds#2996
fix(drive-abci): version fix for decryption bounded key validation in contract bounds#2996pauldelucia wants to merge 1 commit intov3.0-devfrom
Conversation
Issue being fixed or feature implemented
Fixes bug where validate_identity_public_key_contract_bounds was incorrectly calling requires_identity_encryption_bounded_key() instead of requires_identity_decryption_bounded_key() for the DECRYPTION case in SingleContractDocumentType bounds validation
What was done?
- Added v1 implementation of
validate_identity_public_key_contract_boundswith the fix - Created
DRIVE_ABCI_VALIDATION_VERSIONS_V8withvalidate_identity_public_key_contract_bounds: 1 - Added Protocol Version 12 (PLATFORM_V12) using the new validation versions
How Has This Been Tested?
cargo test
Breaking Changes
Checklist:
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- I have added or updated relevant unit/integration/functional/e2e tests
- I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
- I have made corresponding changes to the documentation if needed
For repository code-owners and collaborators only
- I have assigned this pull request to a milestone
Summary by CodeRabbit
-
New Features
- Added Platform Version 12 support with enhanced validation capabilities.
- Introduced updated identity public key contract bounds validation with expanded version support.
-
Bug Fixes
- Fixed decryption bounded key validation issue in identity public key contract bounds checking.
Tip: You can customize this high-level summary in your review settings.
WalkthroughWalkthroughThe changes introduce platform version 12 support by adding v1 validation logic for identity public key contract bounds, creating DRIVE_ABCI_VALIDATION_VERSIONS_V8 with updated validation versioning, and updating the latest protocol version reference from v11 to v12 across the codebase. Changes
Sequence Diagram(s)
sequenceDiagram
participant Validator as v1 Validator participant Drive as Drive/Storage participant Contract as Contract Data participant Bounds as Bounds Check participant Result as Result Builder Validator->>Validator: For each identity_public_key Validator->>Bounds: Extract contract bounds alt Contract bounds present Bounds->>Drive: Fetch referenced contract alt Contract exists Drive-->>Bounds: Contract data Bounds->>Contract: Resolve bound type (SingleContract or SingleContractDocumentType) alt SingleContractDocumentType Contract->>Drive: Resolve document type by name alt Document type exists Drive-->>Contract: Document type data else Contract-->>Result: InvalidDocumentTypeError end end Bounds->>Bounds: Check key purpose (ENCRYPTION/DECRYPTION) alt Purpose valid Bounds->>Drive: Query for unique key conflicts alt Conflict exists Drive-->>Result: IdentityPublicKeyAlreadyExistsError else Drive-->>Result: Validation pass end else Bounds-->>Result: InvalidKeyPurposeError end else Drive-->>Result: DataContractNotPresentError end else Bounds-->>Result: Empty result (no bounds) end Result->>Validator: Merge per-key results Validator-->>Validator: Return combined validation result Estimated code review effort3 (Moderate) | ~20 minutes Poem
Pre-merge checks | 2 | 1Failed checks (1 warning)
Passed checks (2 passed)
Tip: You can configure your own custom pre-merge checks in the settings. Finishing touches
Recent nitpick comments
Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro Files selected for processing (7)
Additional context usedPath-based instructions (1)**/*.rsCodeRabbit inference engine (CLAUDE.md)
Files:
Learnings (18)Common learningsLearnt from: QuantumExplorerLearnt from: QuantumExplorer
Learnt from: shumkovLearnt from: shumkovLearning: 2024-10-08T13:28:03.529ZLearnt from: QuantumExplorerApplied to files:
Learning: 2024-11-20T10:01:50.837ZLearnt from: QuantumExplorer
Applied to files:
Learning: 2025-11-25T13:10:23.481ZLearnt from: CRApplied to files:
Learning: 2024-10-04T09:08:47.901ZLearnt from: shumkovApplied to files:
Learning: 2024-10-18T15:39:51.172ZLearnt from: lklimek
Applied to files:
Learning: 2024-11-20T16:05:40.200ZLearnt from: QuantumExplorer
Applied to files:
Learning: 2024-10-06T16:11:34.946ZLearnt from: QuantumExplorerApplied to files:
Learning: 2024-10-03T11:51:06.980ZLearnt from: shumkovApplied to files:
Learning: 2024-11-20T20:43:41.185ZLearnt from: QuantumExplorerApplied to files:
Learning: 2024-10-21T01:03:42.458ZLearnt from: QuantumExplorerApplied to files:
Learning: 2024-10-04T14:16:05.798ZLearnt from: lklimekApplied to files:
Learning: 2025-11-25T13:10:23.481ZLearnt from: CRApplied to files:
Learning: 2025-05-28T16:22:26.334ZLearnt from: QuantumExplorerApplied to files:
Learning: 2024-10-09T00:22:57.778ZLearnt from: shumkovApplied to files:
Learning: 2024-09-29T13:13:54.230ZLearnt from: shumkovApplied to files:
Learning: 2025-04-11T09:08:05.652ZLearnt from: pauldeluciaApplied to files:
Learning: 2025-06-18T03:44:14.385ZLearnt from: QuantumExplorerApplied to files:
Code graph analysis (2)packages/rs-drive-abci/src/execution/validation/state_transition/common/validate_identity_public_key_contract_bounds/mod.rs (1)
packages/rs-drive-abci/src/execution/validation/state_transition/common/validate_identity_public_key_contract_bounds/v1/mod.rs (1)
Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
Additional comments (15)
Tip: You can disable this entire section by setting 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 |