-
Notifications
You must be signed in to change notification settings - Fork 29
Bug-Fix: don't attempt to get deltas at round 0 #78
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
==========================================
+ Coverage 67.66% 69.09% +1.43%
==========================================
Files 32 36 +4
Lines 1976 2417 +441
==========================================
+ Hits 1337 1670 +333
- Misses 570 654 +84
- Partials 69 93 +24
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
What does the algod state delta endpoint do if you request the zero round? |
Current error stack:
|
if algodImp.mode == followerMode { | ||
if targetRound == 0 { | ||
algodImp.logger.Info("No state deltas are ever available for round 0") | ||
return true | ||
} |
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 does this return true? If the target round is 0 I think it would go ahead and no-op in the catchup function, but is it needed? Maybe in the case where Conduit is fully caught up and it is told to go back to 0?
I think this would be slightly more correct so that it still checks for the block.
if algodImp.mode == followerMode && targetRound != 0 {
Or maybe even
if targetRound == 0 {
targetRound++
}
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.
cc: @Eric-Warehime
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.
There were only two choices of what to return and that seemed the most reasonable to me. But we could change the API.
Summary
Don't attempt to query deltas from a follower node for round 0. Instead, just declare that we need to catch up and log:
Test Plan
CI - introduced new unit test cases