Skip to content

Cleanup SubnetUidToLeaseId in do_terminate_lease#2912

Open
UnArbosFour wants to merge 1 commit into
stagingfrom
fix/stale-lease-mappings
Open

Cleanup SubnetUidToLeaseId in do_terminate_lease#2912
UnArbosFour wants to merge 1 commit into
stagingfrom
fix/stale-lease-mappings

Conversation

@UnArbosFour

Copy link
Copy Markdown
Contributor

do_terminate_lease removes SubnetLeases, shares, and accumulated dividends, but never removes SubnetUidToLeaseId. Coinbase subsequently follows the stale mapping and invokes a no-op distribution path.

This PR adds the removal and extends the cleanup assertion in the existing test.

@UnArbosFour UnArbosFour added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jul 15, 2026
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview, Comment Jul 15, 2026 7:55am

Request Review

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

BASELINE scrutiny: repository write access, matching PR author/committer, no Gittensor association found; profile/contribution signals unavailable.

The change narrowly removes the stale netuid-to-lease mapping during lease termination, accounts for the additional database write, and extends the existing cleanup test. No trusted review instructions, dependencies, origins, or economic logic are modified.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found in this small, purpose-aligned patch.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor association UNKNOWN; newer contributor with repository write access, reviewed with heightened scrutiny.

The fix removes the stale reverse lease mapping during successful termination, updates the corresponding database-write weight, and extends the existing termination test. PR #2837’s file overlap is incidental and not duplicate work.

No runtime confirmation was needed. The local runtime is already at spec_version 431; the live mainnet query was unavailable in this network-restricted environment, so no speculative bump was made.

Findings

No findings.

Conclusion

The implementation is minimal, behaviorally correct, properly weight-accounted, and covered by the relevant cleanup test. No blocking domain issues found.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@UnArbosFour UnArbosFour changed the base branch from main to staging July 15, 2026 14:20
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