nervosnetwork / ckb-light-client

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

fix: unmatched MMR activate epoch for dev chain #102

Closed yangby-cryptape closed 1 year ago

yangby-cryptape commented 1 year ago

Issues

The MMR activate epoch for dev chains is incorrect.

Code for dev chain in CKB:

                let light_client = Deployment {
                    bit: 1,
                    start: 0,
                    timeout: 0,
                    min_activation_epoch: 0,
                    period: 10,
                    active_mode: ActiveMode::Always,
                    threshold: TESTNET_ACTIVATION_THRESHOLD,
                };

Also, add a method to change the MMR activate epoch for unit tests, since MMR activate epochs are non-zero in both of the mainnet and the testnet, and we have to test for that.

codecov-commenter commented 1 year ago

Codecov Report

Base: 77.55% // Head: 77.60% // Increases project coverage by +0.04% :tada:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #102 +/- ## =========================================== + Coverage 77.55% 77.60% +0.04% =========================================== Files 23 23 Lines 4630 4634 +4 =========================================== + Hits 3591 3596 +5 + Misses 1039 1038 -1 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `77.60% <100.00%> (+0.04%)` | :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/102?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/mod.rs](https://codecov.io/gh/nervosnetwork/ckb-light-client/pull/102/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nervosnetwork#diff-c3JjL3Byb3RvY29scy9saWdodF9jbGllbnQvbW9kLnJz) | `78.07% <100.00%> (+0.42%)` | :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.