-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
Can you submit this upstream as well? |
Sure, here it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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
0cf73c4
I pushed a commit with tests that check for this bug. Detailed reproduction steps are in the commit message, and the test comments. |
Can't approve but LGTM |
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. |
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.