From 9a7524e990ce3cb9391d2352a8571db03982ebc3 Mon Sep 17 00:00:00 2001 From: Windfarer Date: Wed, 18 Jun 2025 23:06:49 +0800 Subject: [PATCH 1/3] fix type --- bittensor/core/axon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bittensor/core/axon.py b/bittensor/core/axon.py index 56b55e60eb..76ecc14a4b 100644 --- a/bittensor/core/axon.py +++ b/bittensor/core/axon.py @@ -1267,7 +1267,7 @@ async def preprocess(self, request: "Request") -> "Synapse": # Fills the local axon information into the synapse. synapse.axon.__dict__.update( { - "version": str(version_as_int), + "version": int(version_as_int), "uuid": str(self.axon.uuid), "nonce": time.time_ns(), "status_code": 100, @@ -1276,7 +1276,7 @@ async def preprocess(self, request: "Request") -> "Synapse": # Fills the dendrite information into the synapse. synapse.dendrite.__dict__.update( - {"port": str(request.client.port), "ip": str(request.client.host)} # type: ignore + {"port": int(request.client.port), "ip": str(request.client.host)} # type: ignore ) # Signs the synapse from the axon side using the wallet hotkey. From eb0136384c7fd1712e274ba61ea2811e331fc072 Mon Sep 17 00:00:00 2001 From: Windfarer Date: Sun, 22 Jun 2025 09:36:32 +0800 Subject: [PATCH 2/3] fix unit test --- tests/unit_tests/test_axon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_axon.py b/tests/unit_tests/test_axon.py index 4bfdf71e37..1cc64ff8ca 100644 --- a/tests/unit_tests/test_axon.py +++ b/tests/unit_tests/test_axon.py @@ -493,7 +493,7 @@ async def test_preprocess(self): synapse = await self.axon_middleware.preprocess(request) # Check if the preprocess function fills the axon information into the synapse - assert synapse.axon.version == str(version_as_int) + assert synapse.axon.version == version_as_int assert synapse.axon.uuid == "1234" assert synapse.axon.nonce is not None assert synapse.axon.status_message is None From 6dce7051c202b74a1f1e144082e6cbbd577f9d1e Mon Sep 17 00:00:00 2001 From: Windfarer Date: Sun, 22 Jun 2025 10:43:39 +0800 Subject: [PATCH 3/3] fix port --- tests/unit_tests/test_axon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_axon.py b/tests/unit_tests/test_axon.py index 1cc64ff8ca..d356883721 100644 --- a/tests/unit_tests/test_axon.py +++ b/tests/unit_tests/test_axon.py @@ -501,7 +501,7 @@ async def test_preprocess(self): assert synapse.axon.signature == "0xaabbccdd" # Check if the preprocess function fills the dendrite information into the synapse - assert synapse.dendrite.port == "5000" + assert synapse.dendrite.port == 5000 assert synapse.dendrite.ip == "192.168.0.1" # Check if the preprocess function sets the request name correctly