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 connected weight calculation #486

Merged
merged 5 commits into from
Oct 18, 2024

Conversation

michaelkaplan13
Copy link
Collaborator

Why this should be merged

It looks like the way that the relayer was previously calculating the connectedWeight is incorrect. The Weight for each validator returned by GetCurrentCanonicalValidatorSet is the total weight for all node IDs with a given BLS key. When summing the weight by iterating over connected node IDs then, we would be double counting in any situation where multiple node IDs were using the same BLS key.

How this works

Checks if a node ID with the given BLS key have been accounted for already.

How this was tested

TODO

How is this documented

N/A

Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

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

Good catch and LGTM

@iansuvak iansuvak marked this pull request as ready for review October 17, 2024 20:03
@iansuvak iansuvak requested a review from a team as a code owner October 17, 2024 20:03
@michaelkaplan13
Copy link
Collaborator Author

@iansuvak thank you for looping back to add the tests here 🙏

@michaelkaplan13 michaelkaplan13 merged commit ee88f8d into main Oct 18, 2024
8 checks passed
@michaelkaplan13 michaelkaplan13 deleted the fix-connected-weight-calculation branch October 18, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants