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

recoverNSignatures() should return all signatures instead of number of signatures specified by requiredSignatures #3

Open
1 of 2 tasks
jimmychu0807 opened this issue Nov 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jimmychu0807
Copy link

jimmychu0807 commented Nov 16, 2024

Have you ensured that all of these are up to date?

  • This repo
  • Any dependencies (according to the package.json)

What command(s) is the bug in?

No response

Operating System

None

Describe the bug

recoverNSignatures() function currently only returns requiredSignatures number of signatures.

There could be a case that there are three signatures that are [valid, invalid, valid] with requiredSignatures = 2. In this case, the caller of this function will never retrieve the last valid signature.

I'm looking at this function in the context of OwnableValidator.sol recoverNSignatures(). If it requires the caller to know the total num of signatures beforehand in order to retrieve all sign. , then the param used in OwnableValidator.sol recoverNSignatures() should not be _threshold but the total number of signatures computed by the caller.

So seems need to update either the caller side or how recoverNSignatures() works.

@kopy-kat see if this suggestion makes sense to you. Thanks.

@jimmychu0807 jimmychu0807 added the bug Something isn't working label Nov 16, 2024
@jimmychu0807
Copy link
Author

jimmychu0807 commented Nov 17, 2024

I am okay to help make a PR by returning all signatures from recoverNSignatures(), and adding a test case in OwnableValidator for this case, if you also agree with this direction.

Then recoverNSignatures() function won't need the requiredSignatures parameter and use signaturesLength / 65 to determine the num. of signatures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants