LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 457 forks source link

Blockchain:hash returns incorrect hash #9150

Closed Incede closed 7 months ago

Incede commented 7 months ago

What was the problem?

This PR resolves #9148

How was it solved?

Fixed incorrect read of database stream

How was it tested?

Under examples app pos-mainchain ./bin/run blockchain hash -d ~/.lisk/pos-mainchain

codecov[bot] commented 7 months ago

Codecov Report

Merging #9150 (5c025f0) into hotfix/6.0.1 (f825978) will increase coverage by 0.00%. The diff coverage is 100.00%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/LiskHQ/lisk-sdk/pull/9150/graphs/tree.svg?width=650&height=150&src=pr&token=2JhT7caf5x&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LiskHQ)](https://app.codecov.io/gh/LiskHQ/lisk-sdk/pull/9150?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LiskHQ) ```diff @@ Coverage Diff @@ ## hotfix/6.0.1 #9150 +/- ## ============================================= Coverage 83.51% 83.52% ============================================= Files 606 606 Lines 22826 22827 +1 Branches 3364 3364 ============================================= + Hits 19064 19066 +2 + Misses 3762 3761 -1 ``` | [Files](https://app.codecov.io/gh/LiskHQ/lisk-sdk/pull/9150?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LiskHQ) | Coverage Δ | | |---|---|---| | [...nder/src/bootstrapping/commands/blockchain/hash.ts](https://app.codecov.io/gh/LiskHQ/lisk-sdk/pull/9150?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LiskHQ#diff-Y29tbWFuZGVyL3NyYy9ib290c3RyYXBwaW5nL2NvbW1hbmRzL2Jsb2NrY2hhaW4vaGFzaC50cw==) | `94.28% <100.00%> (+0.16%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/LiskHQ/lisk-sdk/pull/9150/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LiskHQ)
Incede commented 7 months ago

did we test this on mainnet data? I think we might need to chunk the data for whole db iteration

With the mainnet data here it takes ~2mins16sec on macOs M1 to complete and produce the output hash.