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

Adding nil error check to connection status for ETH1 nodes #10186

Conversation

michaelneuder
Copy link
Contributor

@michaelneuder michaelneuder commented Feb 4, 2022

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Fixes the bug reported in #10165

Which issues(s) does this PR fix?

#10165

Other notes for review

Added a nil check for the error in connection status. I added to the unit test to verify the nil error case returns an empty string.

@michaelneuder michaelneuder requested a review from a team as a code owner February 4, 2022 02:52
@michaelneuder michaelneuder changed the title dding nil error check to connection status for ETH1 nodes Adding nil error check to connection status for ETH1 nodes Feb 4, 2022
Comment on lines +230 to +231
if err == nil {
errStrs = append(errStrs, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

What do we need an empty string for? Why not just skip this item?

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 we leave the empty string out, it might be confusing in the case that some of the connections have errors and others do not. For example, let's say we have connections conn1, conn2, conn3 and errors only on the first and third connection. Then the error strings could either be err1, "", err2 or err1 err2 (if we don't use the empty strings). It seems like there might be some ambiguity in the second case, because err2 could either map to conn2 or conn3. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

This makes perfect sense given that ETH1ConnectionErrors returns a value for each connection. Thanks!

@prylabs-bulldozer prylabs-bulldozer bot merged commit 7370c42 into prysmaticlabs:develop Feb 14, 2022
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.

4 participants