diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index d8e5111e3f..81dd1f9621 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -5681,6 +5681,7 @@ async def sign_and_send_extrinsic( sign_with: str = "coldkey", use_nonce: bool = False, nonce_key: str = "hotkey", + nonce: Optional[int] = None, period: Optional[int] = DEFAULT_PERIOD, raise_error: bool = False, wait_for_inclusion: bool = True, @@ -5722,7 +5723,9 @@ async def sign_and_send_extrinsic( ) signing_keypair = getattr(wallet, sign_with) extrinsic_data = {"call": call, "keypair": signing_keypair} - if use_nonce: + if nonce is not None: + extrinsic_data["nonce"] = nonce + elif use_nonce: if nonce_key not in possible_keys: raise AttributeError( f"'nonce_key' must be either 'coldkey', 'hotkey' or 'coldkeypub', not '{nonce_key}'" diff --git a/bittensor/core/extrinsics/asyncex/mev_shield.py b/bittensor/core/extrinsics/asyncex/mev_shield.py index b60f4ddad9..1fdd9cd5f6 100644 --- a/bittensor/core/extrinsics/asyncex/mev_shield.py +++ b/bittensor/core/extrinsics/asyncex/mev_shield.py @@ -182,9 +182,12 @@ async def submit_encrypted_extrinsic( current_nonce = await subtensor.substrate.get_account_next_index( account_address=inner_signing_keypair.ss58_address ) + next_nonce = await subtensor.substrate.get_account_next_index( + account_address=inner_signing_keypair.ss58_address + ) signed_extrinsic = await subtensor.substrate.create_signed_extrinsic( - call=call, keypair=inner_signing_keypair, nonce=current_nonce + 1, era=era + call=call, keypair=inner_signing_keypair, nonce=next_nonce, era=era ) mev_commitment, mev_ciphertext, payload_core = ( @@ -204,6 +207,7 @@ async def submit_encrypted_extrinsic( sign_with=sign_with, call=extrinsic_call, period=period, + nonce=current_nonce, raise_error=raise_error, wait_for_inclusion=wait_for_inclusion, wait_for_finalization=wait_for_finalization,