masa-finance / masa-bittensor

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

spike: research how vtrust and vpermit works #88

Closed teslashibe closed 2 weeks ago

teslashibe commented 3 weeks ago

We currently see that miners on our network get vtrust which implicitly makes them validators.

Research how vtrust gets set for both a validator and miner, an miner should not get vtrust otherwise it is a validator or miner/validator

teslashibe commented 3 weeks ago

Ask in Discord

grantdfoster commented 3 weeks ago

Tracking conversation here

grantdfoster commented 3 weeks ago

Based on the conversation in Discord, the Testnet may be configured in such a way that there is no minimum TAO required to acquire a vpermit. Creating a fresh miner now on devent to see the vpermit behavior...

Screenshot 2024-06-13 at 10 09 20 AM

As seen above, there is no vpermit on a freshly-registered miner on devnet. Will do some miner work and see when a vpermit is acquired (likely above a certain TAO staked threshold)

grantdfoster commented 3 weeks ago

After doing some work with miner-2, we see that it now has a vpermit! I have replicated this behavior on testnet as well. Pivoting to more holistic research on the topic after playing around locally.

Screenshot 2024-06-13 at 11 02 36 AM

grantdfoster commented 3 weeks ago

Research

VPermit

VTrust

Validator / Miner Identification

grantdfoster commented 3 weeks ago

Adding a stake check on the synapse can look like the following in miner/forward.py:

# Get the current stakes from the metagraph
current_stakes = self.metagraph.S

# Define the minimum stake required
min_stake = 1000  # Adjust this value as needed

# Check if the calling neuron meets the minimum stake requirement
caller_uid = self.metagraph.hotkeys.index(synapse.dendrite.hotkey)
if current_stakes[caller_uid] < min_stake:
    bt.logging.warning(f"Rejecting synapse from neuron with insufficient stake: {current_stakes[caller_uid]}")
    return synapse  # You might want to modify the response to indicate rejection
hide-on-bush-x commented 3 weeks ago

It looks like applying that min_stake may be the way to go, have you done any research about what kind of minimums are other subnets using?

Based on that we should be able to create a task for implementation

teslashibe commented 3 weeks ago

Really great work here @grantdfoster - lets do an implementation ticket and move this forward.

I am adding min_stake to our production release checklist here: https://github.com/orgs/masa-finance/projects/12/views/1?pane=issue&itemId=66418693

Please link this spike in the implementation ticket

cc @Luka-Loncar