Skip to content

Commit

Permalink
Merge pull request #56 from coinmetrics/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-yuma authored Jan 16, 2025
2 parents d8429ee + c446fb2 commit 4d6973a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions docs/Release Notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Release Notes
=============
1.0.2
-----
Released on January 16th 2025
- Ensure metagraph is properly synced when new miners join the network

1.0.1
-----
Expand Down
10 changes: 5 additions & 5 deletions precog/validators/weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,17 @@ async def resync_metagraph(self):
bt.logging.debug(f"Before sync - MinerHistory keys: {old_history}")

# Update available UIDs
self.available_uids = asyncio.run(self.get_available_uids())
self.available_uids = await self.get_available_uids()
new_uids = set(self.available_uids)

# Update hotkeys dictionary
self.hotkeys = {uid: value for uid, value in enumerate(self.metagraph.hotkeys)}

# Process hotkey changes
for uid, hotkey in enumerate(self.metagraph.hotkeys):
new_miner = uid in new_uids and uid not in old_uids
if not new_miner:
replaced_miner = self.hotkeys[uid] != hotkey
replaced_miner = self.hotkeys.get(uid, "") != hotkey
else:
replaced_miner = False

Expand All @@ -121,9 +124,6 @@ async def resync_metagraph(self):
if uid in new_uids: # Only create history for available UIDs
self.MinerHistory[uid] = MinerHistory(uid, timezone=self.timezone)

# Update hotkeys dictionary
self.hotkeys = {uid: value for uid, value in enumerate(self.metagraph.hotkeys)}

# Ensure all available UIDs have MinerHistory entries
for uid in self.available_uids:
if uid not in self.MinerHistory:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "precog"
version = "1.0.1"
version = "1.0.2"
description = "Bitcoin Price Prediction Subnet"
authors = ["Coin Metrics", "Yuma Group"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def setUp(self):
def test_package_version(self):
# Check that version is as expected
# Must update to increment package version successfully
self.assertEqual(__version__, "1.0.1")
self.assertEqual(__version__, "1.0.2")

0 comments on commit 4d6973a

Please sign in to comment.