Skip to content
  • Bastian Köcher's avatar
    pallet-scheduler: Introduce `OriginPrivilegeCmp` (#10078) · 95b8fd61
    Bastian Köcher authored
    
    
    * pallet-scheduler: Introduce `OriginPrivilegeCmp`
    
    When a scheduled task should be canceled, the origin that tries to
    cancel the task is compared to the origin the task should be executed
    with. Before this pr this check only allowed that both origins are
    equal. However, this is problematic as this means that for example a
    council origin it needs to be have the same amount of yes votes to
    cancel the scheduled task. While a council origin with more yes votes
    should be able to cancel this task. This happened recently on Kusama and
    lead to a failed cancelation of a scheduled task. With this pr the two
    origins are compared and the cancelling origin needs to have greater or
    equal privileges as the origin that scheduled the task. What a greater,
    equal or less privilege is, can be configured in the runtime.
    
    For simplicity, a `EqualPrivilegeOnly` implementation is provided that
    only checks if two origins are equal. So, this mimics the old behaviour.
    
    * FMT
    
    * fix import
    
    * Small optimizations
    
    Co-authored-by: default avatarShawn Tabrizi <[email protected]>
    95b8fd61