Skip to content

Make setting ck take extrinsics payable#2750

Open
gztensor wants to merge 10 commits into
devnet-readyfrom
feat/ck-take-settings-pays-yes
Open

Make setting ck take extrinsics payable#2750
gztensor wants to merge 10 commits into
devnet-readyfrom
feat/ck-take-settings-pays-yes

Conversation

@gztensor

@gztensor gztensor commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Motivation

increase_take and decrease_take were marked as Pays::No, which means these state-mutating delegate take changes did not pay normal transaction fees. These calls should be payable like other user-submitted staking operations.

What Changed

  • Changed decrease_take dispatch metadata from Pays::No to Pays::Yes.
  • Changed increase_take dispatch metadata from Pays::No to Pays::Yes.
  • Added unit coverage asserting both calls remain DispatchClass::Normal and now report Pays::Yes.
  • Bumped runtime spec_version from 417 to 418.

Behavioral Impact

Delegate take increase/decrease transactions now participate in normal fee payment. The existing origin checks, take bounds, ownership checks, rate limiting, and underlying staking logic are otherwise unchanged.

Migration / Spec Version

No storage migration is required. This is a runtime-affecting metadata change and includes the required spec_version bump.

Testing

  • Added test_delegate_take_dispatch_info_pays_fee for the affected dispatch metadata.
  • Author checklist indicates ./scripts/fix_rust.sh and unit tests were run locally.

@gztensor gztensor self-assigned this Jun 11, 2026
@gztensor gztensor added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 11, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

///
#[pallet::call_index(65)]
#[pallet::weight((<T as crate::pallet::Config>::WeightInfo::decrease_take(), DispatchClass::Normal, Pays::No))]
#[pallet::weight((<T as crate::pallet::Config>::WeightInfo::decrease_take(), DispatchClass::Normal, Pays::Yes))]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[HIGH] Runtime fee semantics changed without a spec_version bump

This changes dispatch metadata for decrease_take from Pays::No to Pays::Yes, and the same PR also changes increase_take. That is a runtime-affecting semantic change, but the diff does not update runtime/src/lib.rs spec_version (currently 417). Shipping upgraded Wasm with the same spec version can leave nodes treating old native runtime code as compatible with the new on-chain runtime, which is especially risky here because old and new code disagree on whether these calls withdraw transaction fees. Bump spec_version in this PR.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

BASELINE scrutiny: established contributor with repo write permission and substantial prior subtensor activity; no Gittensor allowlist match found; branch feat/ck-take-settings-pays-yes -> devnet-ready.

Static-only review found no .github/ prompt/workflow changes, dependency changes, lockfile changes, build-script changes, or suspicious generated-JS execution hooks. The security-relevant runtime diff is limited to changing decrease_take and increase_take dispatch fee metadata from Pays::No to Pays::Yes, preserving normal dispatch class, carrying a spec_version bump, and retaining the previously reviewed swap_hotkey DB-read accounting fix.

Findings

No findings.

Prior-comment reconciliation

  • 97158285: addressed — The current swap_hotkey hunk still accrues reads(3) when new_hotkey exists and reads(1) when it does not, so the earlier DB-read accounting concern remains fixed.

Conclusion

No malicious pattern or security vulnerability was found in the current diff. The prior weight-accounting concern remains addressed.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor: UNKNOWN by allowlist; author has repo write permission and substantial recent subtensor contribution history, so calibrated as established.

Description discrepancies: the PR body is substantive but stale. It says spec_version moved 417 -> 418, while the current diff moves 423 -> 424; it also omits the included do_swap_hotkey ownership pre-check / weight-accounting change and the generated contract-tests/.papi/descriptors/dist bundle.

Overlapping PRs appear to share broad runtime/test files only; I did not identify a duplicate candidate for this exact fee-metadata fix. No auto-fixes were applied.

Findings

No findings.

Conclusion

Approving: the fee metadata change is directly covered, the prior swap-hotkey test concern no longer blocks, and I found no remaining domain issue that should block merge. The PR body should still be refreshed before merge so reviewers have an accurate change summary.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/subtensor/src/swap/swap_hotkey.rs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/subtensor/src/swap/swap_hotkey.rs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

gztensor and others added 2 commits June 11, 2026 13:20
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

open-junius
open-junius previously approved these changes Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

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