Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo incrementing instead of decrementing #60

Merged
merged 2 commits into from
Dec 9, 2024
Merged

Conversation

clostao
Copy link
Member

@clostao clostao commented Dec 5, 2024

This PR solves the label (network name) issue in Subspace Telemetry where Taurus testnet is sometimes labeled as Autonomys Mainnet.

The issue is that for determining the label of the network it's used a voting-like system in which when nodes start sending telemetry logs also send its network information (genesis hash, network name, etc.). For each genesis hash the network name that has been sent the most times is the one to be shown.

The issue was that when a node lost connection with telemetry instead of decreasing the number of votes from the network name they voted the service was increasing the number of votes, leading to a corruption of the voting. With the current fix, as long as the number of nodes sending the correct network name remains higher from those sending a wrong name, the correct label should be shown.

That being said this highlights an underlying issue in which some nodes are sending telemetry logs with the wrong network name but the correct genesis hash. I'll be looking for that error but this should solve the issue of wrong network label.

@nazar-pc
Copy link
Member

nazar-pc commented Dec 5, 2024

Can you submit this upstream as well?

@clostao
Copy link
Member Author

clostao commented Dec 5, 2024

Can you submit this upstream as well?

Sure, here it is

Copy link
Member

@marc-aurele-besner marc-aurele-besner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

teor2345
teor2345 previously approved these changes Dec 5, 2024
Copy link
Member

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

This bug requires a specific set of circumstances to trigger
and become visible:
1. decrement a label that is non-zero but not first
2. repeat the decrement at least best_count()/2 times
3. increment that label
4. check the best count
@teor2345 teor2345 dismissed stale reviews from marc-aurele-besner and themself via 0cf73c4 December 5, 2024 22:29
@teor2345
Copy link
Member

teor2345 commented Dec 5, 2024

I pushed a commit with tests that check for this bug. Detailed reproduction steps are in the commit message, and the test comments.

@clostao
Copy link
Member Author

clostao commented Dec 6, 2024

Can't approve but LGTM

@teor2345
Copy link
Member

teor2345 commented Dec 9, 2024

Upstream has reviewed and approved it as well, so I think we can merge.

Edit: upstream does squash merging, so I merged it that way to avoid merge conflicts.

@teor2345 teor2345 merged commit aef97dc into master Dec 9, 2024
8 checks passed
@nazar-pc nazar-pc deleted the fix/label-issue branch January 10, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants