platform
platform copied to clipboard
fix!: data contract transition validation issues
Issue being fixed or feature implemented
Before production release we need to review and fix if necessary all critical paths in Platform. State transition validation and execution logic, specifically Data Contract Create and Update transitions are one of them.
What was done?
- Fixed misuse of encryption bounded key rules instead of decryption
- Introduced
assert_matches
to simplify testing - Moved index update validation to
IndexLevel.validate_update
- Moved schema compatibility validation to
DocumentTypeRef
and perform complete update validation inDocumentTypeRef.validate_update
. - Fixed missing document type configuration options validation
- Optimised schema compatibility validation in case if schemas are the same
- Moved data contact update validation to
DataContract.validate_update
- Fixed missing data contract owner validation
- Fixed missing removed document type validation
- Optimised $defs compatibility validation in case if it's not changed
- Fixed invalid data contract missing document type consensus error
- Fixed non-handled internal error in check tx handler
- Fixed skipping non expected state transition results instead of block rejection
- Fixed inconsistent state transition decoding logic on check tx
- Do not verify fees on check tx for invalid ST
- Fixed
CheckTxResult
is missing in case of asset lock based transition on check tx - Fixed missing data contract initial version validation
- Optimised data contract validation before state validation for Data Contract Create Transition
How Has This Been Tested?
Covered Data Contract Create and Update transitions validation with tests
Breaking Changes
Data Contract Create and Update transitions validation logic is changed so previously created block chain data might not be valid anymore.
Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e tests
- [x] I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
- [x] I have made corresponding changes to the documentation if needed
For repository code-owners and collaborators only
- [x] I have assigned this pull request to a milestone