Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions neurons/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def rc_priority_fn(synapse: template.protocol.ValidatorCheckpoint) -> float:
self.position_syncer.sync_positions(
False, candidate_data=self.position_syncer.read_validator_checkpoint_from_gcloud_zip())

self.position_manager.update_all_positions()



Expand Down
8 changes: 8 additions & 0 deletions vali_objects/utils/position_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ def dedupe_positions(self, positions, miner_hotkey):
bt.logging.warning(f"Hotkey {miner_hotkey}: Deleted {n_positions_deleted} duplicate positions and {n_orders_deleted} "
f"duplicate orders across {n_positions_rebuilt_with_new_orders} positions.")

def update_all_positions(self):
hotkey_to_positions = self.get_all_disk_positions_for_all_miners(sort_positions=True, only_open_positions=False, perform_exorcism=True)

for hotkey, positions in hotkey_to_positions.items():
for p in positions:
p.rebuild_position_with_updated_orders()
self.save_miner_position_to_disk(p, delete_open_position_if_exists=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?


def apply_order_corrections(self):
"""
This is our mechanism for manually synchronizing validator orders in situations where a bug prevented an
Expand Down