Repository navigation
Description
PastaClaw flagged this while reviewing #6013, where it was deferred to a follow-up instead of being fixed in that pull request. This issue tracks the follow-up.
Expose fresh-contract position validation through DPP (suggestion)
Where: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_create/basic_structure/v3/mod.rs:43-54 at 48cee32ab822:
Lines 43 to 54 in 48cee32
| // Nothing is stored yet, so every object is one the contract gains | |
| let data_contract = self.data_contract(); | |
| let judge = MemberPositionOrder::new(data_contract.schema_defs()); | |
| let error = data_contract | |
| .document_schemas() | |
| .values() | |
| .find_map(|schema| judge.first_error_of_document_type(None, schema)) | |
| .or_else(|| { | |
| judge | |
| .first_error_of_definitions(None) | |
| .map(|(_, error)| error) | |
| }); |
The PV15 registration check is assembled only in the ABCI basic-structure validator.
DataContractFactoryV0::create_with_idconstructs a contract withtry_from_platform_versioned(..., true, ...), but the DPP full-validation path does not invokeMemberPositionOrder; consequently a client-sideDataContractFacade::createcan accept a fully validated contract that the node deterministically rejects. Put the whole-contract registration check behind a versioned DPP entry point and call it from both fresh contract construction and ABCI validation, while keeping it out of generic historical deserialization.
Origin
- Pull request: fix(platform)!: close the gaps left in nested member update rules (PV15) #6013
- Review thread: fix(platform)!: close the gaps left in nested member update rules (PV15) #6013 (comment)
- Filed by PastaClaw when it accepted the deferral, as nothing else tracked it.
Activity