chore: remove deprecated senate/Triumvirate dead code#3283
chore: remove deprecated senate/Triumvirate dead code#3283cyclone-pro wants to merge 1 commit intoopentensor:stagingfrom
Conversation
719fa59 to
dd4c77d
Compare
|
CC: @basfroman - would appreciate a review when you get a chance. |
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.
I completely agree with you. We have already discussed the fate of this code. The decision was to leave it as is until the pallets are updated. In reality, this code is effectively dead. The core of the pallets is slated to be reimplemented within Subtensor; once that happens, we will achieve consistency and update our own components as well. |
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