Repository navigation
feat(contract)!: describe a multiple choice proposal by a document, a url or both (PV15) - #5895
Conversation
… url or both (PV15) A multiple choice proposal had to point at a description document hosted on Platform. People will also host a description themselves, so the proposal now says what is being decided in one of two places, or both: a moderated document an elected team can take down, checked as before, or its `url`, which nothing on chain reads or moderates. - `descriptionId`, `descriptionContractId` and `descriptionDocumentType` are no longer required. Two `propertyConstraints` rules hold a proposal on create and on every edit: `describedByADocumentOrAUrl` (at least one of the two) and `descriptionDocumentNamedWhole` (the three properties naming a document are all given or none). - The reference on `descriptionId` is unchanged: a proposal that points at a document still needs one its host's elected team can remove. - A proposal described at a url alone is accepted and takes choices; one with neither, or with a document named in part, is refused with `DocumentPropertyConstraintViolatedError`. The contract schema changes, so the ten nullifier_batch_guard roots, the activation root and the stored contract fixture line of the decision proposals contract are recomputed. Protocol version 15 is unreleased; protocol version 14 and earlier are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
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. |
|
📜 System contracts This pull request adds or changes system contract document schemas. The contract viewer diagrams each one, and a comparison marks what is added, changed and removed, with the update rule each change meets.
Compared |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.
Commit b0ead30. Normal review starts when eligible; priority review starts as soon as a slot is available. |
Basic explanation
What this does: A multiple choice proposal says what is being decided in one of two places, or both: a moderated document hosted on Platform, as since #5851, or its
url.Value: People will describe a proposal either the Platform way, in a document an elected team can take down, or in a system of their own. #5851 required the first. This admits the second without weakening the first.
Risks: A description at a url is outside the chain. Nothing reads or moderates it, and whoever serves it can change it after choices were entered. That is the point of the option, and the protocol guide says so. The proposal itself still holds no description text: at most a 512 byte url, which it could already hold.
Issue being fixed or feature implemented
#5851 made
multipleChoiceProposalpoint at a description document:descriptionId,descriptionContractIdanddescriptionDocumentType, all required, the document one its host's elected moderation team can remove. A proposer who hosts the description elsewhere had no way to create a proposal.What was done?
In the decision proposals contract (registered from protocol version 15, unreleased):
descriptionId,descriptionContractIdanddescriptionDocumentTypeare no longer required, but they go together: a proposal gives all three or none. One or two of them without the rest is refused (thedescriptionDocumentNamedWholerule below).url(format: uri, at most 512 bytes). No property is added.propertyConstraintsrules hold a proposal, on create and on every edit:descriptionIdis unchanged. A proposal that points at a document is checked exactly as before.Also:
decision-proposals-contract: constants for the two rule names; the Rust and JS schema tests follow.docs/protocol/decision-proposals.mdand the contract README: the two places, the two rules, and what a url does not give.nullifier_batch_guardroots, the activation root and thesystem DecisionProposalsline of the stored contract fixture are recomputed. No other fixture line changes.Choices a reviewer may want to question
urlis reused. It meant "where the proposal is discussed". It is now the description when no document is given, and the discussion link when one is. A separatedescriptionUrlwould keep the two meanings apart at the cost of one more property.How Has This Been Tested?
cargo test -p drive-abci --lib -- multiple_choice_proposal decision_proposal dynamic_document_reference stored_non_document_reference nullifier_batch_guard::should_preserve_single_entry should_preserve_activation_state create_genesis_state perform_events_on_first_block should_pin commit_reveal contest: 316 pass. New:should_take_the_description_from_a_document_a_url_or_both, which creates a proposal with a url alone (and enters a choice for it), with both, with neither, and with a document named in part, with and without a url.cargo test -p dpp --lib -- data_contract consensus(3330 pass) and--test stored_contract_compatibility(3 pass).cargo test -p decision-proposals-contract -p platform-version.cargo clippyon dpp, drive-abci, platform-version and decision-proposals-contract with--tests: clean.In-place changes to shipped generations
None. No versioned method is edited. The change is the document schema of the decision proposals contract, which is registered from protocol version 15 (unreleased) and exists on no released network, plus test pins, a fixture line and documentation.
Breaking Changes
The decision proposals contract's
multipleChoiceProposalschema changes at protocol version 15, before its first release: the three description properties become optional as a group (all three or none) and twopropertyConstraintsrules are added. Protocol version 14 and earlier are unchanged.Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
b0ead30/skip-botsproceeds without the ones not yet reported/self-reviewedWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.