Skip to content

Conversation

@grbIzl
Copy link
Contributor

@grbIzl grbIzl commented Dec 8, 2025

Description

Incorrect Sudo transactions are filtered out inside TransactionExtension to prevent adding them into the transactions pool.

Related Issue(s)

  • Closes #[issue number]

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.

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.

Additional Notes

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

@grbIzl grbIzl force-pushed the feat/reject-incorrect-sudo-exts branch from d6bc13d to 2833c55 Compare December 8, 2025 16:42
@grbIzl grbIzl changed the base branch from devnet-ready to devnet December 8, 2025 17:08
@grbIzl grbIzl changed the base branch from devnet to devnet-ready December 8, 2025 17:09
@grbIzl grbIzl force-pushed the feat/reject-incorrect-sudo-exts branch from 167c319 to 76757b9 Compare December 8, 2025 17:12
@grbIzl grbIzl changed the base branch from devnet-ready to devnet December 8, 2025 17:12
@grbIzl grbIzl marked this pull request as ready for review December 9, 2025 07:10
Copy link
Collaborator

@shamil-gadelshin shamil-gadelshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we add a sudo dependency to subtensor? Can we add the new tx extension to the runtime code instead?

@grbIzl grbIzl changed the base branch from devnet to devnet-ready December 9, 2025 16:50
@grbIzl
Copy link
Contributor Author

grbIzl commented Dec 9, 2025

Why do we add a sudo dependency to subtensor? Can we add the new tx extension to the runtime code instead?

Good idea. It will be cleaner in this case.

const IDENTIFIER: &'static str = "SudoTransactionExtension";

type Implicit = ();
type Val = Option<T::AccountId>;
Copy link
Collaborator

@l0r1s l0r1s Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type Val = Option<T::AccountId>;
type Val = ();

I get the impression the Val is never used? So may be better to just use unit type.

It is only used if you have a prepare implementation because it is passed as a parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also use it in return type for validate.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also use it in return type for validate.

Yes, but the validate return value is only used in the prepare function and because there is no implementation here, it is not used at all so you can just remove it from Val and from return type of validate

Copy link
Collaborator

@l0r1s l0r1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comments

@grbIzl grbIzl added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Dec 15, 2025
@grbIzl grbIzl removed the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Dec 16, 2025
@sam0x17 sam0x17 merged commit 133d8d9 into devnet-ready Dec 16, 2025
167 checks passed
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.

5 participants