algod importer: check if node needs catchup.#70
Merged
winder merged 11 commits intoalgorand:masterfrom May 9, 2023
Merged
Conversation
winder
commented
May 4, 2023
| assert.NoError(t, err) | ||
| } | ||
|
|
||
| func TestInitSuccess(t *testing.T) { |
Contributor
Author
There was a problem hiding this comment.
Entirely redundant with other tests.
winder
commented
May 4, 2023
| logs: []string{}, | ||
| }, | ||
| }, { | ||
| name: "monitor catchup success", |
Contributor
Author
There was a problem hiding this comment.
This test was accidentally deleted in an earlier PR.
winder
commented
May 4, 2023
Comment on lines
-25
to
-38
| var ( | ||
| logger *logrus.Logger | ||
| ctx context.Context | ||
| cancel context.CancelFunc | ||
| pRound sdk.Round | ||
| ) | ||
|
|
||
| func init() { | ||
| logger = logrus.New() | ||
| logger.SetOutput(os.Stdout) | ||
| logger.SetLevel(logrus.InfoLevel) | ||
| ctx, cancel = context.WithCancel(context.Background()) | ||
| pRound = sdk.Round(1) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Removing these globals fixed the parallel test race conditions.
Codecov Report
@@ Coverage Diff @@
## master #70 +/- ##
==========================================
+ Coverage 67.66% 69.05% +1.39%
==========================================
Files 32 36 +4
Lines 1976 2414 +438
==========================================
+ Hits 1337 1667 +330
- Misses 570 654 +84
- Partials 69 93 +24
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
winder
commented
May 5, 2023
Comment on lines
-35
to
+37
| if responder(req.URL.Path, w) { | ||
| if responder(req, w) { |
Contributor
Author
There was a problem hiding this comment.
Switched interface to pass the entire request so that they can check the method. Ended up not using GetSyncRound, so it isn't actually used.
4705f12 to
b2e3e64
Compare
b2e3e64 to
3986626
Compare
Eric-Warehime
approved these changes
May 8, 2023
bbroder-algo
reviewed
May 8, 2023
tzaffi
reviewed
May 8, 2023
tzaffi
reviewed
May 8, 2023
tzaffi
reviewed
May 8, 2023
1ccbd67 to
1da853e
Compare
tzaffi
reviewed
May 8, 2023
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
The catchup logic was too aggressive. It should not run unless it's needed. With this change the target block / state delta are queried. If they are available the catchup phase is skipped.
Test Plan
Update unit tests.