masa-finance / masa-bittensor

Bittensor Subnet Config
https://masa.ai
MIT License
5 stars 5 forks source link

Figure out how to set axon's version #145

Closed juanmanso closed 1 month ago

juanmanso commented 1 month ago

Goal

We want to restrict miners and validators running old versions of our code. That means that if someone spins a neuron with 0.1.0 and we are supporting from 0.1.1 onwards, it would be ignored.

This should not be mistaken with a malicious actor blacklisting, but rather a fail safe for users to know they should update to latest versions of our code

juanmanso commented 1 month ago

🟢 [UPDATE] Version of axons is currently showing the version of bittensor

Experiment's output

As shown above (despite the errata of not changing the text to after rather than before the second time), I was able to change my own axon's version from 701 to 711.

These numbers are literally the bittensor version running locally. I was running bittensor's 7.0.1 and after changing it to 7.1.1 and running the validator again I was able to change it to 711.

Next step

Figure out how to manually set that version to something we can control (rather than the version of bittensor which is not useful to us if we want to restrict backwards miner and validator versions)

juanmanso commented 1 month ago

🟢 [UPDATE] Found where axon's info is set

Image

As shown on the image above, bittensor's package is in charge of the info method which sets the AxonInfo. In particular, the version is defined by bittensor's version.

If we need to tweak this, we require forking/overloading the axon instance as suggested on discord by Rapido [τ, ⛏]:

Image

Based on this, I'd suggest we look for another way to check the version of the app. Maybe create a Miner Metadata object of some sort as it is been done by SN15:

        metadata = MinerMetadata(
            sb=start_block,
            lb=last_block,
            bl=balance_model_last_block,
            n=get_network_id(self.config.network),
            cv=insights.__version__,
            lv=llm_version
        )
juanmanso commented 1 month ago

@hide-on-bush-x what do you think about this ☝

hide-on-bush-x commented 1 month ago

Great reseearch, super helpful, thank you @juanmanso!