Skip to content

feat(dpp)!: typed scalar arrays in document schemas (PV14) - #4922

Merged
QuantumExplorer merged 5 commits into
v4.2-devfrom
claude/typed-scalar-arrays-dash-4d4bb9
Sep 22, 2026
Merged

QuantumExplorer merged 5 commits into
v4.2-devfrom
claude/typed-scalar-arrays-dash-4d4bb9

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

An independent implementation of the same task as #4920, opened so the two can be compared; only one of them should merge. The second commit takes the parts #4920 did better: element conversion paths with the platform-value path fixes, maxItems required in the type on every parse with minItems not above it, and element-bound validation tests.

Document schemas could only declare byte arrays: every type: "array" property had to carry byteArray: true. The moderation charters contract (#4898) needs lists of scalars, the reasons list on submittedCharter and the members list on electedCharter, both lists of identifiers. This adds typed arrays of scalars at protocol version 14.

What was done?

A document property may now be type: "array" with an items element schema instead of byteArray:

"reasons": {
  "type": "array",
  "minItems": 0,
  "maxItems": 64,
  "uniqueItems": true,
  "items": {
    "type": "array", "byteArray": true, "minItems": 32, "maxItems": 32,
    "contentMediaType": "application/x.dash.dpp.identifier"
  },
  "position": 2
}

Grammar (meta-schema v3, edited in place).

  • items is a property keyword, and its schema is the new $defs/documentArrayItem: one scalar (integer, number, string with minLength/maxLength, boolean, byte array, identifier). Objects and arrays of arrays are refused, and so are $ref, refersTo, uniqueItems, position, const and examples on an element. enum is allowed, so an element can be limited to allowed values; const adds nothing a one-value enum does not, and an update can widen an enum but only drop a const.
  • The rule that was "allow only byte arrays" now splits the two forms. A byte array (byteArray: true) keeps its form and refuses items. On a plain byte array uniqueItems keeps its meaning (no repeated byte); an identifier (a byte array with the identifier contentMediaType) refuses it, since "no repeated byte" would refuse about 87% of real identifiers. A typed array requires items and maxItems, refuses contentMediaType, and its minItems/maxItems count elements.
  • items is a property-level keyword. The property level has been closed (unevaluatedProperties: false) since meta-schema v0, and the stray-key census only covers doctype-level keys, so no stored contract can carry it and the pinned stray list does not apply.

Parse (parse_typed_array 0, new versioned method). It runs in the shared property insert path, so it follows the conventions chapter's rule for shared helpers: an OptionalFeatureVersion in DocumentTypeSchemaVersions, None in CONTRACT_VERSIONS_V1..V5 and Some(0) in V6 (PV14), like apply_property_reference and apply_required_since, rather than a ParserGeneration flag. Below PV14 the property still reaches try_from_value_map, whose "array" arm is unchanged, so it is refused with "only byte arrays are supported now" exactly as before. ArrayItemType::try_from_value_map / TryFrom<&Value> builds the element type from the items map. A per-element refersTo would later be read from that same map and folded into the identifier element.

Type. DocumentPropertyType is @append_only, so Array(ArrayItemType) could not gain count bounds in place. A new TypedArray(TypedArrayProperty { item_type, min_items, max_items, unique_items }) variant is appended, the same way IdentifierWithReference sits next to Identifier. The parser never produced Array and still never does. The two share every codec arm through or-patterns.

Codec. Encoding is unchanged: a varint element count, then each element in its ArrayItemType encoding. read_optionally_from now mirrors it for both variants. The count comes from the serialized document, so it never sizes an allocation. Every element takes at least one byte, so a count the input cannot hold fails with CorruptedSerialization once the input runs out. An identifier element must be 32 bytes and a boolean 0 or 1. Fixed-size byte array elements read back as Bytes20/Bytes32/Bytes36, as a fixed-size scalar byte array does.

Bounds. TypedArrayProperty::max_items is a required u16: every parse refuses a typed array without maxItems, with minItems above it, or with contentMediaType on the array (it belongs on the items). min_byte_size/max_byte_size of a typed array are the varint count plus minItems/maxItems times the element's encoded bounds (length prefix included, 4 bytes per string character), saturating at u16::MAX, the value an unbounded string reports. These feed estimated_size/max_size. SystemLimits::max_typed_array_items (1024, backfilled into every table) caps maxItems. The cap is checked under full validation in the generation 3 driver, like the other registration limits, so a stored contract is never re-judged by a later, lower cap.

Refusals. A typed array cannot be an index property (InvalidIndexPropertyTypeError), an indexOnly terminal or an entryPayload property. The ranked key-length check skips it so the type error is the one reported. Drive's query conditions give it no operators, and it has no tree-key encoding and no value_from_string. propertyAgreement compares index key encodings at write time, so an agreement on a typed array would register but never hold. drive-abci's registration check (data_contract_reference_validation v0, new in PV14) now refuses one.

Document validation. Unchanged code path. The JSON schema validator already enforces items, minItems, maxItems and uniqueItems (it hashes above 15 elements, so the cap is cheap). A too-long, too-short, repeating or wrong-typed list returns the existing JsonSchemaError as a consensus result, never a panic.

Random values. random_value, random_sub_filled_value and random_filled_value generate between minItems and maxItems elements. Under uniqueItems a repeat is redrawn a bounded number of times.

Identifier and binary paths. find_identifier_and_binary_paths 1 (new, selected at PV14; v0 untouched) registers a typed array's identifier and byte array elements as path[] conversion paths, so a document built from JSON or a value map converts every element, as it converts a scalar identifier. That needed the platform-value path helpers fixed: a trailing list[] or list[i] now names the members to replace (before, the path walked into the list and replaced nothing), an absent list is nothing to replace (before, Value::replace_at_path returned an error), list[i] returns an error past the end instead of reaching the unwrap behind an inverted bounds check, and the BTreeMap<String, Value> helper learns the list[] syntax it never parsed. Drive and drive-abci never call these helpers. sanitize_value_mut also covers TypedArray.

Serialization. Contracts serialize their schemas, not parsed property types, so the wire form of a contract does not change. A test round-trips a contract with typed arrays through serialize_to_bytes_with_platform_version and versioned_deserialize_untrusted with full validation. The pinned wasm-dpp transition lengths are untouched because no fixture changed.

Clients. wasm-dpp2 adds DataContract.documentTypeTypedArrays(name) and the documentTypedArrays getter, which return { path, items, minItems?, maxItems, uniqueItems } with the element as { type: 'integer' | 'number' | 'boolean' | 'string' | 'byteArray' | 'identifier', ...bounds } and TypeScript types for both. Swift and Kotlin parsers are out of scope: they still parse type: array as bytes.

Docs. v14 changelog item 25, a "Typed Arrays" section in book/src/data-model/documents.md, and a SYSTEM_LIMITS_V4 bullet.

ArrayItemType::Date stays unreachable from a schema, exactly as DocumentPropertyType::Date is: the grammar has no date type.

How Has This Been Tested?

New rs-dpp tests (try_from_schema/v3/typed_array_tests.rs and property/mod.rs):

  • should_parse_a_typed_identifier_array
  • should_parse_a_typed_integer_array_with_bounds (including its byte bounds)
  • should_parse_every_scalar_element_type
  • should_refuse_arrays_of_objects and should_refuse_arrays_of_arrays (the meta-schema, and the parser without it)
  • should_refuse_an_index_on_a_typed_array_property
  • should_refuse_a_typed_array_below_protocol_version_14_and_accept_it_at_14 (PV13 validating and non-validating, PlatformVersion::latest() accepting)
  • should_require_max_items_on_a_typed_array_within_the_system_limit
  • should_keep_the_byte_array_form_free_of_items_and_unique_items
  • should_refuse_refers_to_on_the_elements_of_a_typed_array
  • should_accept_enum_and_refuse_const_and_examples_on_the_elements_of_a_typed_array
  • should_refuse_a_typed_array_in_an_index_with_a_ranked_axis_as_an_invalid_index_type (fails if the ranked key-length check stops skipping typed arrays)
  • next to the parser: should_parse_a_typed_array_from_protocol_version_14_and_leave_it_alone_before, should_leave_byte_arrays_and_scalars_to_the_scalar_parser, should_parse_a_typed_array_with_its_bounds, should_refuse_a_typed_array_missing_items_or_max_items_or_with_a_misplaced_bound
  • should_round_trip_a_contract_with_typed_arrays_through_platform_serialization
  • should_round_trip_a_document_with_typed_arrays_through_serialization (every element type, plus an empty array and absent optional arrays)
  • should_hold_the_shape_rules_of_a_typed_array_without_the_meta_schema (minItems above maxItems, contentMediaType on the array, on both parse paths)
  • should_convert_the_elements_of_typed_arrays_when_creating_a_document_from_data
  • should_refuse_a_document_whose_typed_array_breaks_its_schema (over maxItems, under minItems, repeated under uniqueItems, a wrong-typed element, a 31-byte identifier, an element over or under its own maxLength/minLength)
  • should_generate_random_documents_that_validate_against_their_own_schema (random_document and all three fill sizes, validated and round-tripped)
  • should_round_trip_every_array_element_type_through_encode_and_read_optionally_from, should_refuse_an_array_whose_elements_run_past_the_serialized_document, should_refuse_malformed_identifier_and_boolean_array_elements, should_bound_a_typed_array_by_its_item_counts_times_its_element_bounds

platform-value: should_replace_every_member_when_a_list_ends_the_path, should_replace_one_member_by_index_and_refuse_an_index_past_the_end, should_treat_an_absent_list_as_nothing_to_replace, and three BTreeMap helper equivalents.

drive-abci: should_reject_agreement_on_typed_array_properties, with a new reference-validation fixture.

wasm-dpp2: tests/unit/DocumentTypedArrays.spec.ts.

Run locally:

  • cargo test -p dpp --all-features --lib: 4578 passed; after the rebase over feat(platform)!: contract references may require the referenced contract's owner relation and config flags #4915, the document type and meta-validator modules again (1166 passed)
  • cargo test -p platform-version --all-features: passed
  • cargo test -p drive-abci --lib for the agreement and reference-validation tests (19 passed) and data_contract_create / data_contract_update (162 passed); after the rebase over feat(platform)!: contract references may require the referenced contract's owner relation and config flags #4915, permanent_document_reference_declarations (21 passed)
  • cargo test -p drive --lib query::conditions: 207 passed
  • cargo check -p drive -p drive-abci --all-features --all-targets, cargo check -p wasm-dpp2 --target wasm32-unknown-unknown
  • cargo clippy -p dpp -p drive -p drive-abci -p platform-version --all-features --all-targets -- -D warnings and cargo clippy -p wasm-dpp2 --target wasm32-unknown-unknown -- -D warnings: clean
  • cargo fmt --all
  • After the second commit: cargo test -p dpp --all-features --lib for the data contract, document and validation modules (2904 passed), cargo test -p platform-value --all-features (1173 unit + 94 doc tests), drive-abci data_contract_create / data_contract_update (162 passed), the three wasm-dpp2 specs DocumentTypedArrays, DataContract and DocumentPropertyReference (44 passing), and clippy with -D warnings on dpp, drive, drive-abci, platform-version, platform-value and wasm-dpp2 (wasm32)
  • yarn workspace @dashevo/wasm-dpp2 build then mocha tests/unit/DocumentTypedArrays.spec.ts: 6 passing

Breaking Changes

Consensus-breaking at protocol version 14 only (unreleased):

  • Meta-schema v3 admits typed arrays and parse_typed_array 0 parses them.
  • Meta-schema v3 now refuses uniqueItems on an identifier property (a byte array with the identifier contentMediaType); plain byte arrays keep it. No system contract or repository fixture uses it. A PV13-era contract that does would have to drop the keyword on its next update at PV14; dropping uniqueItems is a compatible schema change.
  • drive-abci refuses a propertyAgreement on a typed array property.
  • A document type's identifier and binary paths come from find_identifier_and_binary_paths 1 at PV14; they differ from v0 only for typed arrays.

Not consensus, but a behaviour change in platform-value: Value::replace_at_path with a list[].field path whose list is absent now succeeds with nothing replaced instead of returning an error, and a trailing list[] now replaces the members. Only client-side conversions (for example publicKeys[].data in identity transitions built from objects) take these paths.

Nothing changes below protocol version 14.

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
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · e093c53

  • Bots — coderabbitai not yet · thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed once the bots are done
  • Within your 5 open PRs
  • Build running
  • Approvals — you own every area touched; none needed

When every box is checked the PR Hygiene check passes and this can merge.

Summary by CodeRabbit

  • New Features

    • Added protocol v14 support for typed arrays containing scalar values, including strings, numbers, booleans, byte arrays, and identifiers.
    • Added typed-array metadata inspection through WebAssembly APIs, including element types, bounds, and uniqueness settings.
    • Added support for replacing individual list elements or all elements using list paths.
  • Validation

    • Typed arrays now enforce schema restrictions, item limits, serialization rules, and unsupported index or property-agreement configurations.
  • Documentation

    • Documented typed-array schemas and their binary encoding.

A document property may be `type: "array"` with an `items` element
schema instead of `byteArray`: a list of integers, numbers, strings,
booleans, byte arrays or identifiers. Objects and arrays of arrays stay
refused. On the array minItems and maxItems count elements, maxItems is
required and at most SystemLimits::max_document_array_items (1024), and
uniqueItems refuses a repeated element when the document is validated.

The array is stored inline, a varint element count followed by the
elements, the encoding DocumentPropertyType::Array already had;
read_optionally_from now mirrors it. DocumentPropertyType is append-only,
so the bounded form is a new TypedArray variant rather than a changed
Array payload.

Meta-schema v3 gains `items` and the element schema, and a byte array
now refuses `items` and `uniqueItems`. The parse is the new versioned
`parse_typed_array` (None before protocol version 14, where an array that
is not a byte array is refused as before). A typed array cannot be an
index property, an indexOnly terminal or entry payload, or one side of a
propertyAgreement. wasm-dpp2 exposes the declarations through
documentTypeTypedArrays / documentTypedArrays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: dashpay/platform/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: af6c49d8-16e0-4046-a07b-a3ee3664dda7

📥 Commits

Reviewing files that changed from the base of the PR and between 8a0befd and e093c53.

📒 Files selected for processing (40)
  • book/src/data-model/documents.md
  • book/src/serialization/document-serialization.md
  • packages/rs-dpp/schema/meta_schemas/document/v3/document-meta.json
  • packages/rs-dpp/src/data_contract/document_type/class_methods/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/class_methods/parse_typed_array/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/class_methods/parse_typed_array/v0/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/common/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/typed_array_tests.rs
  • packages/rs-dpp/src/data_contract/document_type/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/property/array.rs
  • packages/rs-dpp/src/data_contract/document_type/property/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/v1/mod.rs
  • packages/rs-dpp/src/data_contract/document_type/v0/random_document_type.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_common/data_contract_reference_validation/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_create/mod.rs
  • packages/rs-drive-abci/tests/supporting_files/contract/reference-validation/reference-validation-contract-agreement-typed-array.json
  • packages/rs-drive/src/query/conditions.rs
  • packages/rs-platform-value/src/btreemap_extensions/btreemap_field_replacement.rs
  • packages/rs-platform-value/src/replace.rs
  • packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs
  • packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs
  • packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v2.rs
  • packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v3.rs
  • packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v4.rs
  • packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v5.rs
  • packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v6.rs
  • packages/rs-platform-version/src/version/mocks/v2_test.rs
  • packages/rs-platform-version/src/version/system_limits/mod.rs
  • packages/rs-platform-version/src/version/system_limits/v1.rs
  • packages/rs-platform-version/src/version/system_limits/v2.rs
  • packages/rs-platform-version/src/version/system_limits/v3.rs
  • packages/rs-platform-version/src/version/system_limits/v4.rs
  • packages/rs-platform-version/src/version/v14.rs
  • packages/wasm-dpp2/src/data_contract/document_type_typed_arrays.rs
  • packages/wasm-dpp2/src/data_contract/mod.rs
  • packages/wasm-dpp2/src/data_contract/model.rs
  • packages/wasm-dpp2/tests/unit/DocumentTypedArrays.spec.ts
 __________________________________________________________________________________________________________________________________
< Functions delay binding; data structures induce binding. Moral: Structure data late in the programming process. - Alan J. Perlis >
 ----------------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Sep 22, 2026
@github-actions github-actions Bot added this to the v4.2.0 milestone Sep 22, 2026
@thepastaclaw

thepastaclaw commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

⚠️ DEGRADED — Queued for automated review — 36th in line, estimated start in ~41 h (commit e093c53)
Estimated review time once started: ~2.3 h (two-phase automated review; median of recent runs).
The primary review models are currently out of quota; this review will run on stand-in models and be marked as degraded.

  • Request priority review — click to move this review to the front of the queue.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-09-22T21:12:34.786Z

…y parse

Takes the parts #4920 did better:

- find_identifier_and_binary_paths 1 (selected at protocol version 14)
  registers a typed array's identifier and byte array elements as `path[]`
  conversion paths, so a document built from JSON or a value map converts
  every element. platform-value's path helpers now make a trailing `list[]`
  or `list[i]` name the members to replace, treat an absent list as nothing
  to replace, and return an error instead of reaching the `unwrap` behind an
  inverted bounds check on `list[i]`; the BTreeMap helper learns the `list[]`
  syntax it never parsed. Drive and drive-abci never call these helpers.
- TypedArrayProperty::max_items is a required u16: the parse refuses a
  typed array without maxItems, with minItems above it or with
  contentMediaType on the array, on every path. The 1024 cap stays a
  registration limit under full validation.
- Element bounds are covered at document validation, and the meta-schema
  header and the serialization chapter mention typed arrays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QuantumExplorer added a commit that referenced this pull request Sep 22, 2026
…istration, agreement refused (#4922 port)

Takes from the independent implementation in #4922 what it did better:

- `class_methods/parse_typed_array` is its own versioned method run before
  the scalar parser, whose signature and "array" arm are restored
  byte-for-byte; below protocol version 14 the historical refusal is reached
  exactly as before.
- The `maxItems` requirement and its `SystemLimits::max_typed_array_items`
  cap move to the generation 3 driver under full validation, like the other
  registration limits, so a later, lower cap can never make a stored
  contract unreadable; `TypedArrayProperty::max_items` is `Option<u16>`.
- drive-abci refuses a `propertyAgreement` on a typed array on either side
  (fixture + test): the write-time check compares index key encodings, which
  a list does not have.
- The ranked key-length check skips typed arrays so the type error is the
  one reported; a test pins it.
- Byte array items whose bounds pin 20, 32 or 36 bytes read back as
  `Bytes20/32/36`, boolean items must be 0 or 1, item bounds are read at u16
  like the scalar bounds.
- Meta-schema v3: `items` is allowed on `type: array` only.
- wasm-dpp2: `maxItems` is optional on the surface; a mocha spec covers the
  accessors.

Merges v4.2-dev (#4915).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
QuantumExplorer and others added 3 commits September 23, 2026 03:48
… array

On a plain byte array uniqueItems keeps its meaning, no repeated byte, and
stays allowed. An identifier (a byte array with the identifier
contentMediaType) is one value, so "no repeated byte" would refuse about
87% of real identifiers; meta-schema v3 refuses the keyword there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A list whose elements must all equal one value carries only its length,
and a one-value enum restricts an element the same way while a contract
update can still widen it (enum values may be added, a const can only be
dropped). The element schema keeps enum and drops const; plain properties
keep both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ements, pin the parse and ranked rules

- SystemLimits::max_document_array_items becomes max_typed_array_items:
  byte arrays are arrays too, and the cap only bounds typed arrays.
- The element schema drops examples, which annotates nothing an element
  needs, as it dropped const.
- Tests next to parse_typed_array (the protocol version 14 dispatch and the
  v0 shape rules) and one pinning that a ranked index on a typed array is
  refused as an invalid index property type rather than by the ranked
  key-length check, which skips it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@QuantumExplorer
QuantumExplorer merged commit 5c047d2 into v4.2-dev Sep 22, 2026
14 of 16 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/typed-scalar-arrays-dash-4d4bb9 branch September 22, 2026 21:23
QuantumExplorer added a commit that referenced this pull request Sep 22, 2026
Typed scalar arrays landed on v4.2-dev (#4922), so the declaration the
charters contract needs, on the `members` items, is covered: an identifier
typed array carries `distinctFrom` on its `items` and every element must
differ from the named value. The parser refuses the keyword on the array
itself and on elements of any other type, the meta-schema admits it on
identifier elements only, and the write-time check judges each element
with `DistinctFrom::violation`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
QuantumExplorer added a commit that referenced this pull request Sep 22, 2026
…onstraints, untrusted lists, Swift refusal

Follow-up to #4922 from its review.

- platform-value: `is_array_path` accepts `-` in a list name, as a document
  property name may carry it; `member-ids[]` was never converted before. One
  `replace_leaf` serves the Value and the map path replacers, so a `Bytes32`
  member replaced as binary bytes keeps its kind on both.
- `TypedArrayProperty::item_constraints` carries the `enum`, `minimum` and
  `maximum` of the items schema, parsed on both paths with the shape rules
  the meta-schema now states for elements (member types, no enum on byte
  array or identifier elements, minimum not above maximum); random document
  generation draws enum members and bounded numbers, so random documents
  validate against schemas with such elements.
- `ExtendedDocument::set_untrusted` converts the members of a list set at a
  `path[]` path, and reads binary values as binary.
- Census of every contract create and update transition on mainnet (72)
  and testnet (4593), decoded with dpp: no `uniqueItems` anywhere, so the
  PV14 refusal on identifiers stays; recorded on the test that pins it.
- wasm-dpp2 reports an element's `enum`, `minimum` and `maximum`.
- The Swift DataContractParser refuses a typed array explicitly instead of
  persisting it as a bare array.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants