Repository navigation
feat: bump @dashevo/evo-sdk to 5.0.0-beta.1 and read the 5.0 contract language - #6
Merged
Merged
Conversation
… 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>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basic explanation
What this does: Moves the visualizer to
@dashevo/evo-sdk5.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,wherechecks,inList, moderated references, conditionalimmutable, 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-sdk4.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:
After:
and in the inspector of the marketplace
listing:On a contract fetched from mainnet (DashPay
contactRequest), the cost panel readsFirst document with these index values: 0.000978 DASH ($0.06), 3,385 B stored.References:
findBy,where,inList,moderatedDocumentThe parser reads the 5.0 keys. A
findByedge is labelled with the unique index it resolves to (the one over exactly the propertiesfindBynames), aninListedge ends on the list, and amoderatedDocumentedge is labelledmoderated. The inspector listsfindBysources,whereentries,minimumAgeBlocksandconsume, and links each to its chapter of the book (findBywith a function links to commit and reveal).Before (4.2 spelling, now refused by the SDK):
After:
drawn as
«creator» · via byOwner. In the moderation charters contract,resignationRequest.$ownerIdnow reads«owner» · ∈ members · anyOf 1/2and«owner» · via byElectedCharterMember · deletable · anyOf 2/2.whereis keyed by the referenced document's property, the other way round frompropertyAgreement:New keyword chips
moderatorAbilities.delete(replacescanBeDeletedByModerators)mods delete ≤1w, with the record, refund, kept fields and settled-deletion rules in the tooltipmoderatorAbilities.changeFieldsmods writeon the type,mods onlyon the fieldimmutableentry{ property, when }fixed when, with the condition as a formulageneratedFromgeneratedintegerRangebands 100B/100BoutlivesDeleteoutlives deleteskipIfAbsentas a listskip absent, naming the properties<reference>.<field>via refBefore,
skuin the marketplace was frozen withimmutableAllowSetting:After:
shopIdshowsfixed;titleandskushowfixed when, whose tooltip gives the condition.Compare mode
The update rules follow the release book:
immutablemay gain entries and drop a condition, but may not lose an entry, give a plain entry a condition or change a condition (40212).moderatorAbilitiesis fixed (40212) in place of the twocanBeDeletedByModeratorskeys. The verdicts still mirror the book: evo-sdk 5.0.0-beta.1 does not exposeDataContract.validateUpdate.Examples and fixtures
moderation-chartersandyappr-likesare copied from their sources at v5.0.0-beta.1 (the system contract's schema and the Drive test fixture).marketplaceis ported by hand and now also showsmoderatorAbilitieswithchangeFields, conditionalimmutable,generatedFrom(a homograph-safehandleKeyunder the unique handle index) and an integer-range index.npm run validate:examplesnow 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 transientpreorderSaltamong 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:examplesandnpm run build.document/v3, checked with Ajv). The CI check runs the parser only. The same Ajv check refuses the old marketplace on each replaced keyword.listing; testnet DPNS loads; mainnet DashPaycontactRequestcost panel; moderation charters edge labels as above.Breaking Changes
A contract that still uses
lookup,propertyAgreement,type: "listElement"orimmutableAllowSetting(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