Config (DAO‑Timelocked Parameters & Safety Rails)
Status: Finalized for v0 / v0.1 Owners: Governance Ops · Contracts Team · Node Operators WG Last updated: YYYY‑MM‑DD
1) Purpose & Scope
The Config module is the single on‑chain source of parameters that govern economics, dispute timing, reward splits, and operational limits. It is owned by a timelocked governance executor so changes are transparent and predictable.
ELI5: Config is the settings page for the whole system. The DAO turns the knobs, and after a short waiting period the new settings take effect, so everyone can see changes coming.
Used by: ArticlesRegistry, Actions, Disputes, Vault, NodeRewards, CIN nodes (read‑only), and UIs.
2) Responsibilities & Non‑Goals
Responsibilities
Store all tunable parameters with sane bounds and change‑rate limits.
Emit ConfigChanged events with old/new values.
Provide a canonical hash of all active parameters so nodes can tag snapshots.
Own addresses for core modules (CRUMBS, Vault, NodeRewards, Disputes, ArticlesRegistry).
Non‑Goals
Implement timelock logic itself (use OZ TimelockController, or equivalent).
Hold funds or perform economic calculations.
3) Parameter Inventory (v0 / v0.1)
All values are DAO‑timelocked. Defaults shown; update via governance if needed.
3.1 Actions (voting amounts & splits)
MIN_UP(CRUMBS) — 10MAX_UP_WEIGHT(CRUMBS) — 100 (cap per upvote for counted weight)DISLIKE(CRUMBS) — 25DOWNVOTE(CRUMBS) — 50VAULT_BPS_ON_COUNTED(bps) — 2000 (20% of counted upvote to Vault; tip goes 100% to author)
3.2 Disputes & Bonds
FLAG_FEE(CRUMBS) — 25FLAGS_TO_OPEN— 3GRACE_SECONDS— 10 days (time‑based, not blocks)PUBLISH_BOND(CRUMBS) — 100
Fairness rule: Disputes records
graceSecondsAtPublishwhenonPublishis called. Later changes toGRACE_SECONDSdo not retroactively affect existing publications.
3.3 Vault & Node Rewards
REWARDS_BPS_MAX(bps) — 4000 (≤40% of net inflow per epoch to node rewards)Splits (bps of rewards allocation):
REWARDS_SPLIT_UPTIME_BPS— 4000 (40%)REWARDS_SPLIT_BUILD_BPS— 4000 (40%)REWARDS_SPLIT_SERVE_BPS— 2000 (20%) (set to 0 if serve receipts are disabled)
Epoch cadence:
EPOCH_SECONDS— 7 daysAttestation policy:
ATTEST_MIN_BUILDERS— 2 (≥2 builders must match the same root)ATTEST_MIN_PEERS— 3 (2‑of‑3 agreement target)SERVE_MAX_RECEIPTS_PER_NODE— cap (anti‑gaming)
Language weights (optional):
LANG_WEIGHTS[code](e.g.,en:3, es:2, …),MIN_LANG_WEIGHT:1
3.4 Addresses (immutable after wiring unless DAO migrates)
CRUMBS(ERC‑20)VAULTNODEREWARDSDISPUTESARTICLESREGISTRYDAO_EXECUTOR(TimelockController or multisig executor)
3.5 Operational toggles (safety rails)
PAUSE_ACTIONS(bool) — false by default (emergency‑only; see §7)PAUSE_FLAGS(bool) — false by default(No pause for ArticlesRegistry to preserve publish availability.)
4) Events & Views
paramsHash() is the keccak256 of a canonical abi‑encoding of all active parameters. CIN nodes store this in snapshot metadata for auditability.
5) Governance & Timelock Model
Use OpenZeppelin TimelockController (or equivalent).
Flow: propose → queue (min delay) → execute, emitting
ConfigChangedon success.Recommended delay: 48–72 hours (DAO to decide).
For operational toggles (pauses), require the same timelock unless DAO creates a separate emergency role (see §7).
Change‑rate safety rails (recommended)
Per update, cap deltas to avoid shocks:
MIN_UP/MAX_UP_WEIGHT/DISLIKE/DOWNVOTE— max ±50%FLAG_FEE/PUBLISH_BOND— max ±50%GRACE_SECONDS— max ±2x / ÷2Rewards BPS & splits — must still sum to ≤10,000 BPS and each split ≤10,000 BPS
Hard bounds:
MIN_UP ≥ 1 CRUMBS,MAX_UP_WEIGHT ≥ MIN_UPDISLIKE > 0,DOWNVOTE > DISLIKEREWARDS_BPS_MAX ≤ 5000(≤50%)EPOCH_SECONDS ≥ 1 day,≤ 30 days
If a proposed value violates bounds, the setter reverts and must be re‑proposed.
6) Solidity Sketch
Note: Modules should read toggles (e.g.,
PAUSE_ACTIONS,PAUSE_FLAGS) and revert with a clear error (Paused()) when set. Defaults are false.
7) Safety Rails & Emergency Behavior
Pauses (optional):
PAUSE_ACTIONS: blocksupvote/dislike/downvoteentrypoints.PAUSE_FLAGS: blocksflagin Actions (Disputes refunds & bond functions remain available).Registry is never paused (publishing should remain permissionless).
Timelock applies to enabling/disabling pauses (no “instant kill switch” by default). If the DAO wants an emergency guard, deploy a separate, limited‑scope guardian that can toggle only these two booleans with a shorter delay (e.g., 6–12h), and require a regular timelock to re‑enable actions.
Backwards compatibility:
Changes to economics take effect immediately after execution for new actions.
GRACE_SECONDSchanges apply prospectively; Disputes stores the value at publish time for each CID.
8) CIN Nodes & paramsHash
paramsHashNodes should include
paramsHash()in snapshot metadata and expose it via/v1/snapshot/{lang}/latest.UIs can show “Index built under Config hash 0x…” to increase transparency.
When
ConfigChangedfires, nodes tag the next snapshot with the new hash.
9) Testing Checklist
Bounds & guards: each setter enforces min/max and rejects out‑of‑range values.
Timelock: only
DAO_EXECUTORcan call setters; direct calls revert.Events:
ConfigChangedemits accurate old/new values;Pausedfires on toggles.Hash stability: identical parameter sets produce the same
paramsHash.Module reactions:
Actions respects
PAUSE_ACTIONS/PAUSE_FLAGS.Disputes reads
GRACE_SECONDSonly atonPublishand persists it per CID.NodeRewards splits always sum to ≤ allocation.
10) Operational Playbooks
Adjusting Economics: propose updated MIN/ MAX/ splits → timelock executes → frontends auto‑read & display new values.
Dispute Window Change: propose new
GRACE_SECONDS→ affects future publishes; existing CIDs keep their stored grace.Turning Off Serve Rewards: set
REWARDS_SPLIT_SERVE_BPS = 0; redistribute to other buckets by raising their BPS values (ensure total ≤10,000).Language Weights: submit a batch transaction updating
LANG_WEIGHTS[code]for selected languages.
11) Acceptance Criteria
All dependent modules compile against Config interface and read parameters on use.
Timelocked updates change behavior without redeploys and with clear event traces.
Pauses, if toggled, halt only intended entrypoints and leave publishing & refunds unimpaired.
Nodes expose and roll forward
paramsHashin snapshots.
12) Changelog
v1: Initial Config with DAO‑timelocked parameters, evented updates, parameter hash, and optional pause toggles.
Last updated