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

ledger refactoring: fix catchpoint tracker #3214

Merged

Conversation

tsachiherman
Copy link
Contributor

@tsachiherman tsachiherman commented Nov 15, 2021

Summary

When implementing the catchpoint tracker, I missed the re-initilization location for some of the local variables.
This would generate incorrect catchpoint labels after a node completes a fast-catchup.

#3085

Test Plan

  • Add unit tests
  • Perform manual testing

@cce
Copy link
Contributor

cce commented Nov 15, 2021

Huh, so should I have been seeing mismatched block digests show up more than I did?

@tsachiherman tsachiherman marked this pull request as draft November 15, 2021 20:24
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2021

Codecov Report

Merging #3214 (e8fe265) into master (8441d91) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3214      +/-   ##
==========================================
- Coverage   47.43%   47.41%   -0.03%     
==========================================
  Files         369      369              
  Lines       59494    59494              
==========================================
- Hits        28222    28209      -13     
- Misses      27987    27999      +12     
- Partials     3285     3286       +1     
Impacted Files Coverage Δ
ledger/catchpointtracker.go 42.48% <100.00%> (+0.93%) ⬆️
crypto/merkletrie/trie.go 66.42% <0.00%> (-2.19%) ⬇️
ledger/acctupdates.go 64.25% <0.00%> (-1.91%) ⬇️
crypto/merkletrie/node.go 91.62% <0.00%> (-1.87%) ⬇️
catchup/service.go 68.57% <0.00%> (-0.50%) ⬇️
network/requestTracker.go 70.68% <0.00%> (-0.44%) ⬇️
network/wsNetwork.go 62.84% <0.00%> (-0.20%) ⬇️
network/wsPeer.go 68.88% <0.00%> (+0.27%) ⬆️
data/transactions/verify/txn.go 44.29% <0.00%> (+0.87%) ⬆️
catchup/peerSelector.go 100.00% <0.00%> (+1.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8441d91...e8fe265. Read the comment docs.

@tsachiherman
Copy link
Contributor Author

Huh, so should I have been seeing mismatched block digests show up more than I did?

I depends on the precise scenario. A node that was using the fast catchup would produce an incorrect catchpoint label from that point and on. This would "fix itself" if the node happen to reset ( although, the historical generated catchpoint labels would remain incorrect ).

@tsachiherman tsachiherman marked this pull request as ready for review November 15, 2021 23:18
ct.catchpointWriting = 0
// keep these channel closed if we're not generating catchpoint
ct.catchpointSlowWriting = make(chan struct{}, 1)
close(ct.catchpointSlowWriting)
Copy link
Contributor

@cce cce Nov 16, 2021

Choose a reason for hiding this comment

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

Hrmm ... maybe renaming the loadFromDisk tracker interface method to "reloadFromDisk" or "resetFromDisk" or something to make it more clear for future authors that a tracker could have this method called multiple times during its lifetime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not opposing to that. I think that the existing method description in the interface definition already define that.

@tsachiherman tsachiherman merged commit eea0a75 into algorand:master Nov 16, 2021
@tsachiherman tsachiherman deleted the tsachi/fixcatchpointtracker branch November 16, 2021 15:06
@egieseke egieseke mentioned this pull request Nov 23, 2021
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.

4 participants