From 51da68e32df5941f82117fae5f676af1718db294 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Mon, 5 May 2025 20:00:58 +0200 Subject: [PATCH 1/3] Change default era period to 10. --- bittensor_cli/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index 80ddc4a0d..75ad791d4 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -294,7 +294,7 @@ class Options: help="Outputs the result of the command as JSON.", ) era: int = typer.Option( - 3, help="Length (in blocks) for which the transaction should be valid." + 10, help="Length (in blocks) for which the transaction should be valid." ) From a1501d7b3b8e4b8e485e4e92464275ef1a8cc755 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Mon, 5 May 2025 20:53:11 +0200 Subject: [PATCH 2/3] Update "era" to "period" --- bittensor_cli/cli.py | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index 75ad791d4..d03f41dab 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -293,8 +293,11 @@ class Options: "--json-out", help="Outputs the result of the command as JSON.", ) - era: int = typer.Option( - 10, help="Length (in blocks) for which the transaction should be valid." + period: int = typer.Option( + 10, + "--period", + "--era", + help="Length (in blocks) for which the transaction should be valid.", ) @@ -1792,7 +1795,7 @@ def wallet_transfer( transfer_all: bool = typer.Option( False, "--all", prompt=False, help="Transfer all available balance." ), - era: int = Options.era, + period: int = Options.period, wallet_name: str = Options.wallet_name, wallet_path: str = Options.wallet_path, wallet_hotkey: str = Options.wallet_hotkey, @@ -1847,7 +1850,7 @@ def wallet_transfer( destination=destination_ss58_address, amount=amount, transfer_all=transfer_all, - era=era, + era=period, prompt=prompt, json_output=json_output, ) @@ -3190,7 +3193,7 @@ def stake_add( rate_tolerance: Optional[float] = Options.rate_tolerance, safe_staking: Optional[bool] = Options.safe_staking, allow_partial_stake: Optional[bool] = Options.allow_partial_stake, - era: int = Options.era, + period: int = Options.period, prompt: bool = Options.prompt, quiet: bool = Options.quiet, verbose: bool = Options.verbose, @@ -3386,7 +3389,7 @@ def stake_add( rate_tolerance, allow_partial_stake, json_output, - era, + period, ) ) @@ -3438,7 +3441,7 @@ def stake_remove( rate_tolerance: Optional[float] = Options.rate_tolerance, safe_staking: Optional[bool] = Options.safe_staking, allow_partial_stake: Optional[bool] = Options.allow_partial_stake, - era: int = Options.era, + period: int = Options.period, prompt: bool = Options.prompt, interactive: bool = typer.Option( False, @@ -3631,7 +3634,7 @@ def stake_remove( exclude_hotkeys=exclude_hotkeys, prompt=prompt, json_output=json_output, - era=era, + era=period, ) ) elif ( @@ -3687,7 +3690,7 @@ def stake_remove( rate_tolerance=rate_tolerance, allow_partial_stake=allow_partial_stake, json_output=json_output, - era=era, + era=period, ) ) @@ -3715,7 +3718,7 @@ def stake_move( stake_all: bool = typer.Option( False, "--stake-all", "--all", help="Stake all", prompt=False ), - era: int = Options.era, + period: int = Options.period, prompt: bool = Options.prompt, quiet: bool = Options.quiet, verbose: bool = Options.verbose, @@ -3845,7 +3848,7 @@ def stake_move( destination_hotkey=destination_hotkey, amount=amount, stake_all=stake_all, - era=era, + era=period, interactive_selection=interactive_selection, prompt=prompt, ) @@ -3886,7 +3889,7 @@ def stake_transfer( stake_all: bool = typer.Option( False, "--stake-all", "--all", help="Stake all", prompt=False ), - era: int = Options.era, + period: int = Options.period, prompt: bool = Options.prompt, quiet: bool = Options.quiet, verbose: bool = Options.verbose, @@ -4008,7 +4011,7 @@ def stake_transfer( dest_netuid=dest_netuid, dest_coldkey_ss58=dest_ss58, amount=amount, - era=era, + era=period, interactive_selection=interactive_selection, stake_all=stake_all, prompt=prompt, @@ -4050,7 +4053,7 @@ def stake_swap( "--all", help="Swap all available stake", ), - era: int = Options.era, + period: int = Options.period, prompt: bool = Options.prompt, wait_for_inclusion: bool = Options.wait_for_inclusion, wait_for_finalization: bool = Options.wait_for_finalization, @@ -4115,7 +4118,7 @@ def stake_swap( destination_netuid=dest_netuid, amount=amount, swap_all=swap_all, - era=era, + era=period, interactive_selection=interactive_selection, prompt=prompt, wait_for_inclusion=wait_for_inclusion, @@ -5275,10 +5278,12 @@ def subnets_register( wallet_hotkey: str = Options.wallet_hotkey, network: Optional[list[str]] = Options.network, netuid: int = Options.netuid, - era: Optional[ + period: Optional[ int - ] = typer.Option( # Should not be Options.era bc this needs to be an Optional[int] + ] = typer.Option( # Should not be Options.period bc this needs to be an Optional[int] None, + "--period", + "--era", help="Length (in blocks) for which the transaction should be valid. Note that it is possible that if you " "use an era for this transaction that you may pay a different fee to register than the one stated.", ), @@ -5311,7 +5316,7 @@ def subnets_register( wallet, self.initialize_chain(network), netuid, - era, + period, json_output, prompt, ) From deff48fe25d8f6e78ee933045c949a39e348828b Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Mon, 5 May 2025 21:19:52 +0200 Subject: [PATCH 3/3] Update default era period --- bittensor_cli/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index d03f41dab..b2f933417 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -294,7 +294,7 @@ class Options: help="Outputs the result of the command as JSON.", ) period: int = typer.Option( - 10, + 16, "--period", "--era", help="Length (in blocks) for which the transaction should be valid.",