Skip to content

Conversation

@jose-blockchain
Copy link

@jose-blockchain jose-blockchain commented Jan 20, 2026

Description

This PR implements filtering of incorrect subnet owner transactions in TransactionExtension to prevent them from entering the transaction pool. The validation happens early in the transaction lifecycle, rejecting signed transactions from non-owners before they are added to the pool. Root origin transactions are allowed to pass through (since they cannot be detected in TransactionExtension) and are properly validated in the dispatch functions.

Related Issue(s)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

N/A - This is a bug fix that adds validation to prevent invalid transactions from entering the pool. Existing valid transactions continue to work as before.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

N/A

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

Implementation Details:

  • Added InvalidSubnetOwner variant to CustomTransactionError enum with error code 21
  • Added is_subnet_owner() helper function in SubtensorTransactionExtension to check ownership
  • Validation is performed in TransactionExtension::validate() for:
    • start_call - requires subnet owner (uses ensure_subnet_owner)
    • update_symbol - requires subnet owner or root (uses ensure_subnet_owner_or_root)
    • sudo_set_root_claim_threshold - requires subnet owner or root (uses ensure_subnet_owner_or_root)

Behavior:

  • Signed transactions from subnet owners: Pass validation ✓
  • Signed transactions from non-owners: Rejected with InvalidSubnetOwner error at transaction pool level ✓
  • Root origin (unsigned) transactions: Pass through TransactionExtension, validated in dispatch function ✓

Potential Reviewers:
@l0r1s

- Add InvalidSubnetOwner to CustomTransactionError enum
- Validate subnet owner for start_call, update_symbol, and sudo_set_root_claim_threshold
- Prevents invalid transactions from entering the transaction pool
- Root origin passes through and is validated in dispatch function

Fixes opentensor#2338
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.

Filter for incorrect subnet owner calls

1 participant