Skip to content
This repository was archived by the owner on Jul 10, 2026. It is now read-only.

Support dynamic tempo#3383

Merged
basfroman merged 23 commits into
stagingfrom
feat/basfroman/add-dynamic-tempo-support
Jun 18, 2026
Merged

Support dynamic tempo#3383
basfroman merged 23 commits into
stagingfrom
feat/basfroman/add-dynamic-tempo-support

Conversation

@basfroman

@basfroman basfroman commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Adds SDK support for the new stateful epoch model introduced in subtensor.

AC for merge:

  • bittensor-drand v2.0.0 released
  • bittensor-drand updated in SDK dependency in pyproject.toml file
  • Subtensor PR#2638 merged

Includes:

Storage getters

  • get_last_epoch_block
  • get_pending_epoch_at
  • get_subnet_epoch_index
  • get_activity_cutoff_factor_milli
  • get_owner_hyperparam_rate_limit
  • get_epoch_schedule_state.

Extrinsics

  • set_tempo
  • set_activity_cutoff_factor
  • root_set_activity_cutoff_factor
  • trigger_epoch.

Details

  • blocks_until_next_epoch and get_next_epoch_start_block now delegate to the SubnetInfoRuntimeApi runtime API instead of local modulo arithmetic. The tempo parameter is removed from blocks_until_next_epoch.
  • commit_timelocked_weights_extrinsic migrated from get_encrypted_commit to get_encrypted_commit_v2 which takes EpochScheduleState for epoch prediction.
  • SubnetHyperparameters refactored to a hybrid container that supports v1/v2/v3 chain formats via from_any. Unknown fields spill into hyperparameters dict. Added activity_cutoff_factor field. activity_cutoff is now Optional[int].

New entries:

  • EpochScheduleState dataclass in types.py.
  • epoch_schedule utility module with blocks_until_next_auto_epoch and is_in_admin_freeze_window.

Breaking changes:

  • Requires bittensor-drand>=2.0.0.
  • Subtensor.blocks_until_next_epoch and AsyncSubtensor.blocks_until_next_epoch: block is now keyword-only. Callers passing it positionally must update to blocks_until_next_epoch(netuid, block=N).

Related links:

Comment thread bittensor/core/async_subtensor.py Outdated
Comment thread bittensor/core/subtensor.py Outdated
Comment thread bittensor/core/extrinsics/tempo_control.py Outdated
Comment thread bittensor/core/types.py Outdated
Comment thread bittensor/core/chain_data/subnet_hyperparameters.py
@basfroman basfroman requested a review from thewhaleking June 12, 2026 17:52
thewhaleking
thewhaleking previously approved these changes Jun 12, 2026
@basfroman basfroman merged commit a2897a8 into staging Jun 18, 2026
811 checks passed
@basfroman basfroman deleted the feat/basfroman/add-dynamic-tempo-support branch June 18, 2026 18:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants