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
1 change: 0 additions & 1 deletion bittensor_cli/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class Constants:
"test": "0x8f9cf856bf558a14440e75569c9e58594757048d7b3a84b5d25f6bd978263105",
}
delegates_detail_url = "https://raw.githubusercontent.com/opentensor/bittensor-delegates/main/public/delegates.json"
emission_start_schedule = 7 * 24 * 60 * 60 / 12 # 7 days


@dataclass
Expand Down
21 changes: 14 additions & 7 deletions bittensor_cli/src/commands/subnets/subnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2320,14 +2320,21 @@ async def get_start_schedule(
if not await subtensor.subnet_exists(netuid):
print_error(f"Subnet {netuid} does not exist.")
return None

registration_block = await subtensor.query(
module="SubtensorModule",
storage_function="NetworkRegisteredAt",
params=[netuid],
block_hash = await subtensor.substrate.get_chain_head()
registration_block, min_blocks_to_start, current_block = await asyncio.gather(
subtensor.query(
module="SubtensorModule",
storage_function="NetworkRegisteredAt",
params=[netuid],
block_hash=block_hash,
),
subtensor.substrate.get_constant(
module_name="SubtensorModule",
constant_name="DurationOfStartCall",
block_hash=block_hash,
),
subtensor.substrate.get_block_number(block_hash=block_hash),
)
min_blocks_to_start = Constants.emission_start_schedule
current_block = await subtensor.substrate.get_block_number()

potential_start_block = registration_block + min_blocks_to_start
if current_block < potential_start_block:
Expand Down
Loading