Module roles

Source
Expand description

Defines a unified abstraction layer for managing role-based logic within a runtime system.

It provides trait-based contracts that describe the lifecycle, funding, and economic behaviors of entities that assume specific roles, such as:

  • Validators and collators
  • Governance council members
  • Oracle operators or data feeders
  • Curators, auditors, or relayers

§Overview

Each trait in this module represents a composable building block for defining how a role behaves in a decentralized system. These abstractions are designed to be generic, interoperable, and extensible across multiple pallets or runtime modules.

§Currently Included Traits

  • RoleManager - Core lifecycle and collateral management for role-bearing entities.
  • FundRoles - Extends RoleManager with backing and funding capabilities.
  • CompensateRoles - Extends RoleManager with reward and penalty mechanics.
  • RoleProbation - Extends RoleManager with probation and permanence privileges.

§Future Extensions

These traits will compose together to form a role framework enabling complex behaviors (like staking, governance, delegation, conflict resolutions, etc) to be implemented consistently across different runtime modules.

§Design Philosophy

  • Composability: Each role trait defines minimal, orthogonal functionality that can be combined with others to form rich behavior.
  • Abstraction over implementation: These traits are interfaces, not storage-bound logic. Concrete modules implement them.
  • Interoperability: Enables higher-level systems (e.g. governance, incentives, or auditing) to operate generically across role types.
  • Auditability: Built-in temporal tracking (timestamps, holds, etc.) ensures transparent lifecycle and accounting for each role.

This approach allows shared governance, staking, and incentive systems to operate on generic roles without being tightly coupled to any single pallet or implementation.

Traits§

CompensateRoles
Extends RoleManager to introduce reward and penalty mechanics for role-based systems.
FundRoles
Extends RoleManager to introduce funding and backing mechanics for role-based systems.
RoleActivity
A lightweight abstraction for determining whether a role-bearing Candidate is currently idle or actively performing duties.
RoleManager
A universal abstraction for managing roles within a runtime context.
RoleProbation
Extends RoleManager to introduce probation and permanent status mechanics for role-based systems.