Skip to content

Commit

Permalink
feat(subspace) deleting deprecated storage values
Browse files Browse the repository at this point in the history
  • Loading branch information
supreme committed May 31, 2024
1 parent 872cd3c commit 01be368
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 66 deletions.
105 changes: 51 additions & 54 deletions commune/subspace/subspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,60 +24,59 @@ class Subspace(c.Module):
'get_stake_to',
'get_stake_from']

module_features = ['key',
'address',
'name',
'emission',
'incentive',
'dividends',
'last_update',
'stake_from',
'weights',
'delegation_fee',
'trust',
'regblock']
module_features = [
"key",
"address",
"name",
"emission",
"incentive",
"dividends",
"last_update",
"stake_from",
"weights",
"delegation_fee",
"trust",
"regblock",
]

subnet_features = [
"Tempo",
'ImmunityPeriod',
'MinAllowedWeights',
'MaxAllowedWeights',
'MaxAllowedUids',
'MinStake',
'Founder',
'FounderShare',
'IncentiveRatio',
'TrustRatio',
'VoteModeSubnet',
'MaxWeightAge',
'MaxStake',
'SubnetNames'
]

global_features = [ 'BurnRate',
'MaxNameLength',
'MaxAllowedModules',
'MaxAllowedSubnets',
'MaxRegistrationsPerBlock',
'MinBurn',
'MinStakeGlobal',
'MinWeightStake',
'UnitEmission',
]


"Tempo",
"ImmunityPeriod",
"MinAllowedWeights",
"MaxAllowedWeights",
"MaxAllowedUids",
"MinStake",
"Founder",
"FounderShare",
"IncentiveRatio",
"TrustRatio",
"VoteModeSubnet",
"MaxWeightAge",
"SubnetNames",
]

global_features = [
"MaxNameLength",
"MaxAllowedModules",
"MaxAllowedSubnets",
"MaxRegistrationsPerBlock",
"MinBurn",
"MinWeightStake",
"UnitEmission",
]


module_features = [
'key',
'name',
'address',
'emission',
'incentive',
'dividends',
'last_update',
'stake_from',
'delegation_fee']
"key",
"name",
"address",
"emission",
"incentive",
"dividends",
"last_update",
"stake_from",
"delegation_fee",
]

cost = 1
block_time = 8 # (seconds)
default_config = c.get_config('subspace', to_munch=False)
Expand Down Expand Up @@ -1141,8 +1140,6 @@ def feature2name(cls, feature='MinStake'):
name = 'vote_mode'
elif name == 'subnet_names':
name = 'name'
elif name == 'min_stake_global':
name = 'min_stake'

return name

Expand Down Expand Up @@ -1198,7 +1195,7 @@ def subnet_params(self,
max_age = 1000,
fmt:str='j',
features = subnet_features,
value_features = ['min_stake', 'max_stake'],
value_features = ['min_stake'],
trials = 6,
**kwargs
) -> list:
Expand Down Expand Up @@ -2797,7 +2794,7 @@ def update_subnet(
netuid = self.resolve_netuid(netuid)
subnet_params = self.subnet_params( netuid=netuid , update=update, network=network, fmt='nanos')
# infer the key if you have it
for k in ['max_stake', 'min_stake']:
for k in ['min_stake']:
if k in params:
params[k] = params[k] * 1e9
if key == None:
Expand Down
2 changes: 0 additions & 2 deletions commune/subspace/tokenomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ def dashboard(cls, *args, **kwargs):

n = st.number_input('Number of Modules', 1, 1000000, 8400, 1, key=f'n.modules')

burn_rate = st.slider('Burn Rate', 0.0, 1.0, 0.0, 0.01, key=f'burn.rate')

dividend_rate = st.slider('Dividend Rate', 0.0, 1.0, 0.5, 0.01, key=f'dividend.rate')

emission_per_halving = st.number_input('Emission Per Halving', 0, 1_000_000_000, 250_000_000, 1, key=f'emission.per.halving')
Expand Down
4 changes: 0 additions & 4 deletions docs/blockchain/subnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ self_vote
name
- the name of your subnet

max_stake
- the maximum amount of stake a module can have

```bash
{
'tempo': 1,
Expand All @@ -119,7 +116,6 @@ max_stake
'vote_mode': 'authority',
'self_vote': True,
'name': 'subspace',
'max_stake': 1000000000000000
}

```
Expand Down
1 change: 0 additions & 1 deletion modules/explorer/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def get_state(network):
s_modules = modules[s_netuid]
subnet = subnets[s_netuid]
subnet['n'] = len(s_modules)
subnet['max_stake'] /= 1e9
total_stake = sum([sum([v/1e9 for k,v in m['stake_from'].items()]) for m in s_modules])
subnet['total_stake'] = total_stake
subnet['emission_per_epoch'] = sum([m['emission']/1e9 for m in s_modules])
Expand Down
5 changes: 0 additions & 5 deletions modules/tokenomics/tokenomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ def dividends_dashboard(self, df):
def dashboard(cls, *args, **kwargs):
self = cls(*args, **kwargs)
st.write('# Tokenomics')




with st.expander('Parameters', expanded=False):
cols = st.columns(2)
Expand All @@ -133,8 +130,6 @@ def dashboard(cls, *args, **kwargs):

n = st.number_input('Number of Modules', 1, 1000000, 8400, 1, key=f'n.modules')

burn_rate = st.slider('Burn Rate', 0.0, 1.0, 0.0, 0.01, key=f'burn.rate')

dividend_rate = st.slider('Dividend Rate', 0.0, 1.0, 0.5, 0.01, key=f'dividend.rate')

emission_per_halving = st.number_input('Emission Per Halving', 0, 1_000_000_000, 250_000_000, 1, key=f'emission.per.halving')
Expand Down

0 comments on commit 01be368

Please sign in to comment.