Skip to content

feat: bump @dashevo/evo-sdk to 5.0.0-beta.1 and read the 5.0 contract language - #6

Merged
QuantumExplorer merged 1 commit into
mainfrom
chore/evo-sdk-5.0.0-beta.1
Oct 1, 2026
Merged

QuantumExplorer merged 1 commit into
mainfrom
chore/evo-sdk-5.0.0-beta.1

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Basic explanation

What this does: Moves the visualizer to @dashevo/evo-sdk 5.0.0-beta.1, the first published SDK that can compute a document type's GroveDB layout and the cost of creating a document. The layout panel and the cost line (#3, #4) have been live but empty, showing "appears with the next SDK release". With this SDK they show real numbers. The release also renamed several contract keywords, and its parser refuses the old names, so the diagram, the bundled examples and the tests move to the new names too.

Value: Every document type now gets its GroveDB layout and a cost estimate in Dash and dollars, for bundled examples and for contracts fetched from testnet, mainnet and 5.0 devnets. Contracts written in the 5.0 language draw correctly: references found by findBy, where checks, inList, moderated references, conditional immutable, moderator abilities, generated properties, integer-range indexes.

Risks: Low. The visualizer is read-only, and every number comes from the SDK. One change users could notice: a contract registered on a 4.2 devnet with the old spellings (lookup, propertyAgreement, type: "listElement", immutableAllowSetting) no longer loads, because the 5.0 parser refuses it. The SDK package is about 5% larger (its chunk is 8.6 MB gzipped), still loaded only on first use.

What was done

The SDK

@dashevo/evo-sdk 4.2.0-beta.4 → 5.0.0-beta.1. Nothing in the app had to change for the layout and cost panels: they check for the functions and now find them.

Before (pinned 4.2.0-beta.4), on any document type:

