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

Sort quorum IDs before aggregation #375

Merged

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented Mar 20, 2024

Why are these changes needed?

Quorum numbers should be sorted to make sure APKs are in the right order as quorum numbers specified in signature checker

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim requested review from mooselumph and jianoaix March 20, 2024 21:12
@ian-shim ian-shim marked this pull request as ready for review March 20, 2024 21:13
@@ -426,6 +427,7 @@ func (b *Batcher) HandleSingleBatch(ctx context.Context) error {
for quorumID := range batch.State.Operators {
quorumIDs = append(quorumIDs, quorumID)
}
slices.Sort(quorumIDs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, what happens if they aren't sorted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

QuorumApks can be out of order and signature validation can fail

@ian-shim ian-shim merged commit d6cb34e into Layr-Labs:master Mar 20, 2024
6 checks passed
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