Skip to content

[DO NOT MERGE] Follow-up for dynamic tempo - removing deprecated activity cutoff#2774

Open
evgeny-s wants to merge 9 commits into
devnet-readyfrom
chore/dynamic-tempo-cleanup
Open

[DO NOT MERGE] Follow-up for dynamic tempo - removing deprecated activity cutoff#2774
evgeny-s wants to merge 9 commits into
devnet-readyfrom
chore/dynamic-tempo-cleanup

Conversation

@evgeny-s

Copy link
Copy Markdown
Collaborator

Description

[Should be merged after the dynamic tempo mainnet release]

Follow-up PR for #2638:

Related Issue(s)

  • Closes #[issue number]

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

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

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (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.

@evgeny-s evgeny-s added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

eco-tests changed — indexer review required

This PR modifies files under eco-tests/. and may affect downstream indexing.
cc @evgeny-s — please review manually

Changed files
  • eco-tests/src/mock.rs
  • eco-tests/src/tests_taocom_indexer.rs

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

BASELINE scrutiny: established 2012 account with repository write permission and substantial subtensor PR history; no Gittensor allowlist/index hit; branch chore/dynamic-tempo-cleanup -> devnet-ready.

Static review found no protected .github/ai-review/* or .github/copilot-instructions.md changes, no dependency or build-script changes, and no suspicious runtime execution path. The runtime-facing cleanup removes the legacy ActivityCutoff storage/API, keeps dynamic-tempo conversion reading legacy storage through a local alias before cleanup, and preserves subnet-owner/root authorization plus bounded factor checks through set_activity_cutoff_factor.

Findings

No findings.

Conclusion

No malicious intent or security vulnerability was identified in the reviewed diff. The cleanup uses existing bounded/idempotent migration patterns and preserves the relevant access controls.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor: LIKELY by heuristic; author has write permission and substantial recent Subtensor activity, with no direct allowlist hit found.

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 ActivityCutoff / MinActivityCutoff removal, the retained storage alias used by migrate_dynamic_tempo, hook ordering that converts legacy values before deleting storage, the admin-utils and precompile API removal, and migration tests for wiping legacy storage.

spec_version is bumped from 423 to 424. git diff --check origin/devnet-ready...HEAD passed. I did not run targeted tests because no finding required runtime confirmation.

Findings

No findings.

Conclusion

Approving: the cleanup is coherent, migration ordering preserves the dynamic-tempo conversion path, and the prior low-risk cleanup concerns remain resolved. The PR title/body still state it should merge only after the dynamic-tempo release; that sequencing constraint remains a human merge-timing requirement rather than a code finding.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@evgeny-s evgeny-s changed the title Follow-up for dynamic tempo - removing deprecated activity cutoff [DO NOT MERGE] Follow-up for dynamic tempo - removing deprecated activity cutoff Jun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

# Conflicts:
#	pallets/admin-utils/src/weights.rs
@evgeny-s evgeny-s changed the base branch from feat/configure-max-epochs-per-block to devnet-ready June 24, 2026 11:08

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/admin-utils/src/weights.rs Outdated
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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/admin-utils/src/weights.rs Outdated
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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant