Skip to content

feat: add CancelProxy type for time-delayed proxy announcements#2402

Open
thecaptain789 wants to merge 1 commit intoopentensor:mainfrom
thecaptain789:feat/cancel-proxy-type
Open

feat: add CancelProxy type for time-delayed proxy announcements#2402
thecaptain789 wants to merge 1 commit intoopentensor:mainfrom
thecaptain789:feat/cancel-proxy-type

Conversation

@thecaptain789
Copy link

Summary

This PR adds a new CancelProxy proxy type that enables users to delegate the ability to reject proxy announcements without granting other permissions.

Closes #590

Motivation

When using time-delayed proxies, users need the ability to:

  • Cancel pending announcements for security purposes
  • Delegate this cancel ability without granting broader permissions
  • Analyze transactions before they execute and reject suspicious ones

The CancelProxy type addresses this by only allowing reject_announcement calls from the proxy pallet.

Changes

  1. common/src/lib.rs

    • Added CancelProxy variant to ProxyType enum
    • Added TryFrom implementation (value: 18)
    • Added From implementation (ProxyType::CancelProxy => 18)
  2. runtime/src/lib.rs

    • Added InstanceFilter implementation that only allows reject_announcement calls

Usage

Users can now add a proxy with the CancelProxy type to delegate the ability to reject pending announcements:

// Add a Cancel proxy
Proxy::add_proxy(origin, delegate, ProxyType::CancelProxy, delay);

// The delegate can then reject announcements
Proxy::reject_announcement(origin, real, call_hash);

Testing

The existing mock implementations use catch-all patterns and will handle the new variant correctly.

This PR adds a new  proxy type that enables users to delegate
the ability to reject proxy announcements without granting other permissions.

This is particularly useful for time-delayed proxies where:
- Users want to be able to cancel pending announcements for security
- They don't want to grant broader permissions to the delegate
- The Cancel proxy can ONLY call  from the proxy pallet

Implements the feature request from issue opentensor#590.

Changes:
- Added CancelProxy variant to ProxyType enum
- Added TryFrom/From implementations (value: 18)
- Added InstanceFilter implementation allowing only reject_announcement calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include Cancel proxy type

1 participant