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

ssz: implement non-implemented tests #165

Merged
merged 7 commits into from
May 1, 2023

Conversation

nkryuchkov
Copy link
Contributor

No description provided.

@nkryuchkov nkryuchkov marked this pull request as ready for review March 6, 2023 11:42
@aaron-blox aaron-blox self-requested a review March 7, 2023 09:07
Base automatically changed from ssz-fix-tests-leftovers to ssz March 12, 2023 13:43
@lior-blox lior-blox changed the base branch from ssz to main March 12, 2023 17:20
@alonmuroch
Copy link
Contributor

@aaron-blox @lior-blox status?

@GalRogozinski GalRogozinski changed the base branch from main to ssz-beacon-version-block April 11, 2023 08:11
@GalRogozinski GalRogozinski changed the base branch from ssz-beacon-version-block to main April 11, 2023 08:12
@GalRogozinski GalRogozinski changed the base branch from main to os/ssz_expirements April 11, 2023 08:12
@GalRogozinski GalRogozinski changed the base branch from os/ssz_expirements to ssz-beacon-version-block April 11, 2023 08:12
@nkryuchkov nkryuchkov changed the base branch from ssz-beacon-version-block to main April 11, 2023 08:21
@nkryuchkov nkryuchkov force-pushed the ssz-implement-non-implemented-tests branch from e395efb to a9c3322 Compare April 11, 2023 13:11
Comment on lines +191 to +225
var TestingPrepareMessageWithRoundAndFullData = func(
sk *bls.SecretKey,
id types.OperatorID,
round qbft.Round,
fullData []byte,
) *qbft.SignedMessage {
msg := &qbft.Message{
MsgType: qbft.PrepareMsgType,
Height: qbft.FirstHeight,
Round: round,
Identifier: TestingIdentifier,
Root: sha256.Sum256(fullData),
}
ret := SignQBFTMsg(sk, id, msg)
ret.FullData = fullData
return ret
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This might not be in the scope of this PR... But maybe we should change TestingPrepareMessageWithParams to accept fullData?

Copy link
Contributor Author

@nkryuchkov nkryuchkov Apr 14, 2023

Choose a reason for hiding this comment

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

I agree that this needs to be done, but that's actually not the only thing that needs to be done among message generators, and solving it can potentially cause a huge amount of merge conflicts. I'd prefer doing this change in a separate PR and merging it quickly (it should be easy to review such a PR and make sure it doesn't break anything because all tests will pass)

@olegshmuelov olegshmuelov force-pushed the ssz-implement-non-implemented-tests branch from b4c5555 to 486e7d9 Compare April 17, 2023 12:14
Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

Approved
@alonmuroch you want to also take a look?

panic("implement")
ks := testingutils.Testing4SharesSet()

msg := testingutils.TestingCommitMultiSignerMessageWithHeight(
Copy link
Contributor

Choose a reason for hiding this comment

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

@GalRogozinski this kind of makes it a weird situation no? A decided message was received but the node thinks its invalid so it is basically stuck?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the expected behavior we expect?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see
If I understand correctly QBFT doesn't know what "invalid" data is. It just wants to reach a consensus on some data.
Also SSV protocol only has "slashable" checks. It doesn't know if the data is valid for the underlying blockchain protocol (ethereum in our case).

So maybe we should change "invalid" to "arbitrary"? Because "invalid" implies that it should be rejected.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually what I wrote is inaccurate. We currently do have validity checks for consensus data. But we check validity at earlier phases, and this should suffice. So I think the conclusion from my last answer holds...

Copy link
Contributor

Choose a reason for hiding this comment

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

Lets open a ticket to handle this in the future.
Currently what will happen is if an invalid data is decided, a node might reject it and fail.

Only way this can happen, I think, is if there was a fork and the node didn't update (because a majority did sign it after all)

Copy link
Contributor

Choose a reason for hiding this comment

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

There are 2 scenarios a node will get an invalid decided message

  1. malicious cluster majority
  2. fork, didn't update.

In both cases the node should reject I think

Copy link
Contributor

Choose a reason for hiding this comment

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

Added #201

@lior-blox lior-blox merged commit 2023d3c into main May 1, 2023
2 checks passed
@lior-blox lior-blox deleted the ssz-implement-non-implemented-tests branch May 1, 2023 12:28
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.

None yet

7 participants