bittensor.core.extrinsics.asyncex.sudo#

Functions#

reset_coldkey_swap_extrinsic(subtensor, wallet, ...[, ...])

Resets the coldkey swap state for the given coldkey (root only).

sudo_set_admin_freeze_window_extrinsic(subtensor, ...)

Sets the admin freeze window length (in blocks) at the end of a tempo.

sudo_set_coldkey_swap_announcement_delay_extrinsic(...)

Sets the announcement delay for coldkey swap.

sudo_set_coldkey_swap_reannouncement_delay_extrinsic(...)

Sets the reannouncement delay for coldkey swap.

sudo_set_mechanism_count_extrinsic(subtensor, wallet, ...)

Sets the number of subnet mechanisms.

sudo_set_mechanism_emission_split_extrinsic(subtensor, ...)

Sets the emission split between mechanisms in a provided subnet.

swap_coldkey_extrinsic(subtensor, wallet, ...[, ...])

Performs a root-only coldkey swap without an announcement.

Module Contents#

async bittensor.core.extrinsics.asyncex.sudo.reset_coldkey_swap_extrinsic(subtensor, wallet, coldkey_ss58, *, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)#

Resets the coldkey swap state for the given coldkey (root only).

Clears the coldkey swap announcement and dispute for the specified coldkey. Only callable by root.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – AsyncSubtensor instance.

  • wallet (bittensor_wallet.Wallet) – Bittensor wallet object (must be root/admin wallet).

  • coldkey_ss58 (str) – SS58 address of the coldkey to reset the swap for.

  • period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

Notes

  • This function can only be called by root.

async bittensor.core.extrinsics.asyncex.sudo.sudo_set_admin_freeze_window_extrinsic(subtensor, wallet, window, *, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)#

Sets the admin freeze window length (in blocks) at the end of a tempo.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – AsyncSubtensor instance.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • window (int) – The amount of blocks to freeze in the end of a tempo.

  • period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

async bittensor.core.extrinsics.asyncex.sudo.sudo_set_coldkey_swap_announcement_delay_extrinsic(subtensor, wallet, duration, *, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)#

Sets the announcement delay for coldkey swap.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – AsyncSubtensor instance.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • duration (int) – The announcement delay in blocks.

  • period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

async bittensor.core.extrinsics.asyncex.sudo.sudo_set_coldkey_swap_reannouncement_delay_extrinsic(subtensor, wallet, duration, *, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)#

Sets the reannouncement delay for coldkey swap.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – AsyncSubtensor instance.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • duration (int) – The reannouncement delay in blocks.

  • period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

async bittensor.core.extrinsics.asyncex.sudo.sudo_set_mechanism_count_extrinsic(subtensor, wallet, netuid, mech_count, *, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)#

Sets the number of subnet mechanisms.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – Subtensor instance.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • netuid (int) – The subnet unique identifier.

  • mech_count (int) – The amount of subnet mechanism to be set.

  • period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

async bittensor.core.extrinsics.asyncex.sudo.sudo_set_mechanism_emission_split_extrinsic(subtensor, wallet, netuid, maybe_split, *, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)#

Sets the emission split between mechanisms in a provided subnet.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – AsyncSubtensor instance.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • netuid (int) – The subnet unique identifier.

  • maybe_split (bittensor.core.types.Weights) – List of emission weights (positive integers) for each subnet mechanism.

  • period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

Note

The maybe_split list defines the relative emission share for each subnet mechanism. Its length must match the number of active mechanisms in the subnet or be shorter, but not equal to zero. For example, [3, 1, 1] distributes emissions in a 3:1:1 ratio across subnet mechanisms 0, 1, and 2. Each mechanism’s emission share is calculated as: share[i] = maybe_split[i] / sum(maybe_split)

async bittensor.core.extrinsics.asyncex.sudo.swap_coldkey_extrinsic(subtensor, wallet, old_coldkey_ss58, new_coldkey_ss58, swap_cost, *, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)#

Performs a root-only coldkey swap without an announcement.

Only callable by root. Transfers all stake and associations from old_coldkey to new_coldkey; swap_cost (in RAO) is charged from old_coldkey. Use 0 for no charge.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – AsyncSubtensor instance.

  • wallet (bittensor_wallet.Wallet) – Bittensor wallet object (must be root/admin wallet).

  • old_coldkey_ss58 (str) – SS58 address of the coldkey to swap from.

  • new_coldkey_ss58 (str) – SS58 address of the coldkey to swap to.

  • swap_cost (int) – Cost in RAO charged from old_coldkey (use 0 for no charge).

  • period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

Notes

  • This function can only called by root.