Skip to content

Conversation

@QuantumExplorer
Copy link
Member

Issue being fixed or feature implemented:

Structure validation for legacy/identity-based state transitions was returning an empty success result, which obscured the fact that no actual validation was being performed. This made it unclear
whether validation passed because the transition was valid or because validation wasn't implemented.

What was done:

  1. rs-dpp/state_transition/mod.rs: Changed validate_structure for legacy state transitions (DataContractCreate, DataContractUpdate, Batch, IdentityCreate, IdentityTopUp, IdentityCreditWithdrawal,
    IdentityUpdate, IdentityCreditTransfer, MasternodeVote) to return UnsupportedFeatureError instead of an empty validation result. This explicitly signals that client-side structure validation is
    not implemented for these transition types.
  2. rs-sdk/transition/validation.rs: Updated ensure_valid_state_transition_structure to allow UnsupportedFeatureError to pass through without blocking broadcast. This allows legacy state
    transitions to still be broadcast while address-based transitions get proper structure validation with real error reporting.

The platform still performs full validation during execution, so this change only affects client-side pre-broadcast checks.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 10, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/dontAssumeStructureValidation

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.

@github-actions
Copy link

✅ gRPC Query Coverage Report

================================================================================
gRPC Query Coverage Report - NEW QUERIES ONLY
================================================================================

Total queries in proto: 49
Previously known queries: 47
New queries found: 2

================================================================================

New Query Implementation Status:
--------------------------------------------------------------------------------
✓ getAddressInfo                                /home/runner/work/platform/platform/packages/rs-sdk/src/platform/query.rs
✓ getAddressesInfos                             /home/runner/work/platform/platform/packages/rs-sdk/src/platform/fetch_many.rs

================================================================================
Summary:
--------------------------------------------------------------------------------
New queries implemented: 2 (100.0%)
New queries missing: 0 (0.0%)

Total known queries: 49
  - Implemented: 46
  - Not implemented: 2
  - Excluded: 1

Not implemented queries:
  - getConsensusParams
  - getTokenPreProgrammedDistributions

@github-actions
Copy link

✅ DashSDKFFI.xcframework built for this PR.

SwiftPM (host the zip at a stable URL, then use):

.binaryTarget(
  name: "DashSDKFFI",
  url: "https://your.cdn.example/DashSDKFFI.xcframework.zip",
  checksum: "feadd17bf77ce1af91bbf7f826b9c2b3e580f95e99ae3b7a31d0c885e416341f"
)

Xcode manual integration:

  • Download 'DashSDKFFI.xcframework' artifact from the run link above.
  • Drag it into your app target (Frameworks, Libraries & Embedded Content) and set Embed & Sign.
  • If using the Swift wrapper package, point its binaryTarget to the xcframework location or add the package and place the xcframework at the expected path.

@QuantumExplorer QuantumExplorer changed the title fix(dpp): Return UnsupportedFeatureError for legacy state transition structure validation fix(dpp): return UnsupportedFeatureError for legacy state transition structure validation Dec 11, 2025
fn validate_structure(
&self,
platform_version: &PlatformVersion,
) -> crate::validation::SimpleConsensusValidationResult {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe

Suggested change
) -> crate::validation::SimpleConsensusValidationResult {
) -> ConsensusValidationResult<bool> {

where bool:

  • true - correct
  • false - undecided

Copy link
Member Author

Choose a reason for hiding this comment

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

This is outside the normal pattern and confusing. The validation result would pass, but the bool would say it's valid? It's three tiers and hurts my brain.

@QuantumExplorer
Copy link
Member Author

I'm going to merge this in for now, soonish we will move structure validation from drive-abci to dpp.

@QuantumExplorer QuantumExplorer merged commit f682e13 into feat/platformAddresses Dec 16, 2025
7 of 8 checks passed
@QuantumExplorer QuantumExplorer deleted the fix/dontAssumeStructureValidation branch December 16, 2025 21:47
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.

3 participants