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

Fix for signature malleability #1335

Merged
merged 14 commits into from
Dec 3, 2024
Merged

Fix for signature malleability #1335

merged 14 commits into from
Dec 3, 2024

Conversation

yrong
Copy link
Contributor

@yrong yrong commented Nov 20, 2024

@@ -89,13 +93,37 @@ func toBeefyClientCommitment(c *types.Commitment) *contracts.BeefyClientCommitme
}
}

func cleanSignature(input types.BeefySignature) (uint8, [32]byte, [32]byte) {
func cleanSignature(input types.BeefySignature) (v uint8, r [32]byte, s [32]byte, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of interest, why name the return parameters?

Copy link
Contributor Author

@yrong yrong Nov 21, 2024

Choose a reason for hiding this comment

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

Nothing special, just for return with error easily.

return v, r, s, fmt.Errorf("invalid V:%d", v)

@yrong yrong marked this pull request as ready for review November 21, 2024 01:18
@yrong yrong requested a review from vgeddes November 21, 2024 05:57
@@ -22,9 +22,9 @@ var rootCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(run.Command())
rootCmd.AddCommand(getBlockCmd())
//rootCmd.AddCommand(fetchMessagesCmd())
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented code?

relayer/relays/beefy/parameters.go Show resolved Hide resolved
}
reverted = true
}
return v, r, s, reverted, nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

The reverted variable doesn't seem to be used anywhere?

Copy link
Contributor Author

@yrong yrong Nov 28, 2024

Choose a reason for hiding this comment

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

if reverted {
revertedNum++
logrus.Info(fmt.Sprintf("s is reverted, before clean:%s, after clean:%s", sBefore, sAfter))
}

Just used to inspect the beefy signatures.

@yrong yrong merged commit 2d2ac78 into main Dec 3, 2024
4 checks passed
@yrong yrong deleted the ron/fix-signature-malleability branch December 3, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants