nervosnetwork / ckb-light-client

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

fix: refresh last state even no proved state #172

Closed yangby-cryptape closed 8 months ago

yangby-cryptape commented 8 months ago

Description

Currently, the light client only refreshes the last state after it has a proved last state. But, if it has sent a worse state to the light client (worse than saved state), the light client won't ask its last state proof.

The light client should ask it for a new last state.

codecov-commenter commented 8 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (be21607) 71.43% compared to head (ef511bd) 71.42%.

Files Patch % Lines
src/protocols/light_client/peers.rs 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #172 +/- ## =========================================== - Coverage 71.43% 71.42% -0.02% =========================================== Files 25 25 Lines 6511 6512 +1 =========================================== Hits 4651 4651 - Misses 1860 1861 +1 ``` | [Flag](https://app.codecov.io/gh/nervosnetwork/ckb-light-client/pull/172/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/nervosnetwork/ckb-light-client/pull/172/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork) | `71.42% <0.00%> (-0.02%)` | :arrow_down: | 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.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.