Skip to content
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

fix!: data contract transition validation issues #1835

Merged
merged 52 commits into from
May 15, 2024

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented May 3, 2024

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 in DocumentTypeRef.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:

  • 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

shumkov added 26 commits May 3, 2024 13:28
@shumkov shumkov marked this pull request as ready for review May 10, 2024 16:08
@shumkov shumkov changed the title fix: misc data contract validation issues fix!: data contract transition validation issues May 13, 2024
@shumkov shumkov added this to the v1.0.0 milestone May 13, 2024
Copy link
Contributor

@QuantumExplorer QuantumExplorer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@shumkov shumkov merged commit c04d6ac into v1.0-dev May 15, 2024
75 checks passed
@shumkov shumkov deleted the fix/data-contract-validation branch May 15, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants