Skip to content

feat: add per-account flags to block receiving TAO, Alpha, and locked Alpha#2746

Open
ppolewicz wants to merge 412 commits into
mainfrom
feat/block_receiving_transfers
Open

feat: add per-account flags to block receiving TAO, Alpha, and locked Alpha#2746
ppolewicz wants to merge 412 commits into
mainfrom
feat/block_receiving_transfers

Conversation

@ppolewicz

Copy link
Copy Markdown
Collaborator

Summary

Implements issue #2730: adds the ability for a destination address to block incoming transfers of TAO, staked Alpha, and locked Alpha.

What was added

  • 3 new storage maps in pallet-subtensor:

    • BlockReceivingTao<T> — per-account flag to block incoming TAO transfers
    • BlockReceivingAlpha<T> — per-account flag to block incoming staked-Alpha transfers
    • BlockReceivingLockedAlpha<T> — per-account flag to block incoming locked-Alpha transfers
  • 3 new extrinsics (call indices 139 / 140 / 141):

    • set_block_receiving_tao(enabled: bool)
    • set_block_receiving_alpha(enabled: bool)
    • set_block_receiving_locked_alpha(enabled: bool)
  • 3 new error variants:

    • ReceivingTaoBlocked
    • ReceivingAlphaBlocked
    • ReceivingLockedAlphaBlocked
  • 3 new events:

    • BlockReceivingTaoSet { account, enabled }
    • BlockReceivingAlphaSet { account, enabled }
    • BlockReceivingLockedAlphaSet { account, enabled }
  • Enforcement in existing transfer paths:

    • transfer_tao checks BlockReceivingTao
    • stake_into_subnet checks BlockReceivingAlpha
    • transfer_lock checks BlockReceivingLockedAlpha
  • 9 new unit tests in pallets/subtensor/src/tests/block_receiving.rs covering set/clear, blocking, and allow-after-clear for each flag.

Test plan

  • cargo fmt — no formatting issues
  • cargo clippy -p pallet-subtensor — no errors
  • cargo test -p pallet-subtensor --lib -- tests::block_receiving — 9/9 tests pass

l0r1s and others added 30 commits April 29, 2026 18:27
# Conflicts:
#	precompiles/src/staking.rs
gztensor and others added 26 commits June 5, 2026 09:57
[Re-merge] Fix for arithmetic side effect
Stage 1 of governance (only pallet-multi-collective unwired for now)
…code

Remove CreateSignedTransaction deadcode
Optimize locks to avoid full iteration of lock map
… Alpha

Implements issue #2730. Adds three new storage maps (BlockReceivingTao,
BlockReceivingAlpha, BlockReceivingLockedAlpha), three new extrinsics
(call_index 139/140/141), and enforces the flags in transfer_tao,
stake_into_subnet, and transfer_lock. Includes 9 unit tests.
@ppolewicz ppolewicz 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 added the hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet label Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨

It looks like you are trying to merge a hotfix PR into main. If this isn't what you wanted to do, and you just wanted to make a regular PR, please close this PR, base your changes off the devnet-ready branch and open a new PR into devnet ready.

If you are trying to merge a hotfix PR, please complete the following essential steps:

  1. go ahead and get this PR into main merged, so we can get the change in as quickly as possible!
  2. merge main into testnet, bumping spec_version
  3. deploy testnet
  4. merge testnet into devnet, bumping spec_version
  5. deploy devnet
  6. merge devnet into devnet-ready

If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to main, so it is essential that you do so.

Required by the check_spec_version CI check after adding new extrinsics
(set_block_receiving_tao/alpha/locked_alpha) that change the runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet 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.

9 participants