GroveDB layout of listing
This build of the visualizer uses an @dashevo/evo-sdk without documentTypeLayout
(added by dashpay/platform#5153). It appears with the next SDK release.

After:

GroveDB layout of listing
25 layers · 7 counted or summed · 0 ranked · 0 wrapped to contribute nothing
listing  Tree
  [0] PrimaryKey  CountTree
  ...
  price#100000000000#100000000000  Tree  byPriceBand
    ‹price band: 100B every 100B›  Tree  byPriceBand

and in the inspector of the marketplace listing:

About 0.000287 DASH ($0.02) per document  details

On a contract fetched from mainnet (DashPay contactRequest), the cost panel reads First document with these index values: 0.000978 DASH ($0.06), 3,385 B stored.

References: findBy, where, inList, moderatedDocument

The parser reads the 5.0 keys. A findBy edge is labelled with the unique index it resolves to (the one over exactly the properties findBy names), an inList edge ends on the list, and a moderatedDocument edge is labelled moderated. The inspector lists findBy sources, where entries, minimumAgeBlocks and consume, and links each to its chapter of the book (findBy with a function links to commit and reveal).

Before (4.2 spelling, now refused by the SDK):

"creatorRefersTo": {
  "type": "permanentDocument", "documentType": "shop",
  "lookup": { "index": "byOwner", "keys": { "$ownerId": "." } }
}

After:

"creatorRefersTo": { "type": "permanentDocument", "documentType": "shop", "findBy": { "$ownerId": "." } }

drawn as «creator» · via byOwner. In the moderation charters contract, resignationRequest.$ownerId now reads «owner» · ∈ members · anyOf 1/2 and «owner» · via byElectedCharterMember · deletable · anyOf 2/2.

where is keyed by the referenced document's property, the other way round from propertyAgreement:

"propertyAgreement": { "sellerId": "$ownerId" }     // before: referring -> referenced
"where": { "$ownerId": "sellerId" }                 // after: referenced -> referring

New keyword chips

Keyword Chip Where
moderatorAbilities.delete (replaces canBeDeletedByModerators) mods delete ≤1w, with the record, refund, kept fields and settled-deletion rules in the tooltip document type
moderatorAbilities.changeFields mods write on the type, mods only on the field document type, field
immutable entry { property, when } fixed when, with the condition as a formula field
generatedFrom generated field
integerRange bands 100B/100B index
outlivesDelete outlives delete index
skipIfAbsent as a list skip absent, naming the properties index
an index property <reference>.<field> via ref index

Before, sku in the marketplace was frozen with immutableAllowSetting:

"immutable": ["shopId", "sku"],
"immutableAllowSetting": ["sku"]

After:

"immutable": [
  "shopId",
  { "property": "title", "when": { "greaterThan": [{ "subtract": ["$updatedAt", "$createdAt"] }, 300000] } },
  { "property": "sku", "when": { "present": "$old.sku" } }
]

shopId shows fixed; title and sku show fixed when, whose tooltip gives the condition.

Compare mode

The update rules follow the release book: immutable may gain entries and drop a condition, but may not lose an entry, give a plain entry a condition or change a condition (40212). moderatorAbilities is fixed (40212) in place of the two canBeDeletedByModerators keys. The verdicts still mirror the book: evo-sdk 5.0.0-beta.1 does not expose DataContract.validateUpdate.

Examples and fixtures

  • moderation-charters and yappr-likes are copied from their sources at v5.0.0-beta.1 (the system contract's schema and the Drive test fixture).
  • marketplace is ported by hand and now also shows moderatorAbilities with changeFields, conditional immutable, generatedFrom (a homograph-safe handleKey under the unique handle index) and an integer-range index.
  • npm run validate:examples now also regenerates (-- --write) and checks the layout and cost fixtures, computed by the installed SDK, so they cannot drift from the examples. The layouts matched the fixtures exactly. The costs had moved since they were dumped from a local build: for example, Drive no longer lists the transient preorderSalt among a DPNS domain's stored fields, and a tip costs more to process.

How Has This Been Tested?

  • npm run typecheck, npm test (104 tests), npm run validate:examples and npm run build.
  • Every bundled example also validates against the release's document meta-schema (rs-dpp document/v3, checked with Ajv). The CI check runs the parser only. The same Ajv check refuses the old marketplace on each replaced keyword.
  • Production build served locally: GroveDB layout and cost on the bundled marketplace listing; testnet DPNS loads; mainnet DashPay contactRequest cost panel; moderation charters edge labels as above.

Breaking Changes

A contract that still uses lookup, propertyAgreement, type: "listElement" or immutableAllowSetting (a 4.2 devnet contract) fails to load, with the SDK's message naming the replacement. Testnet and mainnet contracts are unaffected.

🤖 Generated with Claude Code

… language

5.0.0-beta.1 is the first published SDK with Drive's documentTypeLayout
and documentCreateCost, so the GroveDB layout panel and the cost line
now work instead of saying "appears with the next SDK release".

Its parser refuses the spellings 5.0 replaced on every parse (refersTo
lookup, propertyAgreement and type listElement, and
immutableAllowSetting), so the diagram follows the new language:

- refersTo findBy, where and inList, minimumAgeBlocks and consume, and
  the moderatedDocument target; a findBy edge is labelled with the
  unique index it resolves to
- immutable entries with a condition ("fixed when"), generatedFrom,
  moderatorAbilities (replacing canBeDeletedByModerators), changeFields
  ("mods only"), integerRange, outlivesDelete, skipIfAbsent as a list,
  and index properties read through a reference
- the integerRangeBucket key kind in the layout panel
- the update rules of immutable and moderatorAbilities in compare mode

moderation-charters and yappr-likes are copied from the v5.0.0-beta.1
sources; marketplace is ported by hand and shows the new keywords.
validate:examples now also regenerates and checks the layout and cost
fixtures from the installed SDK.

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

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0f2edb50-ad13-4eb4-a557-cfefaf139830

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@QuantumExplorer
QuantumExplorer merged commit 9761e1b into main Oct 1, 2026
3 checks passed
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