Skip to content

Commit

Permalink
Governance Protocol Release 5.2.0 (#1414)
Browse files Browse the repository at this point in the history
* Begin senate cli

* Add helper functions to subtensor object for query_module, query_module_map

* Remove unused senate helpers

* Rename SenateCommand -> ProposalsCommand

* Remove unused proposals info datatype

* Add proposals data in rich table

* Clarify + beautify calldata column

* Add SenateRegisterCommand

* Add helper function wallet.is_senate_member

* Add subtensor *_senate extrinsics, is_senate_member, get_vote_data impl

* Use helper function to check senate membership

* Add command to view senate members

* Use get_vote_data helper and refactor call data formatting for recursion

* Add senate_vote and senate_leave cmd classes

* Add membership check in senate_register command

* Add senate_leave, senate_vote extrinsic functions

* Import senate_leave, senate_vote extrinsic functions in subtensor_impl

* Add senate, proposal_votes, senate_leave, senate_vote cmds to cli

* Move closure helper funcs to main scope, add display_votes helper

* Add senate size and active proposals metric, vote overview and nice names

* Add delegate nice-name support to proposal_votes

* Use coldkey for senate actions instead of hotkey

* Up bittensor version to 5.2.0

* Up bittensor version to 5.2.0

* Add changelog for governance protocol update

---------

Co-authored-by: Ala Shaabana <shaabana@gmail.com>
Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 28, 2023
1 parent 05fa493 commit 0a1df05
Show file tree
Hide file tree
Showing 10 changed files with 835 additions and 4 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 5.2.0 / 2023-06-28

## What's Changed
* add default 1024 max stake limit for querying UIDs with vpermit. by @ifrit98 in https://github.com/opentensor/bittensor/pull/1379
* Fixes validator permit issue seen on master by @unconst in https://github.com/opentensor/bittensor/pull/1381
* Added conda environment by @shibshib in https://github.com/opentensor/bittensor/pull/1386
* Update package requirements (hotfix) by @ifrit98 in https://github.com/opentensor/bittensor/pull/1385
* Merge master into new_staging by @ifrit98 in https://github.com/opentensor/bittensor/pull/1388
* Fix axon requests signature using metadata by @unconst in https://github.com/opentensor/bittensor/pull/1394
* Governance Protocol Release by @Rubberbandits in https://github.com/opentensor/bittensor/pull/1414


**Full Changelog**: https://github.com/opentensor/bittensor/compare/v5.1.0...v5.2.0


## 5.1.0 / 2023-05-30

## What's Changed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.0
5.2.0
2 changes: 1 addition & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
nest_asyncio.apply()

# Bittensor code and protocol version.
__version__ = '5.1.0'
__version__ = '5.2.0'
version_split = __version__.split(".")
__version_as_int__ = (100 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2]))
__new_signature_version__ = 360
Expand Down
19 changes: 19 additions & 0 deletions bittensor/_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ def __create_parser__() -> 'argparse.ArgumentParser':
ListDelegatesCommand.add_args( cmd_parsers )
RegenColdkeypubCommand.add_args( cmd_parsers )
RecycleRegisterCommand.add_args( cmd_parsers )
SenateCommand.add_args( cmd_parsers )
ProposalsCommand.add_args( cmd_parsers )
ShowVotesCommand.add_args( cmd_parsers )
SenateRegisterCommand.add_args( cmd_parsers )
SenateLeaveCommand.add_args( cmd_parsers )
VoteCommand.add_args( cmd_parsers )


return parser

Expand Down Expand Up @@ -156,6 +163,18 @@ def check_config (config: 'bittensor.Config'):
MyDelegatesCommand.check_config( config )
elif config.command == "recycle_register":
RecycleRegisterCommand.check_config( config )
elif config.command == "senate":
SenateCommand.check_config( config )
elif config.command == "proposals":
ProposalsCommand.check_config( config )
elif config.command == "proposal_votes":
ShowVotesCommand.check_config( config )
elif config.command == "senate_register":
SenateRegisterCommand.check_config( config )
elif config.command == "senate_leave":
SenateLeaveCommand.check_config( config )
elif config.command == "senate_vote":
VoteCommand.check_config( config )
else:
console.print(":cross_mark:[red]Unknown command: {}[/red]".format(config.command))
sys.exit()
Expand Down
12 changes: 12 additions & 0 deletions bittensor/_cli/cli_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,16 @@ def run ( self ):
ListSubnetsCommand.run( self )
elif self.config.command == 'recycle_register':
RecycleRegisterCommand.run( self )
elif self.config.command == "senate":
SenateCommand.run( self )
elif self.config.command == "proposals":
ProposalsCommand.run( self )
elif self.config.command == "proposal_votes":
ShowVotesCommand.run( self )
elif self.config.command == "senate_register":
SenateRegisterCommand.run( self )
elif self.config.command == "senate_leave":
SenateLeaveCommand.run( self )
elif self.config.command == "senate_vote":
VoteCommand.run( self )

1 change: 1 addition & 0 deletions bittensor/_cli/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
from .metagraph import MetagraphCommand
from .list import ListCommand
from .misc import UpdateCommand, ListSubnetsCommand
from .senate import SenateCommand, ProposalsCommand, ShowVotesCommand, SenateRegisterCommand, SenateLeaveCommand, VoteCommand
Loading

0 comments on commit 0a1df05

Please sign in to comment.