Skip to content

Implement Governance SmartContract #86

@arrivets

Description

@arrivets

Refer to the arkiv fee spec: https://github.com/Arkiv-Network/arkiv-architecture/blob/main/arkiv/tokenomics/arkiv-fee-spec.md

Solidity contract storing all fee-function knobs (spec §4, §5), read by the
EntityRegistry precompile at execution time. Lives alongside
contracts/src/EntityRegistry.sol. Deployed as a predeploy from genesis.

State (all governance-writable)

  • fee_multiplier (uint, bounded [0, fee_multiplier_max])
  • usd_per_glm (uint, fixed-point — pick scale in PR)
  • op_cost_create / delete / set_attr / remove_attr / extend / change_owner
  • storage_rate_USD_per_KB_per_day
  • fee_multiplier_max (deploy-time; change requires longer timelock)

Emit an event on every write.

Writes (per-update caps + timelock from spec §4, §9)

  • setFeeMultiplier: ±X% per-update cap, short timelock
  • setUsdPerGlm: ±20% per-update cap (spec §4), longer timelock, multi-sig
  • setOpCost / setStorageRate: longer timelock
  • setFeeMultiplierMax: longest timelock (rare change)

Access control

Decisions to make in this PR (escalate to #85 if unclear):

  • Multi-sig implementation: Safe (Gnosis) at a known per-chain address, or
    custom. Default proposal: Safe.
  • Timelock: separate contract (e.g., OZ TimelockController) between the
    multi-sig and this contract, or in-contract delay. Default proposal:
    separate TimelockController, one per cadence-tier.
  • Role granularity: one role for everything, or split fast-moving knobs
    (fee_multiplier) from slow knobs (op_cost_*, storage_rate). Default
    proposal: two roles — FAST_GOVERNOR (fee_multiplier, usd_per_glm) and
    SLOW_GOVERNOR (everything else).

Acceptance tests must cover: unauthorized write reverts; authorized write
below cap succeeds after timelock; authorized write above cap reverts; write
from FAST_GOVERNOR to a SLOW_GOVERNOR-only knob reverts.

Genesis / deployment

The contract must exist from block 0 with initial values seeded, before the
first op can be charged.

  • Predeploy address: pick a system-contract slot, consistent across chains
    (Kaolin testnet, dev, mainnet).
  • Update crates/arkiv-genesis/src/lib.rs and chainspec/dev.base.json to
    include the predeploy bytecode + initial storage layout.
  • Initial values: placeholders pending Calibrate Gas Constants #89; structure them so Calibrate Gas Constants #89's PR is a
    one-line constant swap.
  • Owner / governance roles wired to the chain's governance multi-sig at launch.
  • Verify Kaolin testnet bring-up uses the same path (no manual deploy step).

Reads

Public getters for every field, called by the precompile (#87) on every op.
Per spec §4 "display reconciliation": values must be queryable at any block
height so callers can verify before signing.

Out of scope

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions