open-web3-stack/open-runtime-module-library

orml-authority

Closed this issue · 2 comments

xlc commented

A PoA governance module with delayed dispatch ability.

  • orml-traits

    • Type
      • enum DelayedDispatchTime
        • Move from schedule-update
      • trait Scheduler
        • schedule(origin: Origin, call: Call, when: DelayedDispatchTime): DispatchId
        • cancel(id: DispatchId)
  • orml-authority

    • Type

      • struct DelayedOrigin
        • delay: BlockNumber
        • origin: Origin
      • struct EnsureDelayed<Delay: Get<BlockNumber>, Inner: EnsureOrigin>
        • impl EnsureOrigin
          • check delay
          • use Inner to check origin
    • Trait

      • RootDispatchOrigin: EnsureOrigin
      • DelayedRootDispatchOrigin: EnsureOrigin
      • DelayedDispatchOrigin: EnsureOrigin
      • MinimumDelay: Get<BlockNumber>
      • VetoOrigin: EnsureOrigin
      • Scheduler: Scheduler
      • Call: Dispatchable
    • Calls

      • dispatch_root(origin, call: Call)
        • Require RootDispatchOrigin
        • Dispatch call with root origin
      • schedule_dispatch_root(origin, call: Call, when: DelayedDispatchTime)
        • Require InstanctDispatchOrigin or DelayedRootDispatchOrigin if when >= now + MinimumDelay
        • Schedule call at when with root origin
      • schedule_dispatch_delayed(origin, call: Call, when: DelayedDispatchTime)
        • Require DelayedDispatchOrigin
        • Schedule call at when with DelayedOrigin origin
      • veto(origin, dispatch_id: DispatchId)
        • Require VetoOrigin
        • Cancel a scheduled dispatchable

Depends on paritytech/substrate#6182 to enable more advanced use cases

xlc commented

This should enable something like

type UpdateOrigin = EnsureDelayed<OneDay, EnsureProportionMoreThan<_1, _2, AccountId, HonzonCouncilInstance>>;

So council can update, but need to wait for at least a day