Follow-up for dynamic tempo - removing deprecated activity cutoff#2774
Follow-up for dynamic tempo - removing deprecated activity cutoff#2774evgeny-s wants to merge 13 commits into
Conversation
eco-tests changed — indexer review requiredThis PR modifies files under Changed files
|
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: established 2012 account with repository write permission, substantial subtensor PR history, and no Gittensor allowlist/index hit; branch chore/dynamic-tempo-cleanup -> devnet-ready. Static review found no protected FindingsNo findings. ConclusionNo malicious intent or security vulnerability was identified in the reviewed diff. The previous Skeptic verdict had no finding markers, and the current changes remain consistent with a dynamic-tempo cleanup and backward-compatible precompile behavior. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor: LIKELY by heuristic; no allowlist/index hit, but author has write permission and substantial recent Subtensor PR activity. The Auditor proposed a replacement PR description, but the current body is non-trivial; not overwriting. Maintainers: ask the Auditor to regenerate if you want it. Static review covered the legacy The previous blocker is addressed: deprecated
Duplicate-work check found overlapping files with other open PRs, but no competing PR appears to implement this ActivityCutoff cleanup. FindingsNo findings. Prior-comment reconciliation
ConclusionApproving because the prior behavioral blocker is fixed and the cleanup preserves the dynamic-tempo migration path before deleting legacy storage. Remaining risk is limited to test execution being unavailable in this runner; CI should run the targeted precompile and migration tests. 📜 Previous run (superseded)
|
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
# Conflicts: # pallets/admin-utils/src/weights.rs
| fn sudo_set_difficulty() -> Weight; | ||
| fn sudo_set_adjustment_interval() -> Weight; | ||
| fn sudo_set_target_registrations_per_interval() -> Weight; | ||
| fn sudo_set_activity_cutoff() -> Weight; |
There was a problem hiding this comment.
[HIGH] Remove the stale generated weight implementations too
Deleting this trait item leaves two generated sudo_set_activity_cutoff() implementations in this same file, around pallets/admin-utils/src/weights.rs:367 and pallets/admin-utils/src/weights.rs:1333. Those methods are no longer members of WeightInfo, and Rust trait impls cannot define extra associated methods, so pallet-admin-utils will not compile after this cleanup. Regenerate pallets/admin-utils/src/weights.rs or manually remove both stale method blocks along with this trait item.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
| fn sudo_trim_to_max_allowed_uids() -> Weight; | ||
| fn sudo_set_min_non_immune_uids() -> Weight; | ||
| fn sudo_set_max_epochs_per_block() -> Weight; | ||
| fn sudo_set_activity_cutoff() -> Weight; |
There was a problem hiding this comment.
[LOW] Remove the stale generated activity-cutoff weight stub
sudo_set_activity_cutoff was removed from pallets/admin-utils/src/lib.rs and its benchmark was deleted, but the generated WeightInfo trait still exposes the method and both generated impls still define it against the removed SubtensorModule::ActivityCutoff / MinActivityCutoff storage. This no longer appears to be the compile-breaking mismatch from the prior run because the trait and impls are internally consistent, but it leaves dead generated weight code for an extrinsic this PR removes. Regenerate pallets/admin-utils/src/weights.rs or delete the stale trait item and the two sudo_set_activity_cutoff impl blocks.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
# Conflicts: # contract-tests/src/contracts/subnet.ts # contract-tests/src/subtensor.ts # contract-tests/test/staking.precompile.reward.test.ts
| fn sudo_trim_to_max_allowed_uids() -> Weight; | ||
| fn sudo_set_min_non_immune_uids() -> Weight; | ||
| fn sudo_set_max_epochs_per_block() -> Weight; | ||
| fn sudo_set_activity_cutoff() -> Weight; |
There was a problem hiding this comment.
[LOW] Remove the stale generated activity-cutoff weight stub
sudo_set_activity_cutoff was removed from pallets/admin-utils/src/lib.rs, but this generated weight method is still re-added to the trait and the file still carries both impl bodies for the removed call. This is dead generated code over storage that the PR deletes; regenerate pallet_admin_utils weights or remove the trait method and both impl methods so the weights file matches the pallet surface.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
| @@ -1,23 +1,4 @@ | |||
| [ | |||
| { | |||
There was a problem hiding this comment.
For backward-compatibility, we should keep the getActivityCutoff in precompiles, otherwise the existing contracts will start failing. They may respond with 0 or something hardcoded.
| int16 steepness | ||
| ) external payable; | ||
|
|
||
| function getActivityCutoff(uint16 netuid) external view returns (uint16); |
There was a problem hiding this comment.
For backward-compatibility, we should keep the getActivityCutoff in precompiles, otherwise the existing contracts will start failing. They may respond with 0 or something hardcoded.
|
@opentensor/cerebrum / @opentensor/gyrus / @opentensor/cortex breaking change detected! Please prepare accordingly! |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Description
Follow-up PR for #2638:
Breaking Changes ❗❗❗
On-chain storage & metadata
SubtensorModule::ActivityCutoffandSubtensorModule::MinActivityCutoff. Both are purged from state by themigrate_remove_activity_cutoffruntime migration.SubtensorModule::ActivityCutoffFactorMilliinstead.Extrinsics
admin_utils.sudo_set_activity_cutoff.subtensor.set_activity_cutoff_factor(netuid, factor_milli).EVM precompiles —
ISubnetSelectors are preserved (deployed contracts do not revert), but semantics changed:
getActivityCutoff(uint16)— now returns the derived effective cutoff.setActivityCutoff(uint16,uint16)— now converts the block value to the equivalent per-tempo factor at the current tempo and dispatchesset_activity_cutoff_factor.setActivityCutoffFactor(uint16,uint32)/getActivityCutoffFactor(uint16)directly.Events & Errors — deprecated, not removed (indices preserved)
Event::ActivityCutoffSetandError::ActivityCutoffTooLoware marked#[deprecated]and are no longer emitted / returned.Related Issue(s)
Type of Change
Breaking Change
If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
Please provide any additional information or context that may be helpful for reviewers.