Algod: fix nil deref while fetching stateproof secrets#4554
Merged
algorandskiy merged 7 commits intoalgorand:masterfrom Sep 19, 2022
Merged
Algod: fix nil deref while fetching stateproof secrets#4554algorandskiy merged 7 commits intoalgorand:masterfrom
algorandskiy merged 7 commits intoalgorand:masterfrom
Conversation
cce
previously approved these changes
Sep 15, 2022
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 |
id-ms
reviewed
Sep 15, 2022
winder
reviewed
Sep 15, 2022
winder
reviewed
Sep 15, 2022
winder
reviewed
Sep 15, 2022
Contributor
winder
left a comment
There was a problem hiding this comment.
Looks good, just a couple minor suggestions.
cce
previously approved these changes
Sep 15, 2022
| if part.StateProof != nil && part.OverlapsInterval(rnd, rnd) { | ||
| partRndSecrets, err := manager.registry.GetStateProofSecretsForRound(part.ParticipationID, rnd) | ||
| if err != nil { | ||
| manager.log.Errorf("error while loading round secrets from participation registry: %w", err) |
Contributor
There was a problem hiding this comment.
why removed the err wrapping?
Contributor
There was a problem hiding this comment.
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=&{...})
Contributor
There was a problem hiding this comment.
ah, right, logging, thanks!
algorandskiy
approved these changes
Sep 19, 2022
Contributor
|
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:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test Plan