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 signers in decided message #484

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

MatheusFranco99
Copy link
Contributor

@MatheusFranco99 MatheusFranco99 commented Aug 15, 2024

Overview

This PR adds the feature of sorting the signers in the decided message.

It adds a "sorted decided" test to test the sorting upon receiving commit messages in an unsorted order.

Closes #472

@@ -50,7 +50,7 @@ func (b *BaseRunner) ValidatePostConsensusMsg(runner Runner, psigMsgs *types.Par
}

// TODO https://github.com/ssvlabs/ssv-spec/issues/142 need to fix with this issue solution instead.
if b.State.DecidedValue == nil || len(b.State.DecidedValue) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

that's from another PR no?
you can resolve when solving conflicts

Copy link
Contributor Author

@MatheusFranco99 MatheusFranco99 Aug 15, 2024

Choose a reason for hiding this comment

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

Due to the linter update, I have been fixing this lint issue in all the recent PRs so that actions would pass

)

// SortedDecided tests the creation of the decided message that should have sorted signers
func SortedDecided() tests.SpecTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

no output messages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Notice that ControllerSpecTest.OutputMessages is unused. For this test, we actually use ControllerSpecTest.RunInstanceData.ExpectedDecidedState.BroadcastedDecided to test the broadcasted decided message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Notice that not only does none of the implemented tests define it but the spec test itself doesn't use it.

As I see it, the reason is that the controller spec test wants to test decided values and the decided messages for a list of instances (and not the instance's broadcasted messages).

I think that we should either drop this field or implement it in the tests if wanted.

Copy link
Contributor

@y0sher y0sher left a comment

Choose a reason for hiding this comment

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

lgtm

@MatheusFranco99 MatheusFranco99 merged commit c61218a into ssvlabs:dev Aug 20, 2024
2 checks passed
@MatheusFranco99 MatheusFranco99 deleted the sort-decided-signers branch August 20, 2024 10:41
GalRogozinski pushed a commit that referenced this pull request Sep 12, 2024
* Sort signers in decided message

* Add test for sorted signers in decided msg

* Generate JSON tests

* Fix lint issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants