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

Do not panic on nil proof when handling votes #186

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

KonradStaniec
Copy link
Collaborator

If not would receive finality vote with nil Proof, it would panic.

Pr:

  • fixes that
  • add test case

Fixes: #174

@KonradStaniec KonradStaniec requested a review from a team as a code owner October 11, 2024 14:34
@KonradStaniec KonradStaniec requested review from Lazar955, RafilxTenfen and a team and removed request for a team October 11, 2024 14:34
Copy link
Contributor

@RafilxTenfen RafilxTenfen left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Member

@Lazar955 Lazar955 left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -20,6 +20,30 @@ func (m *MsgAddFinalitySig) MsgToSign() []byte {
return msgToSignForVote(m.BlockHeight, m.BlockAppHash)
}

func (m *MsgAddFinalitySig) ValidateBasic() error {
Copy link
Member

Choose a reason for hiding this comment

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

We could check lengths of fpBtcPk, PubRand, and FinalitySig

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point! 👍

@KonradStaniec KonradStaniec merged commit c4c25b6 into main Oct 14, 2024
20 checks passed
@KonradStaniec KonradStaniec deleted the konradstaniec/fix-not-panic-on-nil-proof branch October 14, 2024 11:15
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.

Passing nil proof in MsgAddFinality vote leads to Panic
4 participants