Skip to content

chore(dpp): remove orphaned JSON schemas and dead wasm-dpp tests#3470

Open
thephez wants to merge 6 commits intov3.1-devfrom
fix/schema-public-key-max-items-discrepancy
Open

chore(dpp): remove orphaned JSON schemas and dead wasm-dpp tests#3470
thephez wants to merge 6 commits intov3.1-devfrom
fix/schema-public-key-max-items-discrepancy

Conversation

@thephez
Copy link
Copy Markdown
Collaborator

@thephez thephez commented Apr 9, 2026

Issue being fixed or feature implemented

rs-dpp contained JSON schema files for identity, data contract, and document state transitions that were never loaded by any code — validation for these transitions moved entirely to native Rust. These orphaned files were misleading (e.g. identityUpdate.json declared addPublicKeys.maxItems: 10 while Rust enforces 6) and would inevitably drift further from the actual implementation. This was causing confusion when updating docs also.

What was done?

  • Removed all 13 orphaned JSON schema files under packages/rs-dpp/src/schema/:
    • All identity schemas: identity.json, publicKey.json, all stateTransition/ files including asset lock proofs
    • Data contract schemas: dataContractCreate.json, dataContractUpdate.json
    • Document schema: documentBase.json
  • Deleted two fully-skipped wasm-dpp integration test files that only existed to reference identity.json:
    • validatePublicKeysState.spec.js
    • validateIdentityUpdateTransitionStateFactory.spec.js

The four document transition schemas loaded via include_str! in schema/mod.rs (base.json, create.json, replace.json, documentsBatch.json) are retained as they are actively used.

How Has This Been Tested?

The deleted JS tests were describe.skip and covered by existing Rust tests in rs-drive-abci:

  • test_identity_update_duplicate_key_ids_to_disable
  • test_identity_update_wrong_revision
  • test_identity_update_disabling_nonexistent_key
  • test_identity_update_too_many_keys_to_disable
  • Strategy tests in update_identities_tests.rs

No new tests added — this is pure deletion of dead code.

Breaking Changes

None.

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

  • Chores
    • Removed schema definition files for identity structures, documents, data contracts, and related state transitions.
    • Removed associated integration test files for identity state transition validation.

thephez and others added 4 commits April 9, 2026 15:38
… of 6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
identityCreate.json and identityUpdate.json are not referenced anywhere
in the codebase; validation is handled entirely by Rust code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validation for these state transitions moved entirely to Rust.
identity.json is retained as it is still referenced in test fixtures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both test suites were describe.skip and fully covered by Rust tests in
rs-drive-abci and rs-dpp. identity.json had no other references.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thephez thephez requested a review from QuantumExplorer as a code owner April 9, 2026 20:04
@github-actions github-actions bot added this to the v3.1.0 milestone Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 413c53d5-75b8-4356-9a3c-bffcd864c1b0

📥 Commits

Reviewing files that changed from the base of the PR and between 6f72a64 and d7333f9.

📒 Files selected for processing (15)
  • packages/rs-dpp/src/schema/data_contract/v0/stateTransition/dataContractCreate.json
  • packages/rs-dpp/src/schema/data_contract/v0/stateTransition/dataContractUpdate.json
  • packages/rs-dpp/src/schema/document/v0/documentBase.json
  • packages/rs-dpp/src/schema/identity/v0/identity.json
  • packages/rs-dpp/src/schema/identity/v0/publicKey.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/assetLockProof/chainAssetLockProof.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/assetLockProof/instantAssetLockProof.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityCreate.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityCreditTransfer.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityCreditWithdrawal.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityTopUp.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityUpdate.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/publicKey.json
  • packages/wasm-dpp/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validateIdentityUpdateTransitionStateFactory.spec.js
  • packages/wasm-dpp/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validatePublicKeysState.spec.js
💤 Files with no reviewable changes (15)
  • packages/rs-dpp/src/schema/data_contract/v0/stateTransition/dataContractUpdate.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/assetLockProof/instantAssetLockProof.json
  • packages/wasm-dpp/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validatePublicKeysState.spec.js
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityCreate.json
  • packages/rs-dpp/src/schema/identity/v0/publicKey.json
  • packages/rs-dpp/src/schema/document/v0/documentBase.json
  • packages/rs-dpp/src/schema/identity/v0/identity.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityUpdate.json
  • packages/rs-dpp/src/schema/data_contract/v0/stateTransition/dataContractCreate.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityTopUp.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/assetLockProof/chainAssetLockProof.json
  • packages/wasm-dpp/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validateIdentityUpdateTransitionStateFactory.spec.js
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityCreditTransfer.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/publicKey.json
  • packages/rs-dpp/src/schema/identity/v0/stateTransition/identityCreditWithdrawal.json

