-
Notifications
You must be signed in to change notification settings - Fork 493
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
Algod: fix nil deref while fetching stateproof secrets #4554
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4554 +/- ##
==========================================
- Coverage 54.11% 54.09% -0.03%
==========================================
Files 401 401
Lines 51549 51552 +3
==========================================
- Hits 27898 27889 -9
- Misses 21311 21318 +7
- Partials 2340 2345 +5
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple minor suggestions.
partRndSecrets, err := manager.registry.GetStateProofSecretsForRound(part.ParticipationID, rnd) | ||
if err != nil { | ||
manager.log.Errorf("error while loading round secrets from participation registry: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removed the err wrapping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is due to the fact that we don't return a wrapped error here, just log the message.
Current, the log will contain a line like this:
error while loading round secrets from participation registry: %!w(*fmt.wrapError=&{...})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, right, logging, thanks!
Should the error be templated as %w?
…On Thu, 15 Sep 2022 at 12:35 Will Winder ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In data/account/participationRegistry.go
<#4554 (comment)>:
> @@ -767,6 +770,9 @@ func (db *participationDB) GetStateProofSecretsForRound(id ParticipationID, roun
if err != nil {
return StateProofSecretsForRound{}, err
}
+ if partRecord.StateProof == nil {
+ return StateProofSecretsForRound{}, ErrStateProofVerifierIsNil
Provide the ID for debugging:
⬇️ Suggested change
- return StateProofSecretsForRound{}, ErrStateProofVerifierIsNil
+ return StateProofSecretsForRound{}, fmt.Errorf("%s: for participation ID %s", ErrStateProofVerifierNotFound, id)
—
Reply to this email directly, view it on GitHub
<#4554 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATBKH5HAGV6KAFTFOLNRWNTV6NF65ANCNFSM6AAAAAAQNPLWLQ>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Summary
Test Plan