nervosnetwork / ckb-light-client

CKB light client reference implementation
MIT License
14 stars 16 forks source link

fix: the stored last n headers is less than expected #121

Closed yangby-cryptape closed 1 year ago

yangby-cryptape commented 1 year ago

Issue

Let $N_{last}$ denote the constant LAST_N_BLOCKS.

Suppose there are follow steps:

The bug is:

Updates

Resolve #117.

codecov-commenter commented 1 year ago

Codecov Report

Base: 78.42% // Head: 79.56% // Increases project coverage by +1.14% :tada:

Coverage data is based on head (b629b2d) compared to base (c39cce3). Patch coverage: 97.59% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #121 +/- ## =========================================== + Coverage 78.42% 79.56% +1.14% =========================================== Files 23 23 Lines 4792 4855 +63 =========================================== + Hits 3758 3863 +105 + Misses 1034 992 -42 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `79.56% <97.59%> (+1.14%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork) | Coverage Δ | | |---|---|---| | [src/protocols/light\_client/peers.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9saWdodF9jbGllbnQvcGVlcnMucnM=) | `85.34% <80.00%> (-0.59%)` | :arrow_down: | | [...s/light\_client/components/send\_last\_state\_proof.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9saWdodF9jbGllbnQvY29tcG9uZW50cy9zZW5kX2xhc3Rfc3RhdGVfcHJvb2YucnM=) | `93.06% <98.27%> (+7.57%)` | :arrow_up: | | [...otocols/light\_client/components/send\_last\_state.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9saWdodF9jbGllbnQvY29tcG9uZW50cy9zZW5kX2xhc3Rfc3RhdGUucnM=) | `94.59% <100.00%> (+0.15%)` | :arrow_up: | | [src/protocols/light\_client/mod.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9saWdodF9jbGllbnQvbW9kLnJz) | `80.87% <100.00%> (+0.74%)` | :arrow_up: | | [src/protocols/status.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9zdGF0dXMucnM=) | `84.09% <100.00%> (+1.16%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.