Skip to content

Conversation

@algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Feb 8, 2022

Summary

Catchpointdump does not have access to a ledger and it does not know
which consensus params is to use as genesis state on rewards calculation
that can lead to division by zero panic.

This PR sets a hardcoded value to ConsensusCurrentVersion.

Additionally, let net subcommand to return non-zero exit code
to indicate nothing was downloaded.
To do that I converted it to cobra.RunE-style method in order to use
a standard cobra's error reporting and exit code setter.

Test Plan

Tested manually

@algorandskiy algorandskiy force-pushed the pavel/catchpointdump-block branch from cdffffe to a834f11 Compare February 8, 2022 19:02
@algorandskiy algorandskiy changed the title catchpointdump: fetch block to set proto version catchpointdump: set genesis proto version Feb 8, 2022
@algorandskiy algorandskiy marked this pull request as draft February 8, 2022 19:28
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #3596 (cfc718e) into master (f00b072) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3596      +/-   ##
==========================================
- Coverage   47.59%   47.58%   -0.01%     
==========================================
  Files         370      370              
  Lines       60093    60093              
==========================================
- Hits        28601    28595       -6     
- Misses      28183    28185       +2     
- Partials     3309     3313       +4     
Impacted Files Coverage Δ
ledger/roundlru.go 90.56% <0.00%> (-5.67%) ⬇️
agreement/cryptoVerifier.go 75.17% <0.00%> (-2.13%) ⬇️
agreement/proposalManager.go 96.07% <0.00%> (-1.97%) ⬇️
catchup/peerSelector.go 98.95% <0.00%> (-1.05%) ⬇️
network/wsNetwork.go 62.79% <0.00%> (-0.20%) ⬇️
data/transactions/verify/txn.go 44.44% <0.00%> (ø)
network/wsPeer.go 68.33% <0.00%> (+0.27%) ⬆️
ledger/blockqueue.go 85.05% <0.00%> (+2.87%) ⬆️

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 f00b072...cfc718e. Read the comment docs.

@algorandskiy algorandskiy force-pushed the pavel/catchpointdump-block branch from cfc718e to 32c0f84 Compare February 8, 2022 20:15
@algorandskiy algorandskiy marked this pull request as ready for review February 8, 2022 20:18
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.

3 participants