chore: remove deprecated senate/Triumvirate dead code#3283
Open
cyclone-pro wants to merge 1 commit intoopentensor:stagingfrom
Open
chore: remove deprecated senate/Triumvirate dead code#3283cyclone-pro wants to merge 1 commit intoopentensor:stagingfrom
cyclone-pro wants to merge 1 commit intoopentensor:stagingfrom
Conversation
719fa59 to
dd4c77d
Compare
Author
|
CC: @basfroman - would appreciate a review when you get a chance. |
Contributor
thewhaleking
left a comment
There was a problem hiding this comment.
I'm not going to approve or request changes, I'll leave that decision up to @basfroman, but with that being said, I err on the side of not removing dead code in Bittensor until it's "stone dead", because dead things in this ecosystem tend to crop back up with some regularity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
No existing issue — senate/Triumvirate pallet was silently removed from the subtensor
runtime. The orphaned code remained with TODO comments questioning its status:
Description of the Change
Removes all dead code related to the senate/Triumvirate voting system that was left
behind after the pallet was dropped from the subtensor runtime.
Files removed or cleaned up:
bittensor/core/chain_data/proposal_vote_data.py— deleted entirelybittensor/core/subtensor.py— removedget_vote_data()method and importbittensor/core/async_subtensor.py— removed asyncget_vote_data()and importbittensor/core/chain_data/__init__.py— removedProposalVoteDataexportbittensor/utils/easy_imports.py— removedProposalVoteDatafrom public APIbittensor/extras/subtensor_api/chain.py— removedget_vote_databindingtests/unit_tests/test_async_subtensor.py— removed 3 senate-related unit teststests/e2e_tests/test_delegate.py— removed dead import (e2e senate tests werealready commented out)
Evidence that senate was removed from the runtime:
Senate,Triumvirate,Governance) were already marked# deprecated proxy typesinchain_data/proxy.pytest_delegate.pywere already commented outTriumviratepallet'sVotingstorage — a pallet that nolonger exists on the active chain
Alternate Designs
Considered adding a
DeprecationWarningtoget_vote_data()instead of deleting it.Chose full deletion because the underlying pallet no longer exists on-chain — any call
to this method was already silently returning
Noneor raising a substrate error.Keeping it would give users false confidence that the API is functional.
Possible Drawbacks
Any external code calling
subtensor.get_vote_data()will get anAttributeErrorafter upgrading. However, since the Triumvirate pallet is gone from the runtime, those
calls were already broken at the chain level. The behavioral change is: fail loudly at
import/call time instead of silently returning
None.Verification Process
ProposalVoteData,get_vote_data,and
Triumvirate— confirmed none remain in production code.pytest tests/unit_tests/test_async_subtensor.py -v
Result: 216 passed, 0 failed, 1 warning (the warning is pre-existing and unrelated).
Release Notes
Removed the defunct senate/Triumvirate voting API (
get_vote_data,ProposalVoteData)that was no longer functional after the senate pallet was removed from the subtensor runtime.
Branch Acknowledgement
[x] I am acknowledging that I am opening this branch against
staging