Skip to content

Conversation

@GrapeBaBa
Copy link
Contributor

This pull request makes a small fix in the validateToRawMessage function to correctly check the presence of the from field instead of the key field when validating messages with the StrictNoSign option. This improves the accuracy of validation error reporting.

@GrapeBaBa GrapeBaBa requested a review from a team as a code owner September 12, 2025 08:11
@GrapeBaBa GrapeBaBa changed the title fix:fix the nosign policy validation wrong check fix: fix the nosign policy validation wrong check Sep 12, 2025
case StrictNoSign:
if (msg.signature != null) return { valid: false, error: ValidateError.SignaturePresent }
if (msg.seqno != null) return { valid: false, error: ValidateError.SeqnoPresent }
if (msg.key != null) return { valid: false, error: ValidateError.FromPresent }
Copy link
Member

Choose a reason for hiding this comment

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

I suppose we also want to keep the validation that msg.key is not present (with a ValidateError.KeyPresent error)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is indeed such a rule, I would like to add it. The original code is consistent with the implementation of rust, and the implementation of rust does not check the key.

@wemeetagain wemeetagain merged commit 5dac5fc into ChainSafe:master Sep 15, 2025
8 of 9 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