Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ignore:
- "packages/dpns-contract/src/**"
- "packages/keyword-search-contract/src/**"
- "packages/app-connect-contract/src/**"
- "packages/moderation-charters-contract/src/**"
- "packages/masternode-reward-shares-contract/src/**"
- "packages/token-history-contract/src/**"
- "packages/wallet-utils-contract/src/**"
Expand Down
3 changes: 3 additions & 0 deletions .github/package-filters/js-packages-direct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
'@dashevo/app-connect-contract':
- packages/app-connect-contract/**

'@dashevo/moderation-charters-contract':
- packages/moderation-charters-contract/**

'@dashevo/dashpay-contract':
- packages/dashpay-contract/**

Expand Down
4 changes: 4 additions & 0 deletions .github/package-filters/js-packages-no-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
'@dashevo/app-connect-contract': &app-connect-contract
- packages/app-connect-contract/**

'@dashevo/moderation-charters-contract': &moderation-charters-contract
- packages/moderation-charters-contract/**

'@dashevo/dashpay-contract': &dashpay-contract
- packages/dashpay-contract/**

Expand All @@ -39,6 +42,7 @@
- *document-history-contract
- *keyword-search-contract
- *app-connect-contract
- *moderation-charters-contract
- packages/rs-platform-serialization/**
- packages/rs-platform-serialization-derive/**
- packages/rs-platform-value/**
Expand Down
5 changes: 5 additions & 0 deletions .github/package-filters/js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
- .github/workflows/tests*
- packages/app-connect-contract/**

'@dashevo/moderation-charters-contract': &moderation-charters-contract
- .github/workflows/tests*
- packages/moderation-charters-contract/**

'@dashevo/dashpay-contract': &dashpay-contract
- .github/workflows/tests*
- packages/dashpay-contract/**
Expand Down Expand Up @@ -50,6 +54,7 @@
- *document-history-contract
- *keyword-search-contract
- *app-connect-contract
- *moderation-charters-contract
- packages/rs-platform-serialization/**
- packages/rs-platform-serialization-derive/**
- packages/rs-platform-value/**
Expand Down
5 changes: 5 additions & 0 deletions .github/package-filters/rs-packages-direct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ app-connect-contract:
- packages/app-connect-contract/schema/**
- packages/app-connect-contract/Cargo.toml

moderation-charters-contract:
- packages/moderation-charters-contract/src/**
- packages/moderation-charters-contract/schema/**
- packages/moderation-charters-contract/Cargo.toml

dashpay-contract:
- packages/dashpay-contract/src/**
- packages/dashpay-contract/schema/**
Expand Down
6 changes: 6 additions & 0 deletions .github/package-filters/rs-packages-no-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ app-connect-contract: &app-connect-contract
- packages/app-connect-contract/schema/**
- packages/app-connect-contract/Cargo.toml

moderation-charters-contract: &moderation-charters-contract
- packages/moderation-charters-contract/src/**
- packages/moderation-charters-contract/schema/**
- packages/moderation-charters-contract/Cargo.toml

dashpay-contract: &dashpay-contract
- packages/dashpay-contract/src/**
- packages/dashpay-contract/schema/**
Expand Down Expand Up @@ -57,6 +62,7 @@ data-contracts: &data-contracts
- *keyword-search-contract
- *document-history-contract
- *app-connect-contract
- *moderation-charters-contract

dpp: &dpp
- packages/rs-dpp/**
Expand Down
7 changes: 7 additions & 0 deletions .github/package-filters/rs-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ app-connect-contract: &app-connect-contract
- packages/app-connect-contract/schema/**
- packages/app-connect-contract/Cargo.toml

moderation-charters-contract: &moderation-charters-contract
- .github/workflows/tests*
- packages/moderation-charters-contract/src/**
- packages/moderation-charters-contract/schema/**
- packages/moderation-charters-contract/Cargo.toml

dashpay-contract: &dashpay-contract
- .github/workflows/tests*
- packages/dashpay-contract/src/**
Expand Down Expand Up @@ -68,6 +74,7 @@ data-contracts: &data-contracts
- *keyword-search-contract
- *document-history-contract
- *app-connect-contract
- *moderation-charters-contract

dpp: &dpp
- .github/workflows/tests*
Expand Down
1 change: 1 addition & 0 deletions .github/package-filters/test-suite-triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ run:
- packages/document-history-contract/**
- packages/keyword-search-contract/**
- packages/app-connect-contract/**
- packages/moderation-charters-contract/**
- packages/wallet-utils-contract/**
# Local network scripts and action
- .github/actions/local-network/**
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests-rs-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ jobs:
--package wallet-utils-contract \
--package keyword-search-contract \
--package app-connect-contract \
--package moderation-charters-contract \
--all-features \
--locked \
-E 'not test(~shield) and (not binary_id(=drive-abci::strategy_tests) or test(~comprehensive_mixed_operations) or test(~process_proposal_collision))'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ jobs:
- .github/workflows/tests.yml
- packages/swift-sdk/**
- packages/app-connect-contract/**
- packages/moderation-charters-contract/**
- packages/dapi-grpc/**
- packages/dashpay-contract/**
- packages/data-contracts/**
Expand Down
21 changes: 21 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ members = [
"packages/document-history-contract",
"packages/keyword-search-contract",
"packages/app-connect-contract",
"packages/moderation-charters-contract",
"packages/rs-sdk-ffi",
"packages/wasm-drive-verify",
"packages/dash-platform-balance-checker",
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
ARG SCCACHE_BUCKET
ARG AWS_PROFILE
ARG SCCACHE_REGION
ARG SCCACHE_S3_KEY_PREFIX

Check warning on line 216 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker images (RS-DAPI, rs-dapi, rs-dapi) / Build RS-DAPI image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "SCCACHE_S3_KEY_PREFIX") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 216 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker images (Drive, drive, drive-abci, SDK_TEST_DATA=true ) / Build Drive image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "SCCACHE_S3_KEY_PREFIX") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 216 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "SCCACHE_S3_KEY_PREFIX") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG SCCACHE_ENDPOINT

# Generate sccache configuration variables and save them to /root/env
Expand Down Expand Up @@ -402,6 +402,7 @@
packages/document-history-contract \
packages/keyword-search-contract \
packages/app-connect-contract \
packages/moderation-charters-contract \
packages/data-contracts \
packages/strategy-tests \
packages/simple-signer \
Expand Down Expand Up @@ -525,6 +526,7 @@
packages/document-history-contract \
packages/keyword-search-contract \
packages/app-connect-contract \
packages/moderation-charters-contract \
packages/withdrawals-contract \
packages/masternode-reward-shares-contract \
packages/dpns-contract \
Expand Down Expand Up @@ -708,6 +710,7 @@
packages/document-history-contract \
packages/keyword-search-contract \
packages/app-connect-contract \
packages/moderation-charters-contract \
packages/masternode-reward-shares-contract \
packages/dpns-contract \
packages/data-contracts \
Expand Down Expand Up @@ -851,6 +854,7 @@
COPY --from=build-dashmate-helper /platform/packages/document-history-contract packages/document-history-contract
COPY --from=build-dashmate-helper /platform/packages/keyword-search-contract packages/keyword-search-contract
COPY --from=build-dashmate-helper /platform/packages/app-connect-contract packages/app-connect-contract
COPY --from=build-dashmate-helper /platform/packages/moderation-charters-contract packages/moderation-charters-contract
COPY --from=build-dashmate-helper /platform/packages/withdrawals-contract packages/withdrawals-contract
COPY --from=build-dashmate-helper /platform/packages/masternode-reward-shares-contract packages/masternode-reward-shares-contract
COPY --from=build-dashmate-helper /platform/packages/dpns-contract packages/dpns-contract
Expand Down Expand Up @@ -955,6 +959,7 @@
packages/document-history-contract \
packages/keyword-search-contract \
packages/app-connect-contract \
packages/moderation-charters-contract \
packages/withdrawals-contract \
packages/masternode-reward-shares-contract \
packages/dpns-contract \
Expand Down
2 changes: 1 addition & 1 deletion book/src/architecture/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Here is a simplified view of every Rust workspace member, grouped by role:
| **gRPC definitions** | `dapi-grpc` |
| **WASM bindings** | `wasm-dpp`, `wasm-dpp2`, `wasm-sdk`, `wasm-drive-verify` |
| **iOS/FFI** | `rs-sdk-ffi` |
| **System contracts** | `dpns-contract`, `dashpay-contract`, `withdrawals-contract`, `masternode-reward-shares-contract`, `wallet-utils-contract`, `token-history-contract`, `keyword-search-contract`, `document-history-contract`, `app-connect-contract`, `data-contracts` |
| **System contracts** | `dpns-contract`, `dashpay-contract`, `withdrawals-contract`, `masternode-reward-shares-contract`, `wallet-utils-contract`, `token-history-contract`, `keyword-search-contract`, `document-history-contract`, `app-connect-contract`, `moderation-charters-contract`, `data-contracts` |
| **Tooling** | `dashmate` (JS), `strategy-tests`, `simple-signer`, `check-features`, `json-schema-compatibility-validator` |
| **Other** | `dash-platform-macros`, `rs-dash-event-bus`, `rs-platform-wallet`, `dash-platform-balance-checker`, `rs-dapi` |

Expand Down
4 changes: 2 additions & 2 deletions book/src/data-model/contract-moderation.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ pub struct ElectedModerators {

The declaration lives in `packages/rs-dpp/src/data_contract/config/moderation/elected.rs`. On the wire it is the third `$type` of the moderators, flat: `{"$type": "elected", "challengeCoolDown": 1209600, "moderatedDocumentTypes": {"post": ["ban", "deleteDocuments"]}, "interim": {"$type": "notYetUsable"}}`, with `joinWindow`, `voteWindow`, `electionDelay` and `ownerProtected` optional. Its parts:

- **The election parameters** are fixed once set (`SystemLimits`: `min_contract_moderation_election_window_seconds` and `max_contract_moderation_election_window_seconds` bound both windows, `min_contract_moderation_challenge_cool_down_seconds` and `max_contract_moderation_challenge_cool_down_seconds` the cool-down). The join window is how long applicants may join an election once the first one applied, the vote window how long masternodes then vote, and the cool-down how long a seated team is safe from a challenge after a seat change. Nothing reads them yet. The **election delay** is the one parameter the contract sets freely: how many seconds after its creation the first charter may be filed against it, the notice the contract gives before its first election can be called. It is optional and unbounded; left out, the election may be called at once. Because the declaration is made at the contract's creation and never changes, the creation is the declaration's own time. The charter contract's `targetContractId` reads it through the `moderation: "electionOpen"` requirement below.
- **The moderated set** is the document types the team moderates, each with the abilities a charter may claim on it: non-empty, each type a document type of the contract, each ability set non-empty and backed by the contract (`ban` needs the banlist, `suspend` the suspension list, `warn` the warning list, `deleteDocuments` the type itself flagged `canBeDeletedByModerators`, so deletions reach only flagged types, within their window). The charter of a team will say how those types are moderated, never which. The lists stay contract-wide: an ability on a type is what a team may do over the documents of that type. The set also bounds the interim block. A charter does not price the moderators part of an action: a type's own `actionFees.moderators` amount is the most a team may charge, a charter charges a share of it (the charter contract's business, not the declaration's), and the owner part stays what the type declares, immutable as before.
- **The election parameters** are fixed once set (`SystemLimits`: `min_contract_moderation_election_window_seconds` and `max_contract_moderation_election_window_seconds` bound both windows, `min_contract_moderation_challenge_cool_down_seconds` and `max_contract_moderation_challenge_cool_down_seconds` the cool-down). The join window is how long applicants may join an election once the first one applied, the vote window how long masternodes then vote, and the cool-down how long a seated team is safe from a challenge after a seat change. Nothing reads them yet. The **election delay** is the one parameter the contract sets freely: how many seconds after its creation the first charter may be filed against it, the notice the contract gives before its first election can be called. It is optional and unbounded; left out, the election may be called at once. Because the declaration is made at the contract's creation and never changes, the creation is the declaration's own time. The charter contract's `targetContractId` reads it through the `moderation: "electionOpen"` requirement below. **`maxAddedModerators`** says how many members the leader of a seated team may add after the election, each one an identity that asked to join the team's proposal: additions ever filed, so a removal or a resignation frees no slot. It is 0 when left out, a team then being exactly what was elected, and at most `SystemLimits::max_contract_moderation_added_moderators` (15).
- **The moderated set** is the document types the team moderates, each with the abilities the seated team holds on it: non-empty, each type a document type of the contract, each ability set non-empty and backed by the contract (`ban` needs the banlist, `suspend` the suspension list, `warn` the warning list, `deleteDocuments` the type itself flagged `canBeDeletedByModerators`, so deletions reach only flagged types, within their window). The charter of a team will say how those types are moderated, never which. The lists stay contract-wide: an ability on a type is what a team may do over the documents of that type. The set also bounds the interim block. A charter does not price the moderators part of an action: a type's own `actionFees.moderators` amount is the most a team may charge, a charter charges a share of it (the charter contract's business, not the declaration's), and the owner part stays what the type declares, immutable as before.
- **The interim** says who moderates until a team is seated. `ContractOwner` and `AppointedModerators(set)` are the merged kinds, with their authority, their limit and their existence check (41110 at create): they moderate, they are protected, and they are the team that claims the moderators pot. `NotYetUsable` names nobody: nobody moderates, nobody claims the pot (it accumulates for the team to come, `ContractFeeClaimNotAllowedError` for everyone), and the moderated document types can not be used. A contract that never attracts a team keeps those types unusable for good; the other types work as on an unmoderated contract. `NoModeration` names nobody too, with the moderated types usable meanwhile: nobody moderates and nobody claims the pot, and every type works as on an unmoderated contract until a team is seated.
- **The owner flag** says whether the contract owner is protected from the team once one is seated, as the owner and the moderators of the merged kinds are (41102 on a ban, a suspension or a deletion of its documents). Not protected by default. During the interim the owner is protected whenever it moderates, flag or not: `ContractModerationConfig::protects` is what the moderation transition checks, and it is `may_moderate` or the flag for the owner.

Expand Down
Loading
Loading