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

feat: check quorums registered detail #331

Merged
merged 4 commits into from
Aug 29, 2024

Conversation

renlulu
Copy link
Contributor

@renlulu renlulu commented Aug 28, 2024

Add a function to query bitmap of quorums and convert it into human-readable format which is boolean array.

What Changed?

Reviewer Checklist

  • Code is well-documented
  • Code adheres to Go naming conventions
  • Code deprecates any old functionality before removing it

return nil, err
}
numBits := value.BitLen()
quorums := make([]bool, numBits)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How are you using this quorums array? Wouldn't you rather have a map instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, initially i thought we could use index of the array as the quorum index, but yes i have changed it to use a map for more easier to understand

Copy link
Collaborator

Choose a reason for hiding this comment

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

Think you should only be inputting the non zero quorums into the map? Aka treating it as a set instead of a map. That way you would iterate only on quorums that are nonzero.

Copy link
Contributor Author

@renlulu renlulu Aug 29, 2024

Choose a reason for hiding this comment

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

I think it is better to show zero quorums as well? so one use this function can easily get:

  1. which quorum(s) the operator is in already
  2. which quorum(s) the operator is not in

so he can adjust the strategy accordingly, i.e. re-join the missing quorum again

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. In that case don’t think map is needed and we can revert to array then haha?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted to use array

@renlulu renlulu requested a review from samlaf August 28, 2024 19:38
@samlaf samlaf merged commit 8757e81 into Layr-Labs:dev Aug 29, 2024
4 checks passed
@renlulu renlulu mentioned this pull request Aug 29, 2024
3 tasks
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.

2 participants