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

validator registration request bug: reusing public keys #10883

Merged
merged 4 commits into from
Jun 15, 2022

Conversation

james-prysm
Copy link
Contributor

What type of PR is this?

Bug fix

related to #10593
What does this PR do? Why is it needed?

Validator Registration Requests were not being created correctly due to reusing references for slices when constructing an array in the same "for" loop. the reference resulted in resuing the same public key ( the last one in the for loop) multiple times on the validator request.

read more about how references in forloops range statement are used https://go.dev/ref/spec#For_statements

The unit test is improved to make sure the public keys are unique in the request.

@james-prysm james-prysm requested a review from a team as a code owner June 15, 2022 03:16
@james-prysm james-prysm changed the title improving unit test for unique pubkey check validator registration request bug: reusing public keys Jun 15, 2022
@james-prysm james-prysm added Bug Something isn't working API Api related tasks Builder PR or issue that supports builder related work labels Jun 15, 2022
Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

Have we made sure that this is ok with the fee recipient?

@james-prysm
Copy link
Contributor Author

Have we made sure that this is ok with the fee recipient?

yeah fee recipient isn't part of the for loop( part of the problem of reusing items in a slice to compose something within the same loop)

@prylabs-bulldozer prylabs-bulldozer bot merged commit 838963c into develop Jun 15, 2022
@delete-merged-branch delete-merged-branch bot deleted the validator-registration-pointer-bug branch June 15, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Bug Something isn't working Builder PR or issue that supports builder related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants