Skip to content

build: Dash Platform v4.2.0-beta.7 (Rust tag, npm SDK, contract-validate findBy/where) - #153

Merged
PastaPastaPasta merged 13 commits into
wipe/beta7from
chore/sdk-beta7
Sep 29, 2026
Merged

PastaPastaPasta merged 13 commits into
wipe/beta7from
chore/sdk-beta7

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What

This PR covers WIPE-PLAN §2.1 (the SDK bumps) for the fresh beta.7 registration. It targets the integration branch wipe/beta7, not master, so master stays on beta.6 Rust and beta.5 JS until the wipe.

Rust.

  • The workspace and tools/contract-validate move to the v4.2.0-beta.7 tag, and both lockfiles are updated.
  • The three DocumentV0 { … } literals gain moderated_at: None, moderated_by: None.

npm. @dashevo/evo-sdk and @dashevo/wasm-sdk move to 4.2.0-beta.7, pinned exact, in forge-web, tools/mint-identity and forge-contracts/sdk-v2.

  • beta.6 never reached npm, so the jump is straight from beta.5.
  • pnpm-workspace.yaml's minimumReleaseAgeExclude now names beta.7.

consensus-shift.ts deleted. This was the platform#5053 remap, which beta.5 JS needed to decode a beta.6 node's refusals.

