Skip to content

Conversation

tzaffi
Copy link
Contributor

@tzaffi tzaffi commented May 15, 2023

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:

No state deltas are ever available for round 0

Test Plan

CI - introduced new unit test cases

@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Merging #78 (49d79f8) into master (442791a) will increase coverage by 1.43%.
The diff coverage is 74.53%.

@@            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     
Impacted Files Coverage Δ
conduit/data/block_export_data.go 100.00% <ø> (+92.30%) ⬆️
conduit/plugins/importers/algod/metrics.go 100.00% <ø> (ø)
...plugins/processors/filterprocessor/gen/generate.go 34.28% <ø> (ø)
pkg/cli/internal/list/list.go 20.75% <ø> (ø)
...lugins/exporters/postgresql/postgresql_exporter.go 66.66% <51.21%> (-11.54%) ⬇️
pkg/cli/cli.go 65.97% <65.97%> (ø)
conduit/pipeline/pipeline.go 66.09% <72.10%> (+0.64%) ⬆️
conduit/data/config.go 76.47% <76.47%> (ø)
conduit/plugins/importers/algod/algod_importer.go 87.38% <88.13%> (-0.93%) ⬇️
conduit/pipeline/errors.go 100.00% <100.00%> (ø)
... and 4 more

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

@tzaffi tzaffi marked this pull request as ready for review May 15, 2023 23:14
@tzaffi tzaffi requested a review from a team May 15, 2023 23:14
@bbroder-algo
Copy link

What does the algod state delta endpoint do if you request the zero round?

@tzaffi
Copy link
Contributor Author

tzaffi commented May 16, 2023

What does the algod state delta endpoint do if you request the zero round?

Current error stack:

"msg":"Unable to fetch state delta for round 0: HTTP 404: {"message":"failed retrieving State Delta

@tzaffi tzaffi merged commit db788f3 into master May 16, 2023
@tzaffi tzaffi deleted the bug-deltas-not-in-genesis branch May 16, 2023 15:25
Comment on lines 232 to +236
if algodImp.mode == followerMode {
if targetRound == 0 {
algodImp.logger.Info("No state deltas are ever available for round 0")
return true
}
Copy link
Contributor

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++
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@tzaffi tzaffi May 18, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants