AlexNijjar commited on
Commit
10cac9a
·
unverified ·
1 Parent(s): 08e61b4

Update dependencies, fix commitment fetch

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. requirements.txt +4 -4
  3. src/chain_data.py +6 -12
  4. src/wandb_data.py +1 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🏆
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
- sdk_version: 5.13.1
8
  app_file: src/app.py
9
  pinned: true
10
  ---
 
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
+ sdk_version: 5.16.0
8
  app_file: src/app.py
9
  pinned: true
10
  ---
requirements.txt CHANGED
@@ -1,8 +1,8 @@
1
- fiber @ git+https://github.com/rayonlabs/fiber.git@2.1.1#egg=fiber[chain]
2
- gradio==5.13.1
3
- wandb==0.19.2
4
  substrate-interface==1.7.10
5
- plotly==5.24.1
6
  pandas==2.2.3
7
  packaging==24.2
8
  netaddr==1.3.0
 
1
+ fiber @ git+https://github.com/rayonlabs/fiber.git@2.2.3#egg=fiber[chain]
2
+ gradio==5.16.0
3
+ wandb==0.19.6
4
  substrate-interface==1.7.10
5
+ plotly==6.0.0
6
  pandas==2.2.3
7
  packaging==24.2
8
  netaddr==1.3.0
src/chain_data.py CHANGED
@@ -8,7 +8,6 @@ from typing import TypeAlias
8
  import requests
9
  from cachetools import TTLCache, cached
10
  from fiber import constants
11
- from fiber.chain.commitments import _deserialize_commitment_field
12
  from fiber.chain.interface import get_substrate
13
  from fiber.chain.metagraph import Metagraph
14
  from pydantic import BaseModel
@@ -98,6 +97,8 @@ def fetch_weights(block: int):
98
 
99
  for hotkey, neuron in get_neurons().items():
100
  for storage, validator_weights in weights:
 
 
101
  validator_hotkey = HOTKEYS_BY_UID[storage.params[1]]
102
  if hotkey not in WEIGHTS_BY_MINER:
103
  WEIGHTS_BY_MINER[hotkey] = []
@@ -160,23 +161,16 @@ def fetch_commitments() -> dict[Key, Commitment]:
160
 
161
  for storage, commitment in results:
162
  try:
163
- if not commitment or not commitment.value:
164
- continue
165
-
166
- fields = commitment.value["info"]["fields"]
167
- if not fields:
168
- continue
169
-
170
- field = _deserialize_commitment_field(fields[0])
171
- if field is None:
172
  continue
173
 
174
- decoder = Decoder(field[1])
 
175
  spec_version = decoder.read_uint16()
176
  if spec_version != SPEC_VERSION:
177
  continue
178
 
179
- commitments[storage.params[1]] = Commitment.decode(decoder, int(commitment.value["block"]))
180
  except:
181
  traceback.print_exc()
182
 
 
8
  import requests
9
  from cachetools import TTLCache, cached
10
  from fiber import constants
 
11
  from fiber.chain.interface import get_substrate
12
  from fiber.chain.metagraph import Metagraph
13
  from pydantic import BaseModel
 
97
 
98
  for hotkey, neuron in get_neurons().items():
99
  for storage, validator_weights in weights:
100
+ if not validator_weights:
101
+ continue
102
  validator_hotkey = HOTKEYS_BY_UID[storage.params[1]]
103
  if hotkey not in WEIGHTS_BY_MINER:
104
  WEIGHTS_BY_MINER[hotkey] = []
 
161
 
162
  for storage, commitment in results:
163
  try:
164
+ if not commitment:
 
 
 
 
 
 
 
 
165
  continue
166
 
167
+ field = bytes(next(iter(commitment["info"]["fields"][0][0].values()))[0])
168
+ decoder = Decoder(field)
169
  spec_version = decoder.read_uint16()
170
  if spec_version != SPEC_VERSION:
171
  continue
172
 
173
+ commitments[storage.params[1]] = Commitment.decode(decoder, int(commitment["block"]))
174
  except:
175
  traceback.print_exc()
176
 
src/wandb_data.py CHANGED
@@ -16,7 +16,7 @@ from src.chain_data import get_neurons
16
 
17
  WANDB_RUN_PATH = os.environ["WANDB_RUN_PATH"]
18
 
19
- START_DATE = datetime(2025, 1, 28)
20
  OFFSET_DAYS = 0
21
 
22
  BLACKLIST_ENDPOINT = "https://edge-inputs.api.wombo.ai/blacklist"
 
16
 
17
  WANDB_RUN_PATH = os.environ["WANDB_RUN_PATH"]
18
 
19
+ START_DATE = datetime(2025, 2, 12)
20
  OFFSET_DAYS = 0
21
 
22
  BLACKLIST_ENDPOINT = "https://edge-inputs.api.wombo.ai/blacklist"