📝 Walkthrough

Walkthrough

Removed 15 JSON Schema definition files and 2 test suites totaling approximately 1,214 lines. The deleted schemas validated data contract, document, identity, and associated state transition objects across the rs-dpp package.

Changes

Cohort / File(s) Summary
Data Contract Schemas
packages/rs-dpp/src/schema/data_contract/v0/stateTransition/dataContractCreate.json, dataContractUpdate.json
Removed JSON Schema definitions for data contract create (type 0) and update (type 4) state transitions, including field constraints and signature validation rules.
Document Schemas
packages/rs-dpp/src/schema/document/v0/documentBase.json
Removed document base schema defining core document structure with protocol versioning, identifier, typing, revision, and timestamp/block-height fields.
Identity Core Schemas
packages/rs-dpp/src/schema/identity/v0/identity.json, publicKey.json
Removed base identity schema (with protocolVersion, id, publicKeys, balance, revision) and public key schema with type-dependent byte-length validation rules.
Asset Lock Proof Schemas
packages/rs-dpp/src/schema/identity/v0/stateTransition/assetLockProof/chainAssetLockProof.json, instantAssetLockProof.json
Removed asset lock proof schemas for chain-based (type 1) and instant (type 0) proof validation including height/output constraints.
Identity State Transition Schemas
packages/rs-dpp/src/schema/identity/v0/stateTransition/identityCreate.json, identityCreditTransfer.json, identityCreditWithdrawal.json, identityTopUp.json, identityUpdate.json, publicKey.json
Removed state transition schemas for identity operations (create, credit transfer/withdrawal, top-up, update) and public key management, including type constants, field constraints, and signature validation.
Integration Tests
packages/wasm-dpp/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validateIdentityUpdateTransitionStateFactory.spec.js, validatePublicKeysState.spec.js
Removed skipped test suites for identity update transition state validation and public key validation, including fixture setup and error case assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With hop and cheer, we bid goodbye,
To schemas old that once stood high,
Fifteen files now softly fade,
Tests retired from their parade,
The codebase hops to brighter days! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removal of orphaned JSON schemas and dead tests from the dpp package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/schema-public-key-max-items-discrepancy

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thepastaclaw
Copy link
Copy Markdown
Collaborator

thepastaclaw commented Apr 9, 2026

⏳ Review in progress (commit cb57e99)

Copy link
Copy Markdown
Collaborator

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

I verified the PR against the source at d7333f9e9599b7c4eb54be3e92ea825b082112a3. The change is deletion-only: it removes packages/rs-dpp/src/schema/identity/v0/identity.json plus two describe.skip wasm tests that were the only consumers of that file, while the active Rust schema implementation in packages/rs-dpp/src/schema/identity/v0/identity.rs remains intact. I did not find any runtime regressions, broken references, or consensus-critical issues in this diff.

Reviewed commit: d7333f9

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.83%. Comparing base (85a7117) to head (cb57e99).

Additional details and impacted files
@@            Coverage Diff            @@
##           v3.1-dev    #3470   +/-   ##
=========================================
  Coverage     84.83%   84.83%           
=========================================
  Files          2476     2476           
  Lines        267733   267733           
=========================================
  Hits         227123   227123           
  Misses        40610    40610           
Components Coverage Δ
dpp 81.99% <ø> (ø)
drive 84.21% <ø> (ø)
drive-abci 87.46% <ø> (ø)
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.10% <ø> (ø)
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 55.66% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

I re-reviewed this PR at 0d0a8cd4 against the checked-out tree. The change remains a pure deletion of 13 unused JSON schema files plus 2 skipped wasm-dpp tests, and the live schema loading path in packages/rs-dpp/src/schema/mod.rs still references only the retained document transition schemas. I did not find any correctness, security, consensus, or test-coverage regressions caused by these deletions.

Reviewed commit: 0d0a8cd

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.

2 participants