Skip to content

Commit

Permalink
Release/3.7.0 (#1182)
Browse files Browse the repository at this point in the history
* AttributeError: comman -> command

* don't save stake to metagraph save

* try fix by mocking with a constant

* fix unstake test

* use colkeypub

* dont use remote on sub mock

* fix unstake tests

* fix cli stake tests

* remove no cache and tests

* use total stake for neuron from dict

* add netuid to test config

* change default format to ws://

* add copyright notices

* add unit test for from neurons

* remove forward test

* add netuid optional to sync

* updated call in benchmark

* make mock helper

* add mock call override for neurons

* use mock call instead

* update copyright notices

* fix ss58 byte length

* fix test for wandb

* fix test decl

* add ws to nobu for tests

* Fix/neuron netuid arg (#1056)

* use netuid instead of neuron netuid

* add check for dataset in del

* use netuid only

* also check for dendrite

* return bool

* add test helper get mock neuron by uid

* fix some subtensor tests

* fix axon test, mock wallet

* remove connect tests

* use netuid

* fix no axon info on inspect

* add error for endpoint from null neuron

* support SubnetInfo RPC (#1049)

.

* Support delegateInfo RPC (#1059)

* move helpers into utils

* implement delegate info rpc

* move u8 to hk to utils

* fix ss58 to bytes

* convert bytes to list int

* Fix/only explorer if known network (#1037)

* add explorer urls to init and check before print

* extract to util function instead

* add util functions

* add tests

* use more flexible format

* fix tests add ddt

* add finney explorer url

* fix func call

* oops

* add more mocks

* add netuid and network mock

* patch everything

* mock payment info

* patch query

* fix mock and check patch attr

* add netuid to default test config

* fix test

* notify user that hotkey is not registered (#1030)

* notify user that hotkey is not registered

* Revert "notify user that hotkey is not registered"

This reverts commit 9e103aa.

* notify if not registered

* bool fix for btcli

* add call for validator permit (#1061)

* Remove Py 3.7 (#1067)

* remove install python3.7 in dockerfile

* up req to 3.8

* remove from circleci

* fix tag in setup

* add py3 only tag

* Catch subnet doesn't exist (#1070)

* catch diff None

* catch subnet does not exist in create_pow

* check subnet exists during reg

* check for subnet exists

* check netuid before run neuron

* Move hotkeys flag (#1071)

* nominate doesn't need these flags

* fix unstake

* remove from wallet args

* fix stake

* fix overview

* fix tests

* [fix] rename ss58_hotkey to hotkey_ss58 (#1074)

* rename ss58_hotkey to hotkey_ss58

* fix call

* change message output

* [fix] instantiate subtensor before check for netuids (#1072)

make subtensor before check to netuid

* fix f string error

* move rao symbol to init

* mock is_hotkey_registered_any

* fix mock without mock subtensor

* modify args for mocking

* fix test for new args

* fix f string error

* [BIT-626] Add neuron_info fields for ValidatorTrust and WeightConsensus (#1073)

* Add neuron_info fields for ValidatorTrust and WeightConsensus

* Change some neuron stats from u64 to u16

* Correct type hints in wallet

Return wallet field None when neuron is None.

* Remove wallet.ip

NeuronInfo doesn't seem to have an ip field anymore.

* fix type reg

* fix type hints

* fix get mock neuron

* fix mock_subtensor neurons

* fix neuron from json

* [fix] [ci] modify cache key (#1075)

* modify cache key

* install the dev extra too

* use + separator

* Add init for extrinsics submod (#1077)

add init file

* Fix is_registered call (#1080)

.

* [Fix] comment out addition of new neuron fields (#1081)

comment out addition of new neuron fields

* [hotfix][3.6.3] Merging back hotfix into finney (#1065)

* Update README.md

* Hotfix/3.6.2/validator logit parameters (#1057)

* additional parameters

* fixed naming to logit divergence

* versioning and fixes

* typo fixes

* bug fixes

* Tests cli fixes (#1058)

* fix btcli list with wallet.path (#1036)

fix path join

* remove mock subtensor and replace with mock calls

* additional fixes

* mock wallet

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Log prune_len and logits_divergence

* Always get latest prune_len

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>
Co-authored-by: opentaco <opentaco@protonmail.com>

* fixing no_version_checking error

* updating version to 3.6.3

---------

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>
Co-authored-by: Eugene-hu <85906264+Eugene-hu@users.noreply.github.com>
Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>
Co-authored-by: opentaco <opentaco@protonmail.com>
Co-authored-by: Eugene <etesting007@gmail.com>

* Adding CHANGELOG and updating .circleci/config.yml

Start adding release workflow to circleci

Adding release job without applying release

Adding 3.6.3 release notes to CHANGELOG.md

Improving release script to be able to execute a dry run with no secrets

Enabling circleci to build docker image

Reorganizing circleci workflows

Downgrade version now that tests with circleci are done

Improve release documentation and scripts

* Server update for finney (#1053)

* fixes for get_external_ip

* fix ordering of external APIs

* refactoring the server code

* remove debug prints and fixed tests

* fixes for the test_neuron

* updated logging for servers

* remove axon wandb

* remove wandb

* additional logging

* merge from finney

* additional logging for the server

* fixes for validator

* remove pdb

* config.netuid

* improved logging message

* bug fixes for core_validator

* ip string fix

---------

Co-authored-by: isabella618033 <49876827+isabella618033@users.noreply.github.com>

* fix bittensor dir path (#1088)

* update substrate interface version (#1087)

* Fix/get ss58 format (#1090)

* use ss58 get format

* fix keyfile seed_hex

* Restore from json (#1092)

* allow restore from json backup

* fix check config

* use overload for function sig

* Add undelegate command (#1076)

* change to balance check

* add delegateunstake command

* fix type of arg

* move delegate pull

* update torch version to 1.13.1 and docker to py3.10 (#1089)

* update torch version to 13.1

* down to 1.13.0

* back to 1.13.1

* fix bittensor dir path (#1088)

* update substrate interface version (#1087)

* down to 1.13.0

* back to 1.13.1

* Fix pad_token not set

* bring working with finney and mock branch

* move zombienet things

* remove client tests

* add unique keypairs per test

* use mock chain to setup tests for stake

* use coldkeypub

* use total_stake for overview

* [BIT-630] Add netuid to validator console status (#1102)

Add netuid to validator console status

* undelegate

* Dataset API cleanup (#1106)

pluralize dataset_names for dataset api, add checks and allow strings

* Release 3.7 subtensor integration (#1105)

* adds back old subtensor, metagraph, and wallet

* naka wallet add netuid param

* naka subtensor add netuid param

* validator adapt to netuid param

* btcli list fix

* btcli naka query fix

* btcli finney query fix

* help & update fix

* weights fix

* cli finney weight fix

* btcli wallets fix

* cli fix list_subnet

* fixed btcli new hotkey

* revert unecessary finney check

* btcli stake and unstake fix

* btcli naka stake/unstake fix

* btcli naka metagraph fix

* btcli naka query fix

* btcli naka weights fix

* removed uncessary finney check

* version key for subtensor set_weights

* remove duplicated deepcopy

* validator version 1 -> version_as_int

* get_n -> get_neuron_num

* reverted validator version_key to 1

* removed deepcopy

* removed uncessary copy import

Co-authored-by: Eduardo García <garciaruiz.edu+github@gmail.com>

---------

Co-authored-by: Eugene <etesting007@gmail.com>
Co-authored-by: Eduardo García <garciaruiz.edu+github@gmail.com>

* Release 3.7 replace paratensor (#1109)

* adds back old subtensor, metagraph, and wallet

* naka wallet add netuid param

* naka subtensor add netuid param

* validator adapt to netuid param

* btcli list fix

* btcli naka query fix

* btcli finney query fix

* help & update fix

* weights fix

* cli finney weight fix

* btcli wallets fix

* cli fix list_subnet

* fixed btcli new hotkey

* revert unecessary finney check

* btcli stake and unstake fix

* btcli naka stake/unstake fix

* btcli naka metagraph fix

* btcli naka query fix

* btcli naka weights fix

* removed uncessary finney check

* version key for subtensor set_weights

* remove paratensor with subtensor

* remove copy

---------

Co-authored-by: isabella618033 <isabella618033@gmail.com>

* remove zombienet use new subv3

* fix flags

* module name to Subtensor

* change module name

* oops SubtensorModule

* clear mock db before start of mock chain

* fix rm dir

* fix generate mock keypair

* make same coldkey

* verify all str

* fix coldkey keypair as same

* fix use keyword

* fix own hotkey check

* fix delegate check

* progress fixing tests

* adding --netuid to subtensor parser

* overview fix

* default use finney for network (#1110)

* Fix unit (#1111)

* fix symbol unicode

* add alias for --delegate_ss58

* fix patch

* add linux bin

* .

* Fix stake is none (#1112)

* fix symbol unicode

* add alias for --delegate_ss58

* fix patch

* add linux bin

* .

* nominate test works

* delegate stake works

* delegate unstake works

* remove todo

* fix mock of get all hotkeys

* use finney for network name and _mock for config

* fix stake output for inspect (#1113)

* Security update 3.7.0 (#1103)

* security update

* recieve message length

* neuron hotkey blacklist

* add checks during epoch

* seq2seq updates

* fixes for comments

* naka metagraph fix

* remove fee call (#1115)

* Overview and Transfer tests (#1114)

* fix symbol unicode

* add alias for --delegate_ss58

* fix patch

* add linux bin

* .

* nominate test works

* delegate stake works

* delegate unstake works

* remove todo

* fix mock of get all hotkeys

* use finney for network name and _mock for config

* fix add arg

* add rich text console helpers

* overview test for subnets

* add case for overview

* add overview test for unregistered subnet 1 and 2

* add transfer test

* add test for failed transfer

* transfer test with check for error output

* Fix metagraph output (#1116)

* fix symbol unicode

* add alias for --delegate_ss58

* fix patch

* add linux bin

* .

* nominate test works

* delegate stake works

* delegate unstake works

* remove todo

* fix mock of get all hotkeys

* use finney for network name and _mock for config

* fix add arg

* add rich text console helpers

* overview test for subnets

* add case for overview

* add overview test for unregistered subnet 1 and 2

* add transfer test

* add test for failed transfer

* transfer test with check for error output

* fix metagraph output and add test

* Neuron metagraph fix (#1118)

* fix

* fix metagraph stake -> S

* (un)stake CLI tests (#1117)

* fix symbol unicode

* add alias for --delegate_ss58

* fix patch

* add linux bin

* .

* nominate test works

* delegate stake works

* delegate unstake works

* remove todo

* fix mock of get all hotkeys

* use finney for network name and _mock for config

* fix add arg

* add rich text console helpers

* overview test for subnets

* add case for overview

* add overview test for unregistered subnet 1 and 2

* add transfer test

* add test for failed transfer

* transfer test with check for error output

* fix metagraph output and add test

* move test that can be mocked

* fix stake and unstake tests

* don't try endpoint if null neuron

* update finney endpoint (#1119)

update endpoint

* Add hyp params (#1121)

* add info

* Fix how metagraph chooses network arg

* add to and from parameter dict

* add hook to save info to torch file

* validator trust (#1120)

* fixes for overview + server

* self subtensor

* Add prometheus extrinsic (#1124)

* init prometheus extrinsic

* core_server adapt

* prometheus adapt

* subtensor adapt

* extrinsic fix

* prometheus extrinsic cleanup

* clean up

* clean up

* adding test

* remove upnpc and added comment

* serving to its own functio

* added test

* removed prompt param

* Add prometheus extrinsic (#1125)

* init prometheus extrinsic

* core_server adapt

* prometheus adapt

* subtensor adapt

* extrinsic fix

* prometheus extrinsic cleanup

* clean up

* clean up

* adding test

* remove upnpc and added comment

* serving to its own functio

* added test

* removed prompt param

* removed prompt doc string

* removed all prometheus

* lol

* .

* validator fix

* btcli burned_register (#1123)

* fix symbol unicode

* add alias for --delegate_ss58

* fix patch

* add linux bin

* .

* nominate test works

* delegate stake works

* delegate unstake works

* remove todo

* fix mock of get all hotkeys

* use finney for network name and _mock for config

* fix add arg

* add rich text console helpers

* overview test for subnets

* add case for overview

* add overview test for unregistered subnet 1 and 2

* add transfer test

* add test for failed transfer

* transfer test with check for error output

* fix metagraph output and add test

* move test that can be mocked

* fix stake and unstake tests

* don't try endpoint if null neuron

* use default netuid of 1

* use subtensor get bal

* update testing bin

* default finney for reg check

* add burned register command

* add test for burned reg

* sign with coldkey instead

* [BIT-634] Remove `weight_consensus` and fully include `validator_trust` (#1127)

Remove weight_consensus and fully include validator_trust

* Add prometheus already served check (#1130)

* moved prometheus to serve with axon

* adding prometheus already served check

* printing prometheus already served

* fix

* fix

* .

* server fix

* redundant output

* 3.7 server fix (#1126)

* console fixes

* fixes for .stake

* neuron stake change

* moving comment

* prometheus port check

* Use new rpc format (#1131)

* get custom rpc info from vec u8

* include check in parser

* use cleaner none/[] check

* use new weight and bond format

* Revert "Use new rpc format" (#1132)

Revert "Use new rpc format (#1131)"

This reverts commit ab68455.

* Use new rpc format (#1133)

* get custom rpc info from vec u8

* include check in parser

* use cleaner none/[] check

* use new weight and bond format

* Use scalecodec for custom RPCs (#1134)

* .

* use new weights/bonds encoding

* typo

* ss58 encode accountid

* use compact ints for custom rpcs

* oops

* use compact for pruning score too

* move type reg

* pruning score for null neuron

* Fix prometheus serve (#1136)

* Send netuid

* fix typo

* nit changes to loggin and config warning

* Add netuid to path (#1137)

* added netuid to path

* prettier logger info

* Fix validator weights table metagraph_n (#1138)

* Overview emission per block and undelegate (#1140)

* emission per block

* delegation fix

* add burn to registry (#1141)

* Fix scalecodec issue subnetinfo (#1143)

.

* More delegate info (#1142)

* add more delegate info

* to to from

* don't list take

* Add more delegate info for rpcs

* Change ValidatorLogitsDivergence to u16 (#1139)

* Change ValidatorLogitsDivergence to u16

* Fix wrong hyperparam

* Fix hyperparam type

* Fix scaling law powers (#1145)

* add delegates index

* add delegates info.json

* add my delegates

* update with taostats info (#1154)

* update with taostats info

* add Vune validator

* Update delegates.json

---------

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>

* Recycle_register (#1152)

recycle

Co-authored-by: “quac88” <“mac2@thrasher.com”>

* Revert "Recycle_register (#1152)" (#1159)

This reverts commit 309d430.

* Make list prettier (#1147)

* Prometheus dont error when off (#1153)

* use upper case for level

* dont serve if OFF and dont error

* Default to finney (#1155)

* wallet default to finney

* default to finney in server and validator

* version key fixes (#1148)

* Undelegate fix (#1165)

* fixes

* list as percent in list

* list subnets fix

* normalize connect req

---------

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* recycle register 2 (#1164)

* recycle

* change burn functions and classes to recycle

---------

Co-authored-by: “quac88” <“mac2@thrasher.com”>

* Update delegates.json (#1156)

This commit purpose is to add a TaoPolishNode to the validators list

* Version 3.7 update (#1167)

* Update README.md

* version update + bug fix for server

---------

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>

* adds total_daily_return to delegateInfo (#1151)

* add delegated rpc (#1150)

* Neuron info lite RPC (#1149)

* add to chaindata

* add lite methods to subtensor

---------

Co-authored-by: Eugene <etesting007@gmail.com>

* Update delegates.json

* Add taostats.io to delegates (#1171)

Verified True
	Validator information: {"5Hddm3iBFD2GLT5ik7LZnT3XJUnRnN8PoeCFgGQgawUVKNm8": {"name": "\u03c4aos\u03c4a\u03c4s", "url": "taostats.io", "description": "Supporting the bittensor eco-system through data provision, statistics and analytics."}}
 	Validator signature: 1e4107f3f5b5282ab1b168e4fe0a5e1580884dc45fe6d4487a88f7bdca078c23535ddb292c913a6b56fcf59971f5aa4b61653acae7a363f25864562f9306b181

* chore: update the TaoStation delegate (#1163)

* Update delegates.json

* Update WaveTensor delegates.json (#1166)

Verified True
Validator information: {"5DCc5oHA6c1Lpt9R6T1xU8jJGTMvvwBqD1yGX67sL8dHUcga": {"name": "WaveTensor", "url": "https://twitter.com/wavetensor", "description": "A new Wave is coming, join the AI revolution on top of Bittensor by staking with us."}}
Validator signature: 5e072b4752ccbdd4ca3298f336284dfdab347dd133850f4d2f9873e7ea59bd2a8f201732842ec79d2bab3abaf133a06b6bd992940389e42d57802c9b8f855889

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>

* Update delegates.json

* Overview dont count stake twice (#1175)

* dont count stake twice

* don't count keys twice

* remove some tqdm

* add netuid flag for overview

* use new rpc and catch file error (#1176)

* add validator info

* add foundry digital validator (#1172)

* add foundry digital validator

add foundry digital validator

* Update delegates.json

---------

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>

* Update delegates.json (#1170)

Validator signature: b41db5092b7e6fde8eeab5133527a334f7b82498eaa8a1c6e59d474af64a0663ca334013a323dfa2c5213e97c8468ff3c868d3d64cb73fdab6a68e649e3d1187

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>

* No advertising about rakebacks (#1177)

* Adding TaoStaking info to delegates (#1169)

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>

* add runpod as validator (#1173)

Verified True
	Validator information: {"5DPEpUTZn94sgYXH3sdXxsVvb46m3iEvg8aZwX7SMDowivzB": {"name": "RunPod", "url": "https://runpod.io", "description": "GPU Cloud built for AI. We plan to introduce perks for those who stake."}}
 	Validator signature: 806c88c327a6488d3fa05628b2e1c06d8688ebda4c50e0627704cb02c6a7a044aed6625bd132e88a333436829fc5dc2c2d5cda73f1aee90351916ba16ff7518b

Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>

* use neurons lite for overview (#1179)

* Remove weights underflow fix (#1178)

* Update __init__.py

* Update __init__.py

* fix delegates

* remove check network

* hotkey naming on wallet regen

* -all to my_delegates

* add per 1000 tao

* fix per 24 hour

* fix inspect

* fix minor in inspect

* Update delegates.json (#1181)

Verified True
        Validator information: {"5GBxDYkDp8eJZHGT89wcZJKcMc4ytSqnqqVSpeuGeqtGfqxK": {"name": "Tao Stake", "url": "www.taostake.io", "description": "We have been mining since the start of bittensor and want to maintain a long term solid validator to help people get some value from thier investment and keep TAO within the ecosystem."}}
        Validator signature: 0272522b503ebb29f0b506f10765b4d5c7a23b85c78cc7bfae76b9816b80ab43282ea4642f09eb09be70812341e5d9946abc8a9d2c73bab0113e9bf939430c87

* Hotfixes 3.7.0 (#1187)

* fix metagraph network name issue

* fix local entrypoint port

* pin scalecode to 1.2.0

* pin jsonschema format-nongpl

* fix delegates_json

* get right dir

* remove extra get delegated

* use lite sync for metagraph by default

* fix blockhash for rpcs

* use lite in sync()

* add percentage change to list_delegates

* remove axon + fix emission (#1188)

* remove axon + fix emission

* small fix spacing

* allow inspect to get keys from the chain and also allow unstake to accept a hotkey directly

* Overview - only tempo once (#1191)

only tempo once

* Request to add Lucrosus Capital to delegates.json (#1192)

Verified True
Validator information: {"5FcXnzNo3mrqReTEY4ftkg5iXRBi61iyvM4W1bywZLRqfxAY": {"name": "Lucrosus Capital", "url": "https://lucrosuspool.io/", "description": "Decentralized VC focused on the most thriving blockchain ideas. Join our pool to receive early entrance into promising projects!"}}
Validator signature: 1a37ab3bd51a6590dea9772d6a5550632ddcd8d76da6595b66e6425692feac6699dc5f788e587a734cedc3f54efc96c2c9e5453f9052867c1b9a1b5a443b848c

* Server validator hotfix (#1189)

* remove metagraph.load

* remove destroy receptor log

* remove create receptor log

* validator dendrite backward default to false

* fix

* push vogue tensor to delegates

* fix ts to τs

* fix inspect command (#1194)

* fix finney explorer (#1200)

* 3.7 version checking (#1195)

* fix metagraph network name issue

* fix local entrypoint port

* pin scalecode to 1.2.0

* pin jsonschema format-nongpl

* fix delegates_json

* get right dir

* remove extra get delegated

* use lite sync for metagraph by default

* fix blockhash for rpcs

* use lite in sync()

* version checking

* int comparison + default checks

---------

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* No zero nominators (#1206)

* fix typehints

* don't count zero nominators

* Adding Validator Info (#1183)

9241f63eb43f7aa57b1fc6d99789331542476f57f683f032192f3dfd7be6c015d47c9f1fe69bc4513ed70e0410097395186df60e3f6b67376e6e73a5f4f9a286

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Update delegates.json (#1211)

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Update delegates.json (#1210)

* Update delegates.json

Verified True
	Validator information: {"5E6oB7h5wtWPbqtPxtSoZeo11fpvDjPuY13SobAMxqEUjqkQ": {"name": "StakeTensor.com-3", "url": "www.staketensor.com", "description": "We run multiple, parallel validators to support Bittensor decentralization & achieve maximum returns"}}
 	Validator signature: a2567b6de748f02f6a14e0063f5b5720b34c96deb2115b33893d016de1f60633ba58bf9bdd49b2141e12a4a8784b4b11c007679d7526eb1e91147e5284258d8a

* Update delegates.json

---------

Co-authored-by: Cameron Fairchild <cameron@fairchild.dev>
Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Update delegates.json (#1202)

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Update delegates.json (#1209)

* Update delegates.json

* Fix formatting

* Don't use fake quote

* Remove ,

---------

Co-authored-by: Cameron Fairchild <cameron@fairchild.dev>
Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Update delegates.json (#1208)

* Update delegates.json

* Needs comma

---------

Co-authored-by: Cameron Fairchild <cameron@fairchild.dev>
Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Update delegates.json (#1204)

* Update delegates.json

* Fix desc to from PR

---------

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Fix (un)stake multiple (#1214)

fix stake mult

* Check transfer fee (#1215)

* add existential check

* add check existential and fee to transfer

* add fee mention

* add type reg and remove delegate profile url

* use type reg for finney nets

* add spacing

* set weights era parameter (#1219)

* Update delegates.json (#1218)

Verified True
        Validator information: {"5FvhvCWLbu2VgotT5obC9E6S9nskerJUrVsWqkWXCbuD8veW": {"name": "The Lost Cove", "url": "https://lostcove.tech/", "description": "Australia and New Zealand community. We're in it for the gains."}}
        Validator signature: 626ae6b91aac1591e5d4f8d4fdf2c55f927419fc766dd5184b149f4d7cbc9749ebc94e4e8d04d286b4000c7665afa5682aa28cd94071c5e384e0eb4f44def188

Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Update delegates.json (#1217)

* Update delegates.json

* Match msg for sig

---------

Co-authored-by: Cameron Fairchild <cameron@fairchild.dev>
Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>

* Overview emission in rao (#1213)

show emission in rao with _

* Add TAO almanach (#1222)

* 3.7 merge master (#1223)

Add Owl Ventures Validator (#1199)

* Add Owl Ventures Validator 2

	Verified True
	Validator information: {"5CsvRJXuR955WojnGMdok1hbhffZyB4N5ocrv82f3p5A2zVp": {"name": "Owl Ventures 2", "url": "https://owlventures.co.uk", "description": "Owl Ventures Tao Validator 2"}}
 	Validator signature: c807eea902fb786cba8ef768a3ec025d735e3a547d034f82779bdbdcda73cd0fb27b784db9a88d08bb6d4cde3e95fc1257486d86c37b38f309ebb53b7c145b89

* Name change

We decided to use single validator to aggregate stakes. Changing the name accordingly.

Co-authored-by: igor-papyrus <alferov@gmail.com>

---------

Co-authored-by: isabella618033 <isabella618033@gmail.com>
Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>
Co-authored-by: Eugene <etesting007@gmail.com>
Co-authored-by: opentaco <93473497+opentaco@users.noreply.github.com>
Co-authored-by: Eduardo García <garciaruiz.edu+github@gmail.com>
Co-authored-by: Eugene-hu <85906264+Eugene-hu@users.noreply.github.com>
Co-authored-by: opentaco <opentaco@protonmail.com>
Co-authored-by: Eduardo <garciaruiz.edu@gmail.com>
Co-authored-by: isabella618033 <49876827+isabella618033@users.noreply.github.com>
Co-authored-by: joeylegere <joeylegere@gmail.com>
Co-authored-by: unconst <jake@bittensor.com>
Co-authored-by: Mac Thrasher <95183714+quac88@users.noreply.github.com>
Co-authored-by: “quac88” <“mac2@thrasher.com”>
Co-authored-by: piotrekraw <piotrekraw@o2.pl>
Co-authored-by: mog <mog@mogmachine.com>
Co-authored-by: Philippe Schommers <philippe@schommers.be>
Co-authored-by: nikogold78 <128321290+nikogold78@users.noreply.github.com>
Co-authored-by: teast21 <109384972+teast21@users.noreply.github.com>
Co-authored-by: Alex <96243054+wildcommunist@users.noreply.github.com>
Co-authored-by: Jermaine <jermaine150@gmail.com>
Co-authored-by: Pardeep Singh <ps0296@gmail.com>
Co-authored-by: nickbeentjes <nick@pacificshredder.com>
Co-authored-by: LucrosusCapital <96264897+LucrosusCapital@users.noreply.github.com>
Co-authored-by: 0xSkol <128446359+0xSkol@users.noreply.github.com>
Co-authored-by: StakeTensor <128402936+StakeTensor@users.noreply.github.com>
Co-authored-by: Cameron Fairchild <cameron@fairchild.dev>
Co-authored-by: gmarlettTS <gmarlett@technologysolutions.net>
Co-authored-by: lewbare <120072191+lewbare@users.noreply.github.com>
Co-authored-by: lawrenceboyd-1995 <128547579+lawrenceboyd-1995@users.noreply.github.com>
Co-authored-by: arguad <rickyguadagnin@gmail.com>
Co-authored-by: TAOVali <128548800+TAOVali@users.noreply.github.com>
Co-authored-by: igor-papyrus <alferov@gmail.com>
  • Loading branch information
1 parent 1268f80 commit 6fed57e
Show file tree
Hide file tree
Showing 23 changed files with 491 additions and 265 deletions.
20 changes: 11 additions & 9 deletions bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def turn_console_off():
# Needs to use wss://
__bellagene_entrypoint__ = "wss://parachain.opentensor.ai:443"

__local_entrypoint__ = "ws://127.0.0.1:9945"
__local_entrypoint__ = "ws://127.0.0.1:9944"

__tao_symbol__: str = chr(0x03C4)

Expand All @@ -87,11 +87,10 @@ def turn_console_off():
# Block Explorers map network to explorer url
## Must all be polkadotjs explorer urls
__network_explorer_map__ = {
'local': "https://explorer.nakamoto.opentensor.ai/#/explorer",
'local': "https://explorer.finney.opentensor.ai/#/explorer",
'nakamoto': "https://explorer.nakamoto.opentensor.ai/#/explorer",
'endpoint': "https://explorer.nakamoto.opentensor.ai/#/",
'nobunaga': "https://staging.opentensor.ai/#/explorer",
'finney': "https://explorer.opentensor.ai/"
'endpoint': "https://explorer.finney.opentensor.ai/#/explorer",
'finney': "https://explorer.finney.opentensor.ai/#/explorer"
}

# Avoid collisions with other processes
Expand All @@ -101,9 +100,12 @@ def turn_console_off():

__mock_chain_db__ = './tmp/mock_chain_db'

# Delegate Profiles
__delegate_profiles_url__: str = 'https://github.com/raw/opentensor/delegate_profiles/master/DELEGATES.md'

# --- Type Registry ---
__type_registry__ = {
'types': {
'Balance': 'u64', # Need to override default u128
},
}

# --- Prometheus ---
__prometheus_version__ = "0.1.0"
Expand Down Expand Up @@ -207,4 +209,4 @@ def turn_console_off():
wandb.add_defaults( defaults )
logging.add_defaults( defaults )

from substrateinterface import Keypair as Keypair
from substrateinterface import Keypair as Keypair
6 changes: 5 additions & 1 deletion bittensor/_axon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def check_config(cls, config: 'bittensor.Config' ):
bittensor.wallet.check_config( config )

@classmethod
def default_synapse_check(cls, synapse, hotkey ):
def default_synapse_check(cls, synapse, hotkey, inputs ):
""" default synapse check function
"""
if len(hotkey) == bittensor.__ss58_address_length__:
Expand Down Expand Up @@ -412,8 +412,12 @@ def parse_signature(
) -> Tuple[int, str, str, str, int]:
r"""Attempts to parse a signature from the metadata"""
signature = metadata.get("bittensor-signature")
version = metadata.get('bittensor-version')
if signature is None:
raise Exception("Request signature missing")
if int(version) < 370:
raise Exception("Incorrect Version")

for parser in [self.parse_signature_v2, self.parse_legacy_signature]:
parts = parser(signature)
if parts is not None:
Expand Down
2 changes: 1 addition & 1 deletion bittensor/_cli/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from .list import ListCommand
from .weights import SetWeightsCommand, WeightsCommand
from .query import QueryCommand
from .misc import HelpCommand, UpdateCommand, ListSubnetsCommand
from .misc import HelpCommand, UpdateCommand, ListSubnetsCommand
198 changes: 132 additions & 66 deletions bittensor/_cli/commands/delegates.py

Large diffs are not rendered by default.

215 changes: 115 additions & 100 deletions bittensor/_cli/commands/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,137 +15,152 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

import sys
import json
import argparse
import bittensor
from tqdm import tqdm
from rich.table import Table
from rich.prompt import Prompt
from .utils import check_netuid_set
console = bittensor.__console__

import os
import bittensor
from typing import List, Tuple

def _get_coldkey_wallets_for_path( path: str ) -> List['bittensor.wallet']:
try:
wallet_names = next(os.walk(os.path.expanduser(path)))[1]
return [ bittensor.wallet( path= path, name=name ) for name in wallet_names ]
except StopIteration:
# No wallet files found.
wallets = []
return wallets

def _get_hotkey_wallets_for_wallet( wallet ) -> List['bittensor.wallet']:
hotkey_wallets = []
hotkeys_path = wallet.path + '/' + wallet.name + '/hotkeys'
try:
hotkey_files = next(os.walk(os.path.expanduser(hotkeys_path)))[2]
except StopIteration:
hotkey_files = []
for hotkey_file_name in hotkey_files:
try:
hotkey_for_name = bittensor.wallet( path = wallet.path, name = wallet.name, hotkey = hotkey_file_name )
if hotkey_for_name.hotkey_file.exists_on_device() and not hotkey_for_name.hotkey_file.is_encrypted():
hotkey_wallets.append( hotkey_for_name )
except Exception:
pass
return hotkey_wallets

class InspectCommand:
@staticmethod
def run (cli):
r""" Inspect a cold, hot pair.
"""
wallet = bittensor.wallet(config = cli.config)
if cli.config.all == True:
wallets = _get_coldkey_wallets_for_path( cli.config.wallet.path )
else:
wallets = [bittensor.wallet( config = cli.config )]
subtensor = bittensor.subtensor( config = cli.config )

if cli.config.netuid != None:
# Verify subnet exists
if not subtensor.subnet_exists( netuid = cli.config.netuid ):
bittensor.__console__.print(f"[red]Subnet {cli.config.netuid} does not exist[/red]")
sys.exit(1)


with bittensor.__console__.status(":satellite: Looking up account on: [white]{}[/white] ...".format(cli.config.subtensor.get('network', bittensor.defaults.subtensor.network))):

if cli.config.wallet.get('hotkey', bittensor.defaults.wallet.hotkey) is None:
# If no hotkey is provided, inspect just the coldkey
wallet.coldkeypub
cold_balance = wallet.get_balance( subtensor = subtensor )
bittensor.__console__.print("\n[bold white]{}[/bold white]:\n {}[bold white]{}[/bold white]\n {} {}\n".format( wallet, "coldkey:".ljust(15), wallet.coldkeypub.ss58_address, " balance:".ljust(15), cold_balance.__rich__()), highlight=True)
netuids = subtensor.get_all_subnet_netuids()

try:
package_dir = os.path.dirname(bittensor.__file__)
root_dir = os.path.dirname(package_dir)
filename = os.path.join(root_dir, 'delegates.json')
if os.path.exists(filename):
registered_delegate_info = json.load( open(filename, 'r') )
else:
wallet.hotkey
wallet.coldkeypub
registered_delegate_info = {}
except:
registered_delegate_info = {}

if cli.config.netuid != None:
# If a netuid is provided, inspect the hotkey and the neuron
dendrite = bittensor.dendrite( wallet = wallet )
neuron = subtensor.get_neuron_for_pubkey_and_subnet( hotkey_ss58 = wallet.hotkey.ss58_address, netuid = cli.config.netuid )
if neuron.is_null:
registered = '[bold white]No[/bold white]'
stake = bittensor.Balance.from_tao( 0 )
emission = bittensor.Balance.from_rao( 0 )
latency = 'N/A'
else:
endpoint = bittensor.endpoint.from_neuron( neuron )
registered = '[bold white]Yes[/bold white]'
stake = neuron.total_stake
emission = bittensor.Balance.from_rao( neuron.emission * 1000000000 )
synapses = [bittensor.synapse.TextLastHiddenState()]
_, c, t = dendrite.text( endpoints = endpoint, inputs = 'hello world', synapses=synapses)
latency = "{}".format((t[0]).tolist()[0]) if (c[0]).tolist()[0] == 1 else 'N/A'
neuron_state_dict = {}
for netuid in tqdm( netuids ):
neuron_state_dict[netuid] = subtensor.neurons_lite( netuid )

cold_balance = subtensor.get_balance( wallet.coldkeypub.ss58_address )
bittensor.__console__.print((
"\n[bold white]{}[/bold white]:\n [bold grey]{}[bold white]{}[/bold white]\n" + \
" {}[bold white]{}[/bold white]\n {}{}\n {}{}\n {}{}\n {}{}\n {}{}[/bold grey]"
)
.format(
wallet,
"coldkey:".ljust(15),
wallet.coldkeypub.ss58_address,
"hotkey:".ljust(15),
wallet.hotkey.ss58_address,
"registered:".ljust(15),
registered,
"balance:".ljust(15),
cold_balance.__rich__(),
"stake:".ljust(15),
stake.__rich__(),
"emission:".ljust(15),
emission.__rich_rao__(),
"latency:".ljust(15),
latency
), highlight=True)
table = Table(show_footer=True, pad_edge=False, box=None, expand=True)
table.add_column("[overline white]Coldkey", footer_style = "overline white", style='bold white')
table.add_column("[overline white]Balance", footer_style = "overline white", style='green')
table.add_column("[overline white]Delegate", footer_style = "overline white", style='blue')
table.add_column("[overline white]Stake", footer_style = "overline white", style='green')
table.add_column("[overline white]Emission", footer_style = "overline white", style='green')
table.add_column("[overline white]Netuid", footer_style = "overline white", style='bold white')
table.add_column("[overline white]Hotkey", footer_style = "overline white", style='yellow')
table.add_column("[overline white]Stake", footer_style = "overline white", style='green')
table.add_column("[overline white]Emission", footer_style = "overline white", style='green')
for wallet in tqdm( wallets ):
delegates: List[Tuple(bittensor.DelegateInfo, bittensor.Balance)] = subtensor.get_delegated( coldkey_ss58=wallet.coldkeypub.ss58_address )
if not wallet.coldkeypub_file.exists_on_device(): continue
cold_balance = wallet.get_balance( subtensor = subtensor )
table.add_row(
wallet.name,
str(cold_balance),
'',
'',
'',
'',
'',
'',
'',
)
for dele, staked in delegates:
if dele.hotkey_ss58 in registered_delegate_info:
delegate_name = registered_delegate_info[dele.hotkey_ss58]['name']
else:
# Otherwise, print all subnets the hotkey is registered on.
# If a netuid is provided, inspect the hotkey and the neuron
stake = subtensor.get_stake_for_coldkey_and_hotkey( hotkey_ss58 = wallet.hotkey.ss58_address, coldkey_ss58 = wallet.coldkeypub.ss58_address )
if stake == None:
# Not registered on any subnets
subnets = "[bold white][][/bold white]"
stake = bittensor.Balance.from_tao( 0 )
else:
# Registered on subnets
subnets_registered = subtensor.get_netuids_for_hotkey( hotkey_ss58 = wallet.hotkey.ss58_address )
subnets = f'[bold white]{subnets_registered}[/bold white]'

emission = bittensor.Balance.from_rao( 0 )
for netuid in subnets_registered:
neuron = subtensor.neuron_for_pubkey( hotkey_ss58 = wallet.hotkey.ss58_address, netuid = netuid )
emission += bittensor.Balance.from_rao( neuron.emission * 1000000000 )

cold_balance = subtensor.get_balance( wallet.coldkeypub.ss58_address )
bittensor.__console__.print((
"\n[bold white]{}[/bold white]:\n [bold grey]{}[bold white]{}[/bold white]\n" + \
" {}[bold white]{}[/bold white]\n {}{}\n {}{}\n {}{}\n {}{}\n {}{}[/bold grey]"
)
.format(
wallet,
"coldkey:".ljust(15),
wallet.coldkeypub.ss58_address,
"hotkey:".ljust(15),
wallet.hotkey.ss58_address,
"subnets:".ljust(15),
subnets,
"balance:".ljust(15),
cold_balance.__rich__(),
"stake:".ljust(15),
stake.__rich__(),
"emission:".ljust(15),
emission.__rich_rao__(),
), highlight=True)
delegate_name = dele.hotkey_ss58
table.add_row(
'',
'',
str(delegate_name),
str(staked),
str(dele.total_daily_return.tao * (staked.tao/dele.total_stake.tao)),
'',
'',
'',
''
)

hotkeys = _get_hotkey_wallets_for_wallet( wallet )
for netuid in netuids:
for neuron in neuron_state_dict[netuid]:
if neuron.coldkey == wallet.coldkeypub.ss58_address:
table.add_row(
'',
'',
'',
'',
'',
str( netuid ),
str( neuron.hotkey ),
str( neuron.stake ),
str( bittensor.Balance.from_tao(neuron.emission) )
)

bittensor.__console__.print(table)



@staticmethod
def check_config( config: 'bittensor.Config' ):
check_netuid_set( config, subtensor = bittensor.subtensor( config = config ),allow_none = True )
if config.wallet.get('name') == bittensor.defaults.wallet.name and not config.no_prompt:
if not config.all and config.wallet.get('name') == bittensor.defaults.wallet.name and not config.no_prompt:
wallet_name = Prompt.ask("Enter wallet name", default = bittensor.defaults.wallet.name)
config.wallet.name = str(wallet_name)

if config.wallet.get('hotkey') == bittensor.defaults.wallet.hotkey and not config.no_prompt:
hotkey = Prompt.ask("Enter hotkey name (optional)", default = None)
config.wallet.hotkey = hotkey

@staticmethod
def add_args( parser: argparse.ArgumentParser ):
inspect_parser = parser.add_parser(
'inspect',
help='''Inspect a wallet (cold, hot) pair'''
)
inspect_parser.add_argument(
'--all',
action='store_true',
help='''Check all coldkey wallets.''',
default = False
)
inspect_parser.add_argument(
'--no_prompt',
dest='no_prompt',
Expand Down
11 changes: 6 additions & 5 deletions bittensor/_cli/commands/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def run( cli ):
return

# Pull neuron info for all keys.
neurons: Dict[str, List[bittensor.NeuronInfo, bittensor.Wallet]] = {}
neurons: Dict[str, List[bittensor.NeuronInfoLite, bittensor.Wallet]] = {}
block = subtensor.block

netuids = subtensor.get_all_subnet_netuids()
Expand Down Expand Up @@ -115,6 +115,7 @@ def run( cli ):
total_neurons = 0
total_stake = 0.0
for netuid in netuids:
subnet_tempo = subtensor.tempo(netuid=netuid)
last_subnet = netuid == netuids[-1]
TABLE_DATA = []
total_rank = 0.0
Expand All @@ -126,7 +127,7 @@ def run( cli ):
total_emission = 0

for nn, hotwallet in neurons[str(netuid)]:
nn: bittensor.NeuronInfo
nn: bittensor.NeuronInfoLite
uid = nn.uid
active = nn.active
stake = nn.total_stake.tao
Expand All @@ -136,7 +137,7 @@ def run( cli ):
validator_trust = nn.validator_trust
incentive = nn.incentive
dividends = nn.dividends
emission = nn.emission / (subtensor.tempo(netuid=netuid) + 1)
emission = int(nn.emission / (subnet_tempo + 1) * 1e9)
last_update = int(block - nn.last_update)
validator_permit = nn.validator_permit
row = [
Expand All @@ -150,7 +151,7 @@ def run( cli ):
'{:.5f}'.format(consensus),
'{:.5f}'.format(incentive),
'{:.5f}'.format(dividends),
'{:.5f}'.format(emission),
'{:_}'.format(emission),
'{:.5f}'.format(validator_trust),
'*' if validator_permit else '',
str(last_update),
Expand Down Expand Up @@ -196,7 +197,7 @@ def run( cli ):
table.add_column("[overline white]CONSENSUS", '{:.5f}'.format(total_consensus), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]INCENTIVE", '{:.5f}'.format(total_incentive), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]DIVIDENDS", '{:.5f}'.format(total_dividends), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]EMISSION(\u03C4)", '\u03C4{}'.format(int(total_emission)), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]EMISSION(\u03C1)", '\u03C1{:_}'.format(total_emission), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]VTRUST", '{:.5f}'.format(total_validator_trust), footer_style="overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]VPERMIT", justify='right', no_wrap=True)
table.add_column("[overline white]UPDATED", justify='right', no_wrap=True)
Expand Down
Loading

0 comments on commit 6fed57e

Please sign in to comment.