Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5647,6 +5647,10 @@ async def compose_call(

Returns:
GenericCall: Composed call object ready for extrinsic submission.

Notes:
For detailed documentation and examples of composing calls, including the CallBuilder utility, see:
<https://docs.learnbittensor.org/sdk/call>
"""
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)

Expand Down Expand Up @@ -6645,14 +6649,14 @@ async def mev_submit_encrypted(
self,
wallet: "Wallet",
call: "GenericCall",
signer_keypair: Optional["Keypair"] = None,
sign_with: str = "coldkey",
*,
period: Optional[int] = DEFAULT_PERIOD,
raise_error: bool = False,
wait_for_inclusion: bool = True,
wait_for_finalization: bool = True,
wait_for_revealed_execution: bool = True,
blocks_for_revealed_execution: int = 5,
blocks_for_revealed_execution: int = 3,
) -> ExtrinsicResponse:
"""
Submits an encrypted extrinsic to the MEV Shield pallet.
Expand All @@ -6663,17 +6667,17 @@ async def mev_submit_encrypted(
Parameters:
wallet: The wallet used to sign the extrinsic (must be unlocked, coldkey will be used for signing).
call: The GenericCall object to encrypt and submit.
signer_keypair: The keypair used to sign the inner call.
sign_with: The keypair to use for signing the inner call/extrinsic. Can be either "coldkey" or "hotkey".
period: 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: Raises a relevant exception rather than returning `False` if unsuccessful.
wait_for_inclusion: Whether to wait for the inclusion of the transaction.
wait_for_finalization: Whether to wait for the finalization of the transaction.
wait_for_revealed_execution: Whether to wait for the DecryptedExecuted event, indicating that validators
wait_for_revealed_execution: Whether to wait for the executed event, indicating that validators
have successfully decrypted and executed the inner call. If True, the function will poll subsequent
blocks for the event matching this submission's commitment.
blocks_for_revealed_execution: Maximum number of blocks to poll for the DecryptedExecuted event after
blocks_for_revealed_execution: Maximum number of blocks to poll for the executed event after
inclusion. The function checks blocks from start_block+1 to start_block + blocks_for_revealed_execution.
Returns immediately if the event is found before the block limit is reached.

Expand All @@ -6689,12 +6693,19 @@ async def mev_submit_encrypted(
payload_core = signer_bytes (32B) + nonce (u32 LE, 4B) + SCALE(call)
plaintext = payload_core + b"\\x01" + signature (64B for sr25519)
commitment = blake2_256(payload_core)

Notes:
For detailed documentation and examples of MEV Shield protection, see:
<https://docs.learnbittensor.org/sdk/mev-protection>

For creating GenericCall objects to use with this method, see:
<https://docs.learnbittensor.org/sdk/call>
"""
return await submit_encrypted_extrinsic(
subtensor=self,
wallet=wallet,
call=call,
signer_keypair=signer_keypair,
sign_with=sign_with,
period=period,
raise_error=raise_error,
wait_for_inclusion=wait_for_inclusion,
Expand Down
2 changes: 2 additions & 0 deletions bittensor/core/extrinsics/asyncex/children.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async def set_children_extrinsic(
raise_error: Raises a relevant exception rather than returning `False` if unsuccessful.
wait_for_inclusion: Waits for the transaction to be included in a block.
wait_for_finalization: Waits for the transaction to be finalized on the blockchain.
wait_for_revealed_execution: Whether to wait for the revealed execution of transaction if mev_protection used.

Returns:
ExtrinsicResponse: The result object of the extrinsic execution.
Expand Down Expand Up @@ -129,6 +130,7 @@ async def root_set_pending_childkey_cooldown_extrinsic(
raise_error: Raises a relevant exception rather than returning `False` if unsuccessful.
wait_for_inclusion: Waits for the transaction to be included in a block.
wait_for_finalization: Waits for the transaction to be finalized on the blockchain.
wait_for_revealed_execution: Whether to wait for the revealed execution of transaction if mev_protection used.

Returns:
ExtrinsicResponse: The result object of the extrinsic execution.
Expand Down
Loading