Skip to content

Moderation charters system data contract (moderation teams C1) #4878

Closed

Description

@QuantumExplorer

Part of #4865 (decentralized moderation teams). Item C1 of the PR split. Wave 1: no dependency, can start now.

Summary

A new system data contract for moderation charters. A team applies to moderate a contract by creating a charter document in it. The charter says how the team moderates, what it charges and how it splits the pay.

Decisions implemented: D1 (amended), D15, D29, D30, D34, D38, D50, D57, D58, D60 in #4865.

Current behaviour

System contracts live in their own packages (packages/dpns-contract, packages/document-history-contract, ...), are aggregated by packages/data-contracts, versioned in packages/rs-platform-version/src/version/system_data_contract_versions/, and created in state at the first block of the protocol version that introduces them. There is no charter contract.

Scope

  • Package packages/moderation-charters-contract (name open) with a v1 JSON schema and the Rust crate, wired into data-contracts, the system contract versions, and the JS side the way feat(platform)!: document history system contract with per-doctype opt-in #4171 did for document history.
  • Document type charter, immutable and undeletable (D60):
    • targetContractId, on a contested unique index so a create opens the election (D57); the index is marked as a moderation election so A3 sources the windows and fund from the target contract;
    • description: free text, at most 4096 bytes (D58);
    • abilities: the subset of delete, ban, suspend, warn the team claims, with a required power per ability (D9);
    • members: the initial membership with a power each, the applicant is the leader and is a member with a power (D28, D29, D30), at most 16 members;
    • reasonCodes: the code table, code to label (D50);
    • moderatorsAmounts: the moderators amount per moderated document type and per action (D45);
    • split: leader share, equal share, action-count share, three percentages summing to 100 (D34, D38).
  • Pure-data validation of the charter lives in rs-dpp so consensus PRs can call it: percentages sum to 100, powers reachable by the listed members, abilities within the envelope of the target contract (checked by H2, not here).
  • Ship the contract definition and registration. Do not add the first-block creation to perform_events_on_first_block_of_protocol_change in this PR; H2 adds it, so no contest can open before elections exist.

Out of scope

  • Opening the poll (A3, H2), the seated team (H1).

Tests

  • Schema fixture round-trips through rs-dpp and the JS contract test, like documentHistoryContract.spec.js.
  • Validation refuses percentages not summing to 100, more than 16 members, a leader missing from the members, and a description over 4096 bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions