From 75007c4ffc07e9c194f22693196792077190895c Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Wed, 5 Mar 2025 20:25:27 +0200 Subject: [PATCH] Uses `block` in `Metagraph._get_all_stakes_from_chain` --- bittensor/core/metagraph.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bittensor/core/metagraph.py b/bittensor/core/metagraph.py index 06b9a66bb2..dad65986c9 100644 --- a/bittensor/core/metagraph.py +++ b/bittensor/core/metagraph.py @@ -1400,7 +1400,7 @@ async def sync( await self._set_weights_and_bonds(subtensor=subtensor) # Fills in the stake associated attributes of a class instance from a chain response. - await self._get_all_stakes_from_chain() + await self._get_all_stakes_from_chain(block=block) # apply MetagraphInfo data to instance await self._apply_metagraph_info() @@ -1566,13 +1566,14 @@ async def _process_root_weights( ) return tensor_param - async def _get_all_stakes_from_chain(self): + async def _get_all_stakes_from_chain(self, block: int): """Fills in the stake associated attributes of a class instance from a chain response.""" try: result = await self.subtensor.query_runtime_api( runtime_api="SubnetInfoRuntimeApi", method="get_subnet_state", params=[self.netuid], + block=block, ) if result is None: @@ -1713,7 +1714,7 @@ def sync( self._set_weights_and_bonds(subtensor=subtensor) # Fills in the stake associated attributes of a class instance from a chain response. - self._get_all_stakes_from_chain() + self._get_all_stakes_from_chain(block=block) # apply MetagraphInfo data to instance self._apply_metagraph_info() @@ -1873,13 +1874,14 @@ def _process_root_weights( ) return tensor_param - def _get_all_stakes_from_chain(self): + def _get_all_stakes_from_chain(self, block: int): """Fills in the stake associated attributes of a class instance from a chain response.""" try: result = self.subtensor.query_runtime_api( runtime_api="SubnetInfoRuntimeApi", method="get_subnet_state", params=[self.netuid], + block=block, ) if result is None: