Skip to content

Update transaction_payment_wrapper: charge fees for hotkey from its coldkey#2570

Open
evgeny-s wants to merge 9 commits intodevnet-readyfrom
coldkey-pays-tx-fees-if-hotkey-origin
Open

Update transaction_payment_wrapper: charge fees for hotkey from its coldkey#2570
evgeny-s wants to merge 9 commits intodevnet-readyfrom
coldkey-pays-tx-fees-if-hotkey-origin

Conversation

@evgeny-s
Copy link
Copy Markdown
Collaborator

@evgeny-s evgeny-s commented Apr 7, 2026

Description

Coldkey should pay transaction fees in case the origin is a hotkey
Extrinsics to be enabled:

  • set_weights
  • set_mechanism_weights
  • batch_set_weights
  • commit_weights
  • commit_mechanism_weights
  • reveal_weights
  • reveal_mechanism_weights
  • commit_crv3_mechanism_weights
  • batch_reveal_weights
  • serve_axon
  • serve_axon_tls
  • serve_prometheus
  • associate_evm_key
  • commit_timelocked_weights
  • commit_timelocked_mechanism_weights
  • set_commitment

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.

@evgeny-s evgeny-s changed the title Coldkey pays tx fees for its hotkey Update transaction_payment_wrapper: charge fees for hotkey from its coldkey Apr 7, 2026
@evgeny-s evgeny-s added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Apr 7, 2026
Comment on lines +240 to +241
} else if let Some(coldkey) = Self::extract_coldkey_fee_payer(&origin) {
frame_system::RawOrigin::Signed(coldkey).into()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

On top of that, we should check on the DispatchInfo if the call is Pays::No

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For Pays::No extrinsics, fees won't be charged anyway.


fn is_coldkey_fee_payer_eligible(call: &RuntimeCallOf<T>) -> bool {
match call.is_sub_type() {
Some(pallet_subtensor::Call::set_weights { .. }) => true,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@l0r1s , added the additional validation for the list of extrinsics we want to apply this to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants