@@ -70,11 +70,7 @@ async def start(self):
7070 )
7171
7272 # Detect if any neuron IP has changed
73- has_axons_changed , new_axons = (
74- await self ._has_neuron_ip_changed (axons )
75- if axons
76- else (False , {})
77- )
73+ has_axons_changed , new_axons = await self ._has_neuron_ip_changed (axons )
7874
7975 # Determine whether a resync is needed
8076 time_to_resync = block - last_synced_block >= sync_interval
@@ -111,8 +107,14 @@ async def start(self):
111107
112108 # Sync from chain and update Redis
113109 axons , has_missing_country = await self ._resync ()
110+
111+ # Store the sync block
114112 last_synced_block = block
113+
114+ # Notify listener the metagraph is ready
115115 ready = await self ._notify_if_needed (ready )
116+
117+ # Store the new axons
116118 axons = new_axons
117119
118120 except Exception as e :
@@ -352,9 +354,6 @@ async def _has_new_neuron_registered(self, registration_count) -> tuple[bool, in
352354 async def _has_neuron_ip_changed (
353355 self , axons : dict [str , str ]
354356 ) -> tuple [bool , dict [str , str ]]:
355- if not axons :
356- return False , {}
357-
358357 latest_axons = await scbs .get_axons (
359358 subtensor = self .subtensor ,
360359 netuid = self .settings .netuid ,
@@ -377,12 +376,8 @@ async def _has_neuron_ip_changed(
377376 f"📈 { len (changed_axons )} neurons with changed IPs: { list (changed_axons .keys ())} " ,
378377 prefix = self .settings .logging_name ,
379378 )
380- return True , changed_axons
379+ return True , latest_axons
381380
382- btul .logging .debug (
383- "✅ No IP changes detected among tracked axons" ,
384- prefix = self .settings .logging_name ,
385- )
386381 return False , latest_axons
387382
388383 def _get_details_changed (self , new_neuron , current_neuron ):
0 commit comments