Skip to content

Algod: fix nil deref while fetching stateproof secrets#4554

Merged
algorandskiy merged 7 commits intoalgorand:masterfrom
algonathan:fx
Sep 19, 2022
Merged

Algod: fix nil deref while fetching stateproof secrets#4554
algorandskiy merged 7 commits intoalgorand:masterfrom
algonathan:fx

Conversation

@algonathan
Copy link
Copy Markdown
Contributor

Summary

Test Plan

@algonathan algonathan changed the title Algod: fix to get stateproof secrets Algod: fix nil deref while fetching stateproof secrets Sep 15, 2022
cce
cce previously approved these changes Sep 15, 2022
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 15, 2022

Codecov Report

Merging #4554 (1c7004a) into master (7e8ca90) will decrease coverage by 0.02%.
The diff coverage is 80.00%.

@@            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     
Impacted Files Coverage Δ
data/accountManager.go 71.25% <50.00%> (ø)
data/account/participationRegistry.go 78.50% <100.00%> (+0.15%) ⬆️
network/wsPeer.go 66.03% <0.00%> (-4.86%) ⬇️
cmd/algoh/blockWatcher.go 77.77% <0.00%> (-3.18%) ⬇️
ledger/blockqueue.go 85.63% <0.00%> (-2.88%) ⬇️
network/wsNetwork.go 64.82% <0.00%> (ø)
ledger/acctupdates.go 70.19% <0.00%> (+0.59%) ⬆️
ledger/tracker.go 78.72% <0.00%> (+3.82%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment thread data/account/participationRegistry_test.go Outdated
Comment thread data/accountManager_test.go Outdated
Comment thread data/account/participationRegistry.go Outdated
Comment thread data/account/participationRegistry.go Outdated
Copy link
Copy Markdown
Contributor

@winder winder left a 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.

cce
cce previously approved these changes Sep 15, 2022
Comment thread data/accountManager.go
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)
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor

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=&{...})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah, right, logging, thanks!

@id-ms
Copy link
Copy Markdown
Contributor

id-ms commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants