nervosnetwork / ckb-light-client

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

fix: skip asking proof if no updates for the last state #66

Closed yangby-cryptape closed 2 years ago

yangby-cryptape commented 2 years ago

Skip asking proof from a peer if its proved last block number is not greater its current last block number. Skip sampling blocks if there no enough blocks, just take all blocks.

codecov-commenter commented 2 years ago

Codecov Report

Base: 34.27% // Head: 35.10% // Increases project coverage by +0.83% :tada:

Coverage data is based on head (1c53208) compared to base (4962850). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #66 +/- ## =========================================== + Coverage 34.27% 35.10% +0.83% =========================================== Files 22 22 Lines 3475 3475 Branches 489 490 +1 =========================================== + Hits 1191 1220 +29 + Misses 2164 2135 -29 Partials 120 120 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `35.10% <100.00%> (+0.83%)` | :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/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork) | Coverage Δ | | |---|---|---| | [src/protocols/mod.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/66/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9tb2QucnM=) | `0.00% <ø> (ø)` | | | [src/protocols/light\_client/mod.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/66/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9saWdodF9jbGllbnQvbW9kLnJz) | `15.93% <100.00%> (+15.93%)` | :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.