-
Notifications
You must be signed in to change notification settings - Fork 45
fix(drive-abci): version fix for decryption bounded key validation in contract bounds #2996
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
base: v3.0-dev
Are you sure you want to change the base?
Conversation
📝 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 effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed 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 used📓 Path-based instructions (1)**/*.rs📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (18)📓 Common learnings📚 Learning: 2024-10-08T13:28:03.529ZApplied to files:
📚 Learning: 2024-11-20T10:01:50.837ZApplied to files:
📚 Learning: 2025-11-25T13:10:23.481ZApplied to files:
📚 Learning: 2024-10-04T09:08:47.901ZApplied to files:
📚 Learning: 2024-10-18T15:39:51.172ZApplied to files:
📚 Learning: 2024-11-20T16:05:40.200ZApplied to files:
📚 Learning: 2024-10-06T16:11:34.946ZApplied to files:
📚 Learning: 2024-10-03T11:51:06.980ZApplied to files:
📚 Learning: 2024-11-20T20:43:41.185ZApplied to files:
📚 Learning: 2024-10-21T01:03:42.458ZApplied to files:
📚 Learning: 2024-10-04T14:16:05.798ZApplied to files:
📚 Learning: 2025-11-25T13:10:23.481ZApplied to files:
📚 Learning: 2025-05-28T16:22:26.334ZApplied to files:
📚 Learning: 2024-10-09T00:22:57.778ZApplied to files:
📚 Learning: 2024-09-29T13:13:54.230ZApplied to files:
📚 Learning: 2025-04-11T09:08:05.652ZApplied to files:
📚 Learning: 2025-06-18T03:44:14.385ZApplied 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 |
Issue being fixed or feature implemented
Fixes bug where
validate_identity_public_key_contract_boundswas incorrectly callingrequires_identity_encryption_bounded_key()instead ofrequires_identity_decryption_bounded_key()for the DECRYPTION case in SingleContractDocumentType bounds validationWhat was done?
validate_identity_public_key_contract_boundswith the fixDRIVE_ABCI_VALIDATION_VERSIONS_V8withvalidate_identity_public_key_contract_bounds: 1How Has This Been Tested?
cargo test
Breaking Changes
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.