Reading refusals on beta.6/beta.7 JS (platform#5112).

  • A refusal at the broadcast check now reaches JS as kind Protocol with the node's code. It used to be Generic with code -1.
  • The old decoder took any code to mean "a block's verdict, so charged". asConsensusRefusal now reads the charge from the error kind:
    • StateTransitionBroadcastError: charged.
    • Protocol: not charged.
    • Anything else, or an error the SDK could not decode: unknown. For these, no "nothing was charged" claim is made.
  • Call sites that know where the error came from still override the kind: a broadcast's own catch, and the result wait.
  • A coded 10405 (stale document id) takes the re-prepare path before the refusal decode. A code always beats the text, so a figure like "required 104050000" is not read as a stale id.

indexOnly writes (platform#5136).

  • The engine broadcasts and waits itself, so the SDK's change to documents.create doesn't reach it. An indexOnly create (star, follow, watch, starBeat) now waits with stateTransitions.waitForAffectedState, instead of matching the strict wait's "VerifiedDocuments snapshot" text. Stored documents keep the strict wait.
  • The delete path's snapshot branch is removed: documents.delete resolves an indexOnly delete on its own from beta.7.
  • forge-core keeps its wait_for_affected_state, for the same reason: it broadcasts and waits itself. A comment now says so.

contract-validate.

  • check_leaf names a findBy by its properties, since the index name is gone in platform#5197.
  • A PropertyReference::Revealed is checked like a Value, as drive-abci's reference validation v0 does.
  • Only the existing mutations in negative.sh are respelled to findBy/where. Its three-contract layout, the sample documents and contracts.yml belong to the schema PR, as agreed.

Docs.

  • docs/dev/sdk-vendoring.md: npm pins, with vendoring as fallback tooling. The vendor-sdk-v4.2.0-beta.6 pre-release is used by nothing. The doc also has API notes for beta.6 and beta.7:
    • documentCreateCost and documentTypeLayout are exported from evo-sdk.
    • validateUpdate is in wasm-dpp2 only.
    • Whether documentCreateCost can replace cost.ts's constants: partly, after the fresh registration. This is tracked in BACKLOG.
  • BACKLOG, BUILDING, forge-v2 and private-repos are updated to the new versions.

Tests

Offline, local.

  • forge-web: typecheck, lint and next build pass. The unit suite gives 2581 passed and 1 test failed, in 2 files; both files are expected (see "Expected red" below).
  • tools/mint-identity: 23/23 pass.
  • cargo clippy --workspace --all-targets -D warnings and cargo fmt --check are clean.
  • cargo test --workspace: 951 passed and 4 failed, all expected (see "Expected red" below).

New or changed tests. These fail on the code before the change and pass after it.

  • write-errors.test.ts covers coded CheckTx refusals, block verdicts, and other kinds, which give an unknown charge.
  • write-engine.test.ts:
    • It throws the beta.6/beta.7 shapes: {name:'Protocol', kind:3, code} at broadcast and {name:'StateTransitionBroadcastError', kind:22, code} at the wait.
    • Replace and delete refusals: at the broadcast check they are not charged and not recorded; in a block they are charged and recorded as refused:<type>; when undecodable the charge is unknown.
    • indexOnly create and delete use the right wait.
    • A stored document never uses the lenient wait.
    • Coded 10405 on the first and second attempt.
  • contract-rules-beta6.test.ts parses a contract using the beta.6 propertyConstraints forms (countOf, sumOf, ifThen, notIn, $ownerId, $createdAtBlockHeight) and judges a document locally with checkDocumentPropertyConstraints. beta.5 refuses the contract.
    • The fixture's references are still in the old syntax, so they are stripped and only the rules are exercised.
    • A TODO points it at forge-contracts/contracts/forge-collab.json once the fresh contracts land.
  • negative.sh: all respelled mutations are rejected for the intended reason against design/final-schema/fallback, the new-syntax contracts.

Live.

  • Verified on beta.6 JS: create a repo, an issue and a comment; a CheckTx 10422 comes back charged=false with the balance unchanged; a 40120 gate refusal is charged, matching the balance.
  • lib/repo/sdk-beta7.live.test.ts repeats this for beta.7, plus a CheckTx refusal on a replace (the balance is polled, not read once). It needs a beta.7 moutai with findBy-syntax contracts, so it runs after the wipe.
  • beta.7 JS cannot read today's moutai (checked live): contracts.fetch refuses both forge contracts with "refersTo lookup was replaced by findBy".

Known red until the schema PR

These are the only red checks on this PR. Each one was checked in its CI log to fail only because beta.7 refuses the old-syntax contracts on every parse (platform#5197: "refersTo lookup was replaced by findBy").

  • web (CI): lib/private/conformance.test.ts (parses forge-contracts/contracts/forge-core.json) and lib/sdk/contract-seed.test.ts (the moutai snapshots). 156 other test files pass.
  • rust build + test (Rust): forge-core platform::wrap::tests::{a_wrong_shape_is_refused_before_decryption, envelope_names_both_keys, sdk_round_trip_both_directions} and private::conformance::private_conformance_vectors. All four panic at wrap.rs:196 parsing forge-core.json; 527 other tests pass.
  • contract-validate (Contracts): the validator refuses the current forge-core.json ("'lookup' was unexpected"). negative.sh's two expect_update_refused checks need a new-syntax registered/forge-core.v1.json.
  • playwright (read-only, devnet moutai) (Web e2e): a beta.7 build cannot fetch moutai's current contracts (checked live: contracts.fetch refuses both forge contracts). It can only pass after the wipe, once the contracts are registered in the findBy syntax.

contracts.yml:37 still says beta.6 in a comment. It is left for the schema PR, which owns that file.

The schema PR (#154) replaces the contracts on the same branch and turns everything green except playwright, which waits for the wipe. wipe/beta7 is an integration branch and deploys nothing.

🤖 Generated with Claude Code

PastaPastaPasta and others added 13 commits September 29, 2026 09:33
…e #5053 remap

wasm-sdk 4.2.0-beta.6 gives a refusal at the broadcast check the node's consensus code (platform#5112) on a Protocol error, which the decoder took for a block verdict and so reported as charged. A code is now charged only on a StateTransitionBroadcastError. The platform#5053 remap (consensus-shift.ts) is deleted: beta.6 decodes BasicError in the node's order. Adds a parse test of a contract using the beta.6 propertyConstraints forms.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ainst the balance

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…_commit; immutable releases as an owner option

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…a.6-shaped tests

StateTransitionBroadcastError is charged, Protocol is not, any other kind is unknown; an undecodable block verdict is unknown. A coded 10405 still takes the stale-id path before the refusal decode. The engine tests throw the beta.6 shapes and cover replace and delete refusals at the broadcast check and in a block; the live test adds a replace refused at the broadcast check with the balance unchanged; the rules test judges a document locally.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
forge-web, tools/mint-identity and forge-contracts/sdk-v2 move from 4.2.0-beta.5 to npm 4.2.0-beta.7 (beta.6 never reached npm). beta.7 refuses the refersTo lookup/propertyAgreement keywords (platform#5197), so it cannot read moutai's current contracts: this lands with the fresh findBy registration at the next wipe. The vendoring doc now describes vendoring as fallback tooling and notes the beta.7 APIs (documentCreateCost, documentTypeLayout, validateUpdate).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…here

The workspace and tools/contract-validate move to the v4.2.0-beta.7 tag. DocumentV0 literals gain moderated_at/moderated_by. check_leaf names a findBy by its properties (the index name is gone, platform#5197) and treats a revealed property like an identifier reference, as drive-abci does. negative.sh takes a contracts directory, validates the unmutated contracts first, accepts a third contract (forge-community), spells every mutation in findBy/where, and checks that the old lookup/propertyAgreement keywords are refused.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ling

The three-contract layout and contracts.yml belong to the schema PR on wipe/beta7.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…a snapshot text match

The engine broadcasts and waits itself, so platform#5136 (which changed only documents.create/delete) does not reach it: an indexOnly create (star, follow) now waits with waitForAffectedState and a stored document with the strict waitForResponse, instead of reading the strict wait's 'VerifiedDocuments snapshot' refusal as landed. The SDK's own indexOnly delete resolves on its proof from beta.7, so the delete path's snapshot branch is gone. Mocked star/unstar tests cover both; two fail on the old engine.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
platform#5136 changed only the SDK's own document put and delete; this engine broadcasts and waits itself, and the strict wait still refuses an indexOnly outcome.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rrors never read as stale ids

Addresses the review of the beta.7 bump: an undecodable refusal (kind Protocol, code -1, from CheckTx or a block) has charged=null on the replace and delete paths too; isStaleDocumentIdError trusts a code over text; the stored-document wait test counts the waits; the live test is renamed for beta.7; stale version strings, the sdk-vendoring note on the engine's indexOnly wait, and one negative.sh label are corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The delete path's proven flag was always true (no snapshot branch left); a result-wait verdict is unknown only when undecodable, as its comment says; the tests share one pair of SDK error shapes and named texts.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

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.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b71bbbd5-8955-4a50-a5ef-6ed7624b40c6

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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.

1